diff options
Diffstat (limited to 'Source/Asura.Engine/Graphics')
21 files changed, 0 insertions, 974 deletions
diff --git a/Source/Asura.Engine/Graphics/Application.Graphics.cpp b/Source/Asura.Engine/Graphics/Application.Graphics.cpp deleted file mode 100644 index 4d3102f..0000000 --- a/Source/Asura.Engine/Graphics/Application.Graphics.cpp +++ /dev/null @@ -1,19 +0,0 @@ -#include "Application.h" -#include "Sdl2/SDL.h" -#include "Exceptions/Exception.h" - -namespace AsuraEngine -{ - - /// - /// ʼgraphicsģ - /// - bool Application::InitGraphics() - { - - if (SDL_Init(SDL_INIT_VIDEO) < 0) - return false; - - } - -}
\ No newline at end of file diff --git a/Source/Asura.Engine/Graphics/Canvas.cpp b/Source/Asura.Engine/Graphics/Canvas.cpp deleted file mode 100644 index 61787b6..0000000 --- a/Source/Asura.Engine/Graphics/Canvas.cpp +++ /dev/null @@ -1,41 +0,0 @@ -#include "Canvas.h" - -namespace AsuraEngine -{ - namespace Graphics - { - - Canvas::Canvas() - : Texture() - , mWidth(0) - , mHeight(0) - { - glGenFramebuffers(1, &mFBO); - GLint current_fbo; - glGetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, ¤t_fbo); - glBindFramebuffer(GL_FRAMEBUFFER, mFBO); - glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, mTextureHandle, 0); - glBindFramebuffer(GL_FRAMEBUFFER, current_fbo); - } - - void Canvas::SetSize(uint w, uint h) - { - GLint current_tex; - glGetIntegerv(GL_TEXTURE_BINDING_2D, ¤t_tex); - glBindTexture(GL_TEXTURE_2D, mTextureHandle); - - glBindTexture(GL_TEXTURE_2D, current_tex); - } - - void Canvas::Bind() - { - - } - - void Canvas::Unbind() - { - - } - - } -}
\ No newline at end of file diff --git a/Source/Asura.Engine/Graphics/Canvas.h b/Source/Asura.Engine/Graphics/Canvas.h deleted file mode 100644 index c4e0f65..0000000 --- a/Source/Asura.Engine/Graphics/Canvas.h +++ /dev/null @@ -1,81 +0,0 @@ -#ifndef __ASURA_ENGINE_CANVAS_H__ -#define __ASURA_ENGINE_CANVAS_H__ - -#include <Scripting/Luax.hpp> - -#include "Math/Rect.hpp" -#include "GL.h" -#include "Texture.h" -#include "RenderTarget.h" - -namespace AsuraEngine -{ - namespace Graphics - { - - /// - /// CanvasҲԳΪrender textureҲΪtextureȾ - /// - class Canvas ASURA_FINAL - : public Drawable - , public RenderTarget - , public Scripting::Portable - { - public: - - Canvas(); - - ~Canvas(); - - /// - /// render textureĴС - /// - void SetSize(uint w, uint h); - - void Clear(const Color& col = Color::Black) override; - - void Clear(const Math::Recti& quad, const Color& col = Color::Black) override; - - void Render(const RenderTarget* rt, const Math::Vector2i& pos, const Math::Vector2i& scale, const Math::Vector2i& center, float rot); - - void Render(const RenderTarget* rt, const Math::Rectf& quad, const Math::Vector2i& pos, const Math::Vector2i& scale, const Math::Vector2i& center, float rot); - - void Draw(const Drawable* texture, const RenderState& state); - - void Draw(const Drawable* texture, const Math::Recti& quad, const RenderState& state); - - private: - - /// - /// Frame buffer object id. - /// - GLuint mFBO; - - /// - /// canvasĴС - /// - uint mWidth, mHeight; - - public: - - //---------------------------------------------------------------------------------------------------------- - - LUAX_DECL_FACTORY(SimCanvas); - - LUAX_DECL_METHOD(l_SetSize); - LUAX_DECL_METHOD(l_Bind); - LUAX_DECL_METHOD(l_Unbind); - - //---------------------------------------------------------------------------------------------------------- - - }; - - /// - /// CanvasΪRenderTexture - /// - using RenderTexture = Canvas; - - } -} - -#endif
\ No newline at end of file diff --git a/Source/Asura.Engine/Graphics/Color.cpp b/Source/Asura.Engine/Graphics/Color.cpp deleted file mode 100644 index 106493d..0000000 --- a/Source/Asura.Engine/Graphics/Color.cpp +++ /dev/null @@ -1,132 +0,0 @@ -#include "Color.h" - -namespace AsuraEngine -{ - namespace Graphics - { - - Color32::Color32() - { - r = g = b = a = 0; - } - - Color32::Color32(const Color32& c) - { - r = c.r; - g = c.g; - b = c.b; - a = c.a; - } - - Color32::Color32(const Color& c) - { - r = 255.f * c.r; - g = 255.f * c.g; - b = 255.f * c.b; - a = 255.f * c.a; - } - - Color32::Color32(byte r, byte g, byte b, byte a) - { - this->r = r; - this->g = g; - this->b = b; - this->a = a; - } - - int Color32::l_GetRed(lua_State* L) - { - - } - - int Color32::l_GetGreen(lua_State* L) - { - - } - - int Color32::l_GetBlue(lua_State* L) - { - - } - - int Color32::l_GetAlpha(lua_State* L) - { - - } - - //------------------------------------------------------------------------------------------------------------ - - Color::Color() - { - r = g = b = a = 0; - } - - Color::Color(const Color& c) - { - r = c.r; - g = c.g; - b = c.b; - a = c.a; - } - - Color::Color(float r, float g, float b, float a) - { - this->r = r; - this->g = g; - this->b = b; - this->a = a; - } - - Color::Color(const Color32& c) - { - r = c.r / 255.f; - g = c.g / 255.f; - b = c.b / 255.f; - a = c.a / 255.f; - } - - Color Color::operator *(const Color& c) - { - r *= c.r; - g *= c.g; - b *= c.b; - a *= c.a; - } - - int Color::l_GetRed(lua_State* L) - { - - } - - int Color::l_GetGreen(lua_State* L) - { - - } - - int Color::l_GetBlue(lua_State* L) - { - - } - - int Color::l_GetAlpha(lua_State* L) - { - - } - - int Color::l_Add(lua_State* L) - { - - } - - int Color::l_Minus(lua_State* L) - { - - } - - int Color::l_Multiply(lua_State* L) - { - - } - - } -}
\ No newline at end of file diff --git a/Source/Asura.Engine/Graphics/Color.h b/Source/Asura.Engine/Graphics/Color.h deleted file mode 100644 index 0d65cb1..0000000 --- a/Source/Asura.Engine/Graphics/Color.h +++ /dev/null @@ -1,94 +0,0 @@ -#ifndef __ASURA_ENGINE_COLOR_H__ -#define __ASURA_ENGINE_COLOR_H__ - -#include "Scripting/Luax.hpp" -#include "Scripting/Portable.h" -#include "Config.h" - -namespace AsuraEngine -{ - namespace Graphics - { - - class Color; - - /// - /// 32bitsɫ - /// - class Color32 ASURA_FINAL: public Scripting::Portable - { - public: - - Color32(); - - ~Color32(); - - Color32(const Color32& c); - - Color32(const Color& c); - - Color32(byte r, byte g, byte b, byte a); - - byte r, g, b, a; - - //---------------------------------------------------------------------------------------------------------- - - LUAX_DECL_FACTORY(Color32); - - LUAX_DECL_METHOD(l_ToColor); - LUAX_DECL_METHOD(l_GetRed); - LUAX_DECL_METHOD(l_GetGreen); - LUAX_DECL_METHOD(l_GetBlue); - LUAX_DECL_METHOD(l_GetAlpha); - LUAX_DECL_METHOD(l_Multiply); - LUAX_DECL_METHOD(l_Index); //r,g,b,a - LUAX_DECL_METHOD(l_NewIndex); //r,g,b,a - - //---------------------------------------------------------------------------------------------------------- - - }; - - /// - /// 淶ɫ - /// - class Color ASURA_FINAL: public Scripting::Portable - { - public: - - static Color Black; - static Color White; - static Color Red; - static Color Green; - static Color Blue; - - Color(); - - Color(const Color& c); - - Color(float r, float g, float b, float a); - - Color(const Color32& c); - - ~Color(); - - Color operator *(const Color& c); - - float r, g, b, a; - - //---------------------------------------------------------------------------------------------------------- - - LUAX_DECL_FACTORY(Color); - - LUAX_DECL_METHOD(l_ToColor32); - LUAX_DECL_METHOD(l_SetColor); - LUAX_DECL_METHOD(l_GetColor); - LUAX_DECL_METHOD(l_Multiply); // ɫ˷ - - //---------------------------------------------------------------------------------------------------------- - - }; - - } -} - -#endif
\ No newline at end of file diff --git a/Source/Asura.Engine/Graphics/GL.cpp b/Source/Asura.Engine/Graphics/GL.cpp deleted file mode 100644 index dac2ea4..0000000 --- a/Source/Asura.Engine/Graphics/GL.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "OpenGL.h" - -namespace AsuraEngine -{ - namespace Graphics - { - - - - } -}
\ No newline at end of file diff --git a/Source/Asura.Engine/Graphics/GL.h b/Source/Asura.Engine/Graphics/GL.h deleted file mode 100644 index 0661e17..0000000 --- a/Source/Asura.Engine/Graphics/GL.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef __ASURA_ENGINE_OPENGL_H__ -#define __ASURA_ENGINE_OPENGL_H__ - -#include "glad/glad.h" - -namespace AsuraEngine -{ - namespace Graphics - { - - class OpenGL - { - - }; - - } -} - -#endif
\ No newline at end of file diff --git a/Source/Asura.Engine/Graphics/Image.cpp b/Source/Asura.Engine/Graphics/Image.cpp deleted file mode 100644 index e704945..0000000 --- a/Source/Asura.Engine/Graphics/Image.cpp +++ /dev/null @@ -1,32 +0,0 @@ -#include "Config.h" -#include "Image.h" -#include "GL.h" - -namespace AsuraEngine -{ - namespace Graphics - { - - Image::Image() - { - } - - Image::~Image() - { - } - - //\Ϣ - bool Image::Load(ImageData* data) - { - ASSERT(data); - - glBindTexture(GL_TEXTURE_2D, mTextureHandle); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, data->width, data->height, 0, GL_RGBA, GL_UNSIGNED_BYTE, data->pixels); - glBindTexture(GL_TEXTURE_2D, 0); - return true; - - RRA(data, mImageData); - } - - } -}
\ No newline at end of file diff --git a/Source/Asura.Engine/Graphics/Image.h b/Source/Asura.Engine/Graphics/Image.h deleted file mode 100644 index 916c365..0000000 --- a/Source/Asura.Engine/Graphics/Image.h +++ /dev/null @@ -1,75 +0,0 @@ -#ifndef __ASURA_ENGINE_IMAGE_H__ -#define __ASURA_ENGINE_IMAGE_H__ - -#include "math/vector2.hpp" -#include "scripting/portable.hpp" -#include "fileSystem/reloadable.h" -#include "stringmap.hpp" -#include "manager.hpp" -#include "texture.h" -#include "color.h" -#include "image_data.h" -#include "render_state.h" - -namespace AsuraEngine -{ - namespace Graphics - { - - class ImageFactory; - - /// - /// ImageͼƬڴȡϷĽһImageڴ桢ԴֻᱣһݣҪ - /// imageêλãźתǶȣʹspriteһֻࡣҪǿǵeditorengineʹòͬķװ - /// - class Image ASURA_FINAL - : public Drawable - , public Scripting::Portable<Image> - , public Filesystem::Reloadable - { - public: - - Image(); - - ~Image(); - - /// - /// bufferimageϢmPixelsΪգݡ¹imageʹglTexImage2Dύimage - /// ݡ - /// - bool Load(ImageData* data); - - uint GetWidth(); - uint GetHeight(); - Math::Vector2u GetSize(); - - /// - /// ijһλõ - /// - Color32 GetPixel(uint x, uint y); - - void Render(const RenderTarget* rt, const RenderState& state) override; - - void Render(const RenderTarget* rt, const Math::Rectf& quad, const RenderState& state) override; - - private: - - ImageData* mImageData; - - Math::Vector2u mSize; - - public: - - LUAX_DECL_FACTORY(SimImage); - - LUAX_DECL_METHOD(l_Load); - LUAX_DECL_METHOD(l_GetWidth); - LUAX_DECL_METHOD(l_GetHeight); - LUAX_DECL_METHOD(l_GetSize); - - }; - - } -} - -#endif
\ No newline at end of file diff --git a/Source/Asura.Engine/Graphics/Mesh2D.cpp b/Source/Asura.Engine/Graphics/Mesh2D.cpp deleted file mode 100644 index e69de29..0000000 --- a/Source/Asura.Engine/Graphics/Mesh2D.cpp +++ /dev/null diff --git a/Source/Asura.Engine/Graphics/Mesh2D.h b/Source/Asura.Engine/Graphics/Mesh2D.h deleted file mode 100644 index 2c58f00..0000000 --- a/Source/Asura.Engine/Graphics/Mesh2D.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef __ASURA_ENGINE_MESH2D_H__ -#define __ASURA_ENGINE_MESH2D_H__ - -#include "Scripting/Luax.hpp" - -#include "scripting/portable.hpp" - -namespace AsuraEngine -{ - namespace Graphics - { - - /// - /// 2D meshһЩ㶯 - /// - class Mesh2D ASURA_FINAL - : public Scripting::Portable<Mesh2D> - { - public: - - Mesh2D(); - - ~Mesh2D(); - - }; - - } -} - -#endif
\ No newline at end of file diff --git a/Source/Asura.Engine/Graphics/Quad.cpp b/Source/Asura.Engine/Graphics/Quad.cpp deleted file mode 100644 index e69de29..0000000 --- a/Source/Asura.Engine/Graphics/Quad.cpp +++ /dev/null diff --git a/Source/Asura.Engine/Graphics/Quad.h b/Source/Asura.Engine/Graphics/Quad.h deleted file mode 100644 index b7dd3d9..0000000 --- a/Source/Asura.Engine/Graphics/Quad.h +++ /dev/null @@ -1 +0,0 @@ -// Quadrectڣrectǵıƫᣬquadһ diff --git a/Source/Asura.Engine/Graphics/Shader.cpp b/Source/Asura.Engine/Graphics/Shader.cpp deleted file mode 100644 index 1a85866..0000000 --- a/Source/Asura.Engine/Graphics/Shader.cpp +++ /dev/null @@ -1,81 +0,0 @@ -#include "Shader.h" - -namespace AsuraEngine -{ - namespace Graphics - { - - Shader::Shader() - { - - } - - Shader::~Shader() - { - - } - - bool Shader::Load(const std::string& vertexShader, const std::string& fragmentShader) - { - - } - - uint Shader::GetUniformLocation(const std::string& uniform) - { - - } - - GLuint Shader::GetGLProgramHandle() - { - return mProgramHandle; - } - - void Shader::Use() - { - - } - - void Shader::Unuse() - { - - } - - void Shader::SetUniformFloat(uint loc, float value) - { - - } - - void Shader::SetUniformFloat(uint loc, float value) - { - - } - - void Shader::SetUniformTexture(uint loc, const Texture& texture) - { - - } - - void Shader::SetUniformVector2(uint loc, const Math::Vector2f& vec2) - { - - } - - void Shader::SetUniformVector3(uint loc, const Math::Vector3f& vec3) - { - - } - - void Shader::SetUniformVector4(uint loc, const Math::Vector4f& vec4) - { - - } - - uint Shader::GetGLTextureUnitCount() - { - GLint maxTextureUnits = 0; - glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, &maxTextureUnits); - return (uint)maxTextureUnits; - } - - } -}
\ No newline at end of file diff --git a/Source/Asura.Engine/Graphics/Shader.h b/Source/Asura.Engine/Graphics/Shader.h deleted file mode 100644 index 65f214e..0000000 --- a/Source/Asura.Engine/Graphics/Shader.h +++ /dev/null @@ -1,125 +0,0 @@ -#ifndef __ASURA_ENGINE_SHADER_H__ -#define __ASURA_ENGINE_SHADER_H__ - -#include <map> -#include <string> - -#include "FileSystem/Reloadable.h" -#include "Scripting/Luax.hpp" -#include "Math/Vector2.hpp" -#include "Math/Vector3.hpp" -#include "Math/Vector4.h" -#include "Math/Matrix44.h" -#include "StringMap.hpp" -#include "scripting/portable.hpp" -#include "Color.h" -#include "Manager.hpp" -#include "Texture.h" -#include "GL.h" - -namespace AsuraEngine -{ - namespace Graphics - { - - /// - /// һshaderһڲʼ乲ijShaderuniformsͶݣֻṩuniformsuseɫķ༭ - /// ÿshaderͨshaderҵuniforms¶frameworkmaterialá - /// - class Shader ASURA_FINAL - : public Scripting::Portable<Shader> - , public Filesystem::Reloadable - { - public: - - Shader(); - - ~Shader(); - - /// - /// ӴshaderʱȼǷϴλuniforms location mapʹglAttachShader±ɫ - /// ɫ - /// - bool Load(const std::string& vertexShader, const std::string& fragmentShader); - - /// - /// shaderΪ - /// - void Use(); - - /// - /// shaderΪǻ - /// - void Unuse(); - - /// - /// Ѿ֪uniform location£ֵ - /// - void SetUniformFloat(uint loc, float value); - void SetUniformTexture(uint loc, const Texture& texture); - void SetUniformVector2(uint loc, const Math::Vector2f& vec2); - void SetUniformVector3(uint loc, const Math::Vector3f& vec3); - void SetUniformVector4(uint loc, const Math::Vector4f& vec4); - void SetUniformColor(uint loc, const Color& color); - void SetUniformMatrix44(uint loc, const Math::Matrix44& mat44); - - uint GetUniformLocation(const std::string& uniform); - - bool HasUniform(const std::string& uniform); - - GLuint GetGLProgramHandle(); - - /// - /// texture unitһΪ16 - /// - static uint GetGLTextureUnitCount(); - - private: - - /// - /// ǰshader - /// - static Shader* mCurrentShader; - - /// - /// ñ - /// vec2 Asura_Time xֵΪ뵱ǰʼʱ䣬yֵΪһ֡ʱ - /// vec2 Asura_RenderTargetSize RTĴСΪλ - /// Texture Asura_MainTexture - /// - void SetBuiltInUniforms(); - - /// - /// OpenGL shader program handle. - /// - GLuint mProgramHandle; - - //------------------------------------------------------------------------------------------------------------ - - public: - - LUAX_DECL_FACTORY(SimShader); - - LUAX_DECL_METHOD(l_Use); - LUAX_DECL_METHOD(l_Unuse); - LUAX_DECL_METHOD(l_Load); - LUAX_DECL_METHOD(l_HasUniform); - LUAX_DECL_METHOD(l_GetUniformLocation); - LUAX_DECL_METHOD(l_SetBuiltInUniforms); - LUAX_DECL_METHOD(l_SetUniformFloat); - LUAX_DECL_METHOD(l_SetUniformTexture); - LUAX_DECL_METHOD(l_SetUniformVector2); - LUAX_DECL_METHOD(l_SetUniformVector3); - LUAX_DECL_METHOD(l_SetUniformVector4); - LUAX_DECL_METHOD(l_SetUniformColor); - - private: - - Luax::LuaxMemberRef mCodeLuaRef; - - }; - - } -} - -#endif
\ No newline at end of file diff --git a/Source/Asura.Engine/Graphics/Shape.cpp b/Source/Asura.Engine/Graphics/Shape.cpp deleted file mode 100644 index e69de29..0000000 --- a/Source/Asura.Engine/Graphics/Shape.cpp +++ /dev/null diff --git a/Source/Asura.Engine/Graphics/Shape.h b/Source/Asura.Engine/Graphics/Shape.h deleted file mode 100644 index e69de29..0000000 --- a/Source/Asura.Engine/Graphics/Shape.h +++ /dev/null diff --git a/Source/Asura.Engine/Graphics/Texture.cpp b/Source/Asura.Engine/Graphics/Texture.cpp deleted file mode 100644 index 6cb6497..0000000 --- a/Source/Asura.Engine/Graphics/Texture.cpp +++ /dev/null @@ -1,26 +0,0 @@ -#include "Texture.h" - -namespace AsuraEngine -{ - namespace Graphics - { - - Texture::Texture() - : mTextureHandle(0) - { - // GL texture - glGenTextures(1, &mTextureHandle); - } - - Texture::~Texture() - { - glDeleteTextures(1, &mTextureHandle); - } - - GLuint Texture::GetGLTextureHandle() const - { - return mTextureHandle; - } - - } -}
\ No newline at end of file diff --git a/Source/Asura.Engine/Graphics/Texture.h b/Source/Asura.Engine/Graphics/Texture.h deleted file mode 100644 index 81aa469..0000000 --- a/Source/Asura.Engine/Graphics/Texture.h +++ /dev/null @@ -1,66 +0,0 @@ -#ifndef __ASURA_ENGINE_TEXTURE_H__ -#define __ASURA_ENGINE_TEXTURE_H__ - -#include "Config.h" -#include "Math/Rect.hpp" -#include "Math/Vector2.hpp" -#include "Scripting/Luax.hpp" -#include "RenderState.h" -#include "GL.h" - -namespace AsuraEngine -{ - namespace Graphics - { - - class RenderTarget; - - /// - /// 2D࣬2d meshrender targetбʹáTextureȾԭϽǣϷϲԵѿϵΪ - /// EditorҲϽΪԭ㣬Ϊ˷㡣 - /// - ASURA_ABSTRACT class Texture - { - public: - - Texture(); - - virtual ~Texture(); - - GLuint GetGLTextureHandle() const; - - /// - /// ȾtexturertϣԭϽǣң - /// - virtual void Render(const RenderTarget* rt, const RenderState& state) = 0; - - /// - /// ȾtextureһֵrtϣԭϽǣң졣 - /// - virtual void Render(const RenderTarget* rt, const Math::Rectf& quad, const RenderState& state) = 0; - - /// - /// ù˷ʽ - /// - void SetSmooth(bool smooth); - - /// - /// ظʽ - /// - void SetRepeated(); - - protected: - - /// - /// OpenGL texture handle - /// - GLuint mTextureHandle; - - }; - - using Drawable = Texture; - - } -} - -#endif
\ No newline at end of file diff --git a/Source/Asura.Engine/Graphics/Window.cpp b/Source/Asura.Engine/Graphics/Window.cpp deleted file mode 100644 index bb941e1..0000000 --- a/Source/Asura.Engine/Graphics/Window.cpp +++ /dev/null @@ -1,56 +0,0 @@ -#include "Config.h" -#include "Window.h" - -namespace AsuraEngine -{ - namespace Graphics - { - - Window::Window(WindowStyle style) - { - //mWindowHandle = SDL_CreateWindow(); - } - - Window::~Window() - { - - } - - SDL_Window* Window::GetSDLWindowHandle() - { - return mWindowHandle; - } - - 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/Asura.Engine/Graphics/Window.h b/Source/Asura.Engine/Graphics/Window.h deleted file mode 100644 index 973fd98..0000000 --- a/Source/Asura.Engine/Graphics/Window.h +++ /dev/null @@ -1,85 +0,0 @@ -#ifndef __ASURA_ENGINE_WINDOW_H__ -#define __ASURA_ENGINE_WINDOW_H__ - -#include "SDL2/Sdl.h" -#include "Graphics/RenderTarget.h" -#include "Math/Vector2.hpp" -#include "Scripting/Portable.h" - -namespace AsuraEngine -{ - namespace Graphics - { - - enum WindowStyle - { - WINDOW_STYLE_FULLSCREEN = 1 << 1, - }; - - /// - /// ڣֶ֧രڡڱ༭Ҫ֧֣runnerֻҪһڡ - /// - class Window ASURA_FINAL - : public RenderTarget - , public Scripting::Portable - { - public: - - Window(WindowStyle style); - - ~Window(); - - SDL_Window* GetSDLWindowHandle(); - - 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) override; - - void Clear(const Math::Recti& quad, const Color& col = Color::Black) override; - - void Draw(const Drawable* texture, const RenderState& state) override; - - void Draw(const Drawable* texture, const Math::Recti& quad, const RenderState& state) override; - - private: - - /// - /// SDL window handle. - /// - SDL_Window* mWindowHandle; - - Math::Vector2i mPosition; - - Math::Vector2i mSize; - - public: - - //---------------------------------------------------------------------------------------------------------- - - LUAX_DECL_FACTORY(Window); - - //---------------------------------------------------------------------------------------------------------- - - }; - - using RenderWindow = Window; - - } -} - -#endif
\ No newline at end of file |