summaryrefslogtreecommitdiff
path: root/source/modules/asura-core/graphics/gl.h
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2019-04-13 20:15:07 +0800
committerchai <chaifix@163.com>2019-04-13 20:15:07 +0800
commit866e00474be3bfe0e7dac73b720af0b9ebf7109a (patch)
tree36c44e99352e2d582b4f2f1dbd4e9e672a54f2cf /source/modules/asura-core/graphics/gl.h
parentb5b43bac50ad58949e70bcd1a34b1e6c4765fd51 (diff)
*misc
Diffstat (limited to 'source/modules/asura-core/graphics/gl.h')
-rw-r--r--source/modules/asura-core/graphics/gl.h34
1 files changed, 23 insertions, 11 deletions
diff --git a/source/modules/asura-core/graphics/gl.h b/source/modules/asura-core/graphics/gl.h
index f28b983..6bb1ee0 100644
--- a/source/modules/asura-core/graphics/gl.h
+++ b/source/modules/asura-core/graphics/gl.h
@@ -8,6 +8,7 @@
#include <asura-utils/scripting/portable.hpp>
#include <asura-utils/math/rect.hpp>
#include <asura-utils/math/matrix44.h>
+#include <asura-utils/math/vector4.h>
#include "matrix_stack.h"
@@ -18,7 +19,6 @@ namespace AsuraEngine
class Profiler;
class Shader;
- class GPUBuffer;
enum MatrixMode
{
@@ -27,7 +27,7 @@ namespace AsuraEngine
MATRIX_MODE_VIEW = 2,
};
- enum GLPrams
+ enum GLParams
{
GL_PARAM_MAX_TEXTURE_UNIT = 1,
};
@@ -48,7 +48,7 @@ namespace AsuraEngine
///
/// óֵ
///
- int GetParam(GLPrams param);
+ int GetParam(GLParams param);
///
/// ʼOpenGLIJڴOpenGL֮󡣴˺עOpenGLĵַ
@@ -84,6 +84,9 @@ namespace AsuraEngine
uint GetMatrixDepth();
uint GetMatrixIndex();
+ void SetDrawColor(float r, float g, float b, float a);
+ AEMath::Vector4f& GetDrawColor();
+
///
/// ʾ
///
@@ -100,23 +103,32 @@ namespace AsuraEngine
///
struct
{
- Shader* shader; ///< ǰʹõshader
- AEMath::Recti viewport; ///< ǰлHDC߱ڴСı߲ˢʱ䶯
- MatrixStack matrix[3]; ///< model, view, projection
- MatrixMode matrixMode; ///< ǰľ
- uint drawcall; ///< ͳdrawcall
+ Shader* shader; ///< ǰʹõshader
+ AEMath::Recti viewport; ///< ǰлHDC߱ڴСı߲ˢʱ䶯
+ MatrixStack matrix[3]; ///< model, view, projection
+ MatrixMode matrixMode; ///< ǰľ
+ AEMath::Vector4f drawColor; ///< Ƶɫ
} state;
+#if ASURA_GL_PROFILE
+ struct
+ {
+ uint drawCall; ///< ͳdrawcall
+ uint canvasSwitch; ///< лtextureĴ
+ uint shaderSwitch; ///< лshaderĴ
+ } stats;
+#endif
+
private:
friend class Profiler;
- LUAX_DECL_SINGLETON(OpenGL);
-
//----------------------------------------------------------------------------//
+ LUAX_DECL_SINGLETON(OpenGL);
+
LUAX_DECL_ENUM(MatrixMode, 1);
- LUAX_DECL_ENUM(GLPrams, 1);
+ LUAX_DECL_ENUM(GLParams, 1);
LUAX_DECL_METHOD(_SetMatrixMode);
LUAX_DECL_METHOD(_GetMatrixMode);