From f4c338c63f3456a8eccd56c35e233843687d55be Mon Sep 17 00:00:00 2001 From: chai Date: Fri, 29 Mar 2019 00:43:25 +0800 Subject: *thread --- .../asura-lib-core/graphics/binding/_image.cpp | 4 +- source/libs/asura-lib-core/graphics/image.h | 9 ++- source/libs/asura-lib-core/graphics/shader.h | 2 +- source/libs/asura-lib-core/graphics/window.cpp | 50 ------------ source/libs/asura-lib-core/graphics/window.h | 90 ---------------------- .../asura-lib-core/graphics/window_impl_glew.cpp | 0 .../asura-lib-core/graphics/window_impl_glew.h | 0 .../asura-lib-core/graphics/window_impl_glut.cpp | 0 .../asura-lib-core/graphics/window_impl_glut.h | 0 .../asura-lib-core/graphics/window_impl_sdl.cpp | 0 .../libs/asura-lib-core/graphics/window_impl_sdl.h | 0 11 files changed, 8 insertions(+), 147 deletions(-) delete mode 100644 source/libs/asura-lib-core/graphics/window.cpp delete mode 100644 source/libs/asura-lib-core/graphics/window.h delete mode 100644 source/libs/asura-lib-core/graphics/window_impl_glew.cpp delete mode 100644 source/libs/asura-lib-core/graphics/window_impl_glew.h delete mode 100644 source/libs/asura-lib-core/graphics/window_impl_glut.cpp delete mode 100644 source/libs/asura-lib-core/graphics/window_impl_glut.h delete mode 100644 source/libs/asura-lib-core/graphics/window_impl_sdl.cpp delete mode 100644 source/libs/asura-lib-core/graphics/window_impl_sdl.h (limited to 'source/libs/asura-lib-core/graphics') diff --git a/source/libs/asura-lib-core/graphics/binding/_image.cpp b/source/libs/asura-lib-core/graphics/binding/_image.cpp index b455ad5..cb008d3 100644 --- a/source/libs/asura-lib-core/graphics/binding/_image.cpp +++ b/source/libs/asura-lib-core/graphics/binding/_image.cpp @@ -80,8 +80,8 @@ namespace AsuraEngine { LUAX_PREPARE(L, Image); - uint x = state.CheckParam(2); - uint y = state.CheckParam(3); + uint x = state.CheckValue(2); + uint y = state.CheckValue(3); Color32* c32 = new Color32(self->GetPixel(x, y)); c32->PushLuaxUserdata(state); return 1; diff --git a/source/libs/asura-lib-core/graphics/image.h b/source/libs/asura-lib-core/graphics/image.h index 4c1c7b5..4d9787b 100644 --- a/source/libs/asura-lib-core/graphics/image.h +++ b/source/libs/asura-lib-core/graphics/image.h @@ -22,8 +22,9 @@ namespace AsuraEngine class ImageFactory; /// - /// Image是图片从内存中载入后,读取进游戏后保存的结果。一个Image在内存、显存中只会保存一份,不会产生副本。需要特征 - /// 化的区别image,如锚点位置,缩放和旋转角度,使用sprite。是一个只读类。主要是考虑到editor和engine使用不同的封装。 + /// Image是图片从内存中载入后,读取进游戏后保存的结果。一个Image在内存、显存中只会保存一 + /// 份,不会产生副本。需要特征化的区别image,如锚点位置,缩放和旋转角度,使用sprite。 + /// 是一个只读类。主要是考虑到editor和engine使用不同的封装。 /// class Image ASURA_FINAL : public Drawable @@ -39,8 +40,8 @@ namespace AsuraEngine ~Image(); /// - /// 从数据buffer构建image像素信息,如果mPixels不为空,先清空数据。用来重新构建image,使用glTexImage2D重新提交image - /// 的像素数据。 + /// 从数据buffer构建image像素信息,如果mPixels不为空,先清空数据。用来重新构建image, + /// 使用glTexImage2D重新提交image的像素数据。 /// bool Load(ImageData* data); diff --git a/source/libs/asura-lib-core/graphics/shader.h b/source/libs/asura-lib-core/graphics/shader.h index 575a37e..1c81355 100644 --- a/source/libs/asura-lib-core/graphics/shader.h +++ b/source/libs/asura-lib-core/graphics/shader.h @@ -94,7 +94,7 @@ namespace AsuraEngine /// GLuint mProgramHandle; - //------------------------------------------------------------------------------------------------------------ + //------------------------------------------------------------------------------// public: diff --git a/source/libs/asura-lib-core/graphics/window.cpp b/source/libs/asura-lib-core/graphics/window.cpp deleted file mode 100644 index 83a4f53..0000000 --- a/source/libs/asura-lib-core/graphics/window.cpp +++ /dev/null @@ -1,50 +0,0 @@ -#include "Config.h" -#include "Window.h" - -namespace AsuraEngine -{ - namespace Graphics - { - - Window::Window(WindowStyle style) - { - } - - Window::~Window() - { - - } - - void Window::SetPosition(int x, int y) - { - ASSERT(mWindowHandle); - SDL_SetWindowPosition(mWindowHandle, x, y); - } - - void Window::SetTitle(const std::string& title) - { - - } - - void Window::Show() - { - - } - - void Window::Hide() - { - - } - - void Window::SetWindowStyle(WindowStyle style) - { - - } - - void Window::SwapRenderBuffer() - { - - } - - } -} diff --git a/source/libs/asura-lib-core/graphics/window.h b/source/libs/asura-lib-core/graphics/window.h deleted file mode 100644 index 1b219a2..0000000 --- a/source/libs/asura-lib-core/graphics/window.h +++ /dev/null @@ -1,90 +0,0 @@ -#ifndef __ASURA_ENGINE_WINDOW_H__ -#define __ASURA_ENGINE_WINDOW_H__ - -#include -#include - -#include "render_state.h" -#include "render_target.h" - -namespace AsuraEngine -{ - namespace Graphics - { - - class WindowImpl; - - enum WindowStyle - { - WINDOW_STYLE_FULLSCREEN = 1 << 1, - }; - - /// - /// 游戏的单窗口,runner只需要一个窗口。不同的客户端实现此接口并手动注册到lua。编辑器不会导入此类,将会嫁接到编辑器的 - /// 虚拟窗口上。 - /// - class Window - : public RenderTarget - , public AEScripting::Portable - { - public: - - LUAX_DECL_SINGLETON(Window); - - Window(WindowStyle style); - - ~Window(); - - void SetSize(uint width, uint height); - - void SetPosition(int x, int y); - - void SetTitle(const std::string& title); - - void SetWindowStyle(WindowStyle style); - - void Show(); - - void Hide(); - - /// - /// 如果是开启双缓冲的窗口,需要交换缓冲区来展示到前台 - /// - void SwapRenderBuffer(); - - void Clear(const Color& col = Color::Black); - - void Clear(const Math::Recti& quad, const Color& col = Color::Black); - - void Draw(const Drawable* texture, const RenderState& state); - - void Draw(const Drawable* texture, const Math::Recti& quad, const RenderState& state); - - protected: - - WindowImpl* mImpl; - - LUAX_DECL_METHOD(_Show); - LUAX_DECL_METHOD(_Hide); - LUAX_DECL_METHOD(_SetResolution); - LUAX_DECL_METHOD(_SetFullScreen); - LUAX_DECL_METHOD(_SetTitle); - LUAX_DECL_METHOD(_SetWindowStyle); - LUAX_DECL_METHOD(_Clear); - LUAX_DECL_METHOD(_Draw); - LUAX_DECL_METHOD(_SwapRenderBuffer); - - }; - - using RenderWindow = Window; - - ASURA_ABSTRACT class WindowImpl - { - public: - - }; - - } -} - -#endif \ No newline at end of file diff --git a/source/libs/asura-lib-core/graphics/window_impl_glew.cpp b/source/libs/asura-lib-core/graphics/window_impl_glew.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/source/libs/asura-lib-core/graphics/window_impl_glew.h b/source/libs/asura-lib-core/graphics/window_impl_glew.h deleted file mode 100644 index e69de29..0000000 diff --git a/source/libs/asura-lib-core/graphics/window_impl_glut.cpp b/source/libs/asura-lib-core/graphics/window_impl_glut.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/source/libs/asura-lib-core/graphics/window_impl_glut.h b/source/libs/asura-lib-core/graphics/window_impl_glut.h deleted file mode 100644 index e69de29..0000000 diff --git a/source/libs/asura-lib-core/graphics/window_impl_sdl.cpp b/source/libs/asura-lib-core/graphics/window_impl_sdl.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/source/libs/asura-lib-core/graphics/window_impl_sdl.h b/source/libs/asura-lib-core/graphics/window_impl_sdl.h deleted file mode 100644 index e69de29..0000000 -- cgit v1.1-26-g67d0