diff options
author | chai <chaifix@163.com> | 2019-06-09 21:12:25 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2019-06-09 21:12:25 +0800 |
commit | 8ee3f7453bf7b0db5c7358e697e91714d825c87d (patch) | |
tree | 57283565219d1808b47bbd4a883a5a52b6eb7bae /source/modules/asura-core/graphics/gfx_device.h | |
parent | d7a972a0f16da0fd7bf4c0b70913920216ff3113 (diff) |
*misc
Diffstat (limited to 'source/modules/asura-core/graphics/gfx_device.h')
-rw-r--r-- | source/modules/asura-core/graphics/gfx_device.h | 31 |
1 files changed, 11 insertions, 20 deletions
diff --git a/source/modules/asura-core/graphics/gfx_device.h b/source/modules/asura-core/graphics/gfx_device.h index c93717f..3c5b383 100644 --- a/source/modules/asura-core/graphics/gfx_device.h +++ b/source/modules/asura-core/graphics/gfx_device.h @@ -33,12 +33,6 @@ namespace AsuraEngine GL_PARAM_MAX_TEXTURE_UNIT = 1, }; - /// - /// OpenGLģһЩopengl״̬١ڱ༭രڻ£һڶӦһhwnd - /// һhdcԼopengl contextʹwglMakeCurrent(hdc, glc)ָǰ̶߳ - /// Ⱦhdcopenglglcglм¼ľһ̵߳һڵһOpenGL - /// ĵ״ֶ̬֧Ⱦ - /// class GfxDevice : public AEScripting::Portable<GfxDevice> { public: @@ -46,6 +40,8 @@ namespace AsuraEngine GfxDevice(); ~GfxDevice(); + static GfxDevice& Get(); + int GetParam(GLParams param); bool Init(const AEMath::Recti& viewport); @@ -54,8 +50,8 @@ namespace AsuraEngine void SetViewport(const AEMath::Recti viewport); const AEMath::Recti& GetViewport(); - void UseShader(Shader* shader); - void UnuseShader(); + void UseShader(Shader* shader); + void UnuseShader(); Shader* GetShader(); void DrawArrays(GLenum mode, GLint first, GLsizei count); @@ -69,16 +65,16 @@ namespace AsuraEngine void Translate(float x, float y); void Scale(float x, float y); void Ortho(float l, float r, float b, float t, float n, float f); - AEMath::Matrix44& GetMatrix(MatrixMode mode); - AEMath::Matrix44 GetMVPMatrix(); uint GetMatrixDepth(); uint GetMatrixIndex(); + AEMath::Matrix44& GetMatrix(MatrixMode mode); + AEMath::Matrix44 GetMVPMatrix(); - void SetDrawColor(float r, float g, float b, float a); + void SetDrawColor(float r, float g, float b, float a); Color& GetDrawColor(); - void WipeError(); - bool HasError(); + void WipeError(); + bool HasError(); GLenum GetError(); struct @@ -103,7 +99,7 @@ namespace AsuraEngine friend class Profiler; - //----------------------------------------------------------------------------// + luaxport: LUAX_DECL_SINGLETON(GfxDevice); @@ -121,17 +117,12 @@ namespace AsuraEngine LUAX_DECL_METHOD(_Ortho); LUAX_DECL_METHOD(_GetMatrixDepth); LUAX_DECL_METHOD(_GetMatrixIndex); - LUAX_DECL_METHOD(_UseShader); LUAX_DECL_METHOD(_UnuseShader); - //----------------------------------------------------------------------------// - }; - /// - /// OpenGL - /// + // ȫgfx device extern GfxDevice gfx; } |