From 66c5fdc564dd892ed265132d6c1378dbe3cebcee Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 27 Mar 2019 09:07:54 +0800 Subject: *misc --- source/libs/asura-lib-core/graphics/window.h | 45 ++++++++++++++++++---------- 1 file changed, 29 insertions(+), 16 deletions(-) (limited to 'source/libs/asura-lib-core/graphics/window.h') diff --git a/source/libs/asura-lib-core/graphics/window.h b/source/libs/asura-lib-core/graphics/window.h index cb036f1..0bfd6a1 100644 --- a/source/libs/asura-lib-core/graphics/window.h +++ b/source/libs/asura-lib-core/graphics/window.h @@ -1,8 +1,9 @@ #ifndef __ASURA_ENGINE_WINDOW_H__ #define __ASURA_ENGINE_WINDOW_H__ -#include "../scripting/portable.hpp" -#include "../math/vector2.hpp" +#include +#include + #include "render_state.h" #include "render_target.h" @@ -16,52 +17,64 @@ namespace AsuraEngine WINDOW_STYLE_FULLSCREEN = 1 << 1, }; + class WindowImpl; + /// /// 窗口,支持多窗口。在编辑器下需要多个窗口支持,runner只需要一个窗口。不同的客户端实现此接口并手动注册到lua。 /// - ASURA_ABSTRACT class Window + class Window : public RenderTarget + , public AEScripting::Portable { public: + LUAX_DECL_SINGLETON(Window); + Window(WindowStyle style); ~Window(); - virtual void SetSize(uint width, uint height) = 0; + void SetSize(uint width, uint height); - virtual void SetPosition(int x, int y) = 0; + void SetPosition(int x, int y); - virtual void SetTitle(const std::string& title) = 0; + void SetTitle(const std::string& title); - virtual void SetWindowStyle(WindowStyle style) = 0; + void SetWindowStyle(WindowStyle style); - virtual void Show() = 0; + void Show(); - virtual void Hide() = 0; + void Hide(); /// /// 如果是开启双缓冲的窗口,需要交换缓冲区来展示到前台 /// - virtual void SwapRenderBuffer() = 0; + void SwapRenderBuffer(); - virtual void Clear(const Color& col = Color::Black) = 0; + void Clear(const Color& col = Color::Black); - virtual void Clear(const Math::Recti& quad, const Color& col = Color::Black) = 0; + void Clear(const Math::Recti& quad, const Color& col = Color::Black); - virtual void Draw(const Drawable* texture, const RenderState& state) = 0; + void Draw(const Drawable* texture, const RenderState& state); - virtual void Draw(const Drawable* texture, const Math::Recti& quad, const RenderState& state) = 0; + void Draw(const Drawable* texture, const Math::Recti& quad, const RenderState& state); protected: - Math::Vector2i mPosition; - Math::Vector2i mSize; + WindowImpl* mImpl; }; using RenderWindow = Window; + ASURA_ABSTRACT class WindowImpl + { + public: + + + + }; + } } -- cgit v1.1-26-g67d0