diff options
Diffstat (limited to 'source/modules/asura-core/graphics/gl.h')
-rw-r--r-- | source/modules/asura-core/graphics/gl.h | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/source/modules/asura-core/graphics/gl.h b/source/modules/asura-core/graphics/gl.h index e3c2ffc..82b9821 100644 --- a/source/modules/asura-core/graphics/gl.h +++ b/source/modules/asura-core/graphics/gl.h @@ -22,8 +22,14 @@ namespace AsuraEngine enum MatrixMode { - MATRIX_PROJECTION = 0, - MATRIX_MODELVIEW = 1, + MATRIX_MODE_PROJECTION = 0, + MATRIX_MODE_MODEL = 1, + MATRIX_MODE_VIEW = 2, + }; + + enum GLPrams + { + GL_PARAM_MAX_TEXTURE_UNIT = 1, }; /// @@ -40,15 +46,23 @@ namespace AsuraEngine ~OpenGL(); /// + /// óֵ + /// + int GetParam(GLPrams param); + + /// /// ʼOpenGLIJڴOpenGL֮˺עOpenGLĵַ /// bool Init(const AEMath::Recti& viewport); + bool Inited(); void SetViewport(const AEMath::Recti viewport); const AEMath::Recti& GetViewport(); void UseShader(Shader* shader); void UnuseShader(); + + void Draw(); /// /// Matrix stackز @@ -58,9 +72,9 @@ namespace AsuraEngine void PushMatrix(); void PopMatrix(); void LoadIdentity(); - void Rotate(float angle, float x, float y, float z); - void Translate(float x, float y, float z); - void Scale(float x, float y, float z); + void Rotate(float angle); + 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); uint GetMatrixDepth(); @@ -84,7 +98,7 @@ namespace AsuraEngine { Shader* shader; ///< ǰʹõshader AEMath::Recti viewport; ///< ǰлHDC߱ڴСı߲ˢʱ䶯 - MatrixStack matrix[2]; ///< 任 + MatrixStack matrix[3]; ///< model, view, projection MatrixMode matrixMode; ///< ǰľ } state; @@ -96,7 +110,8 @@ namespace AsuraEngine //----------------------------------------------------------------------------// - LUAX_DECL_ENUM(MatrixMode, 0); + LUAX_DECL_ENUM(MatrixMode, 1); + LUAX_DECL_ENUM(GLPrams, 1); LUAX_DECL_METHOD(_SetMatrixMode); LUAX_DECL_METHOD(_GetMatrixMode); |