diff options
Diffstat (limited to 'source/libs/asura-lib-core/graphics/window.h')
-rw-r--r-- | source/libs/asura-lib-core/graphics/window.h | 45 |
1 files changed, 29 insertions, 16 deletions
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 <asura-lib-utils/scripting/portable.hpp> +#include <asura-lib-utils/math/vector2.hpp> + #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<Window> { 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: + + + + }; + } } |