From 1497dccd63a84b7ee2b229b1ad9c5c02718f2a78 Mon Sep 17 00:00:00 2001 From: chai Date: Tue, 19 Mar 2019 23:06:27 +0800 Subject: *rename --- source/libs/asura-lib-core/graphics/window.h | 68 ++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 source/libs/asura-lib-core/graphics/window.h (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 new file mode 100644 index 0000000..cb036f1 --- /dev/null +++ b/source/libs/asura-lib-core/graphics/window.h @@ -0,0 +1,68 @@ +#ifndef __ASURA_ENGINE_WINDOW_H__ +#define __ASURA_ENGINE_WINDOW_H__ + +#include "../scripting/portable.hpp" +#include "../math/vector2.hpp" +#include "render_state.h" +#include "render_target.h" + +namespace AsuraEngine +{ + namespace Graphics + { + + enum WindowStyle + { + WINDOW_STYLE_FULLSCREEN = 1 << 1, + }; + + /// + /// 窗口,支持多窗口。在编辑器下需要多个窗口支持,runner只需要一个窗口。不同的客户端实现此接口并手动注册到lua。 + /// + ASURA_ABSTRACT class Window + : public RenderTarget + { + public: + + Window(WindowStyle style); + + ~Window(); + + virtual void SetSize(uint width, uint height) = 0; + + virtual void SetPosition(int x, int y) = 0; + + virtual void SetTitle(const std::string& title) = 0; + + virtual void SetWindowStyle(WindowStyle style) = 0; + + virtual void Show() = 0; + + virtual void Hide() = 0; + + /// + /// 如果是开启双缓冲的窗口,需要交换缓冲区来展示到前台 + /// + virtual void SwapRenderBuffer() = 0; + + virtual void Clear(const Color& col = Color::Black) = 0; + + virtual void Clear(const Math::Recti& quad, const Color& col = Color::Black) = 0; + + virtual void Draw(const Drawable* texture, const RenderState& state) = 0; + + virtual void Draw(const Drawable* texture, const Math::Recti& quad, const RenderState& state) = 0; + + protected: + + Math::Vector2i mPosition; + Math::Vector2i mSize; + + }; + + using RenderWindow = Window; + + } +} + +#endif \ No newline at end of file -- cgit v1.1-26-g67d0