summaryrefslogtreecommitdiff
path: root/indra/llrender/llrender.h
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2011-09-14 16:30:45 -0500
committerDave Parks <davep@lindenlab.com>2011-09-14 16:30:45 -0500
commit7c95af74f195c9ec4ebc0fc0264d98cd4a85be49 (patch)
tree1bab2f431bd1df1e9f6f7058cad8d64119ec3bd3 /indra/llrender/llrender.h
parentc0ca2c62fd6b9a90542907ce46bf1fe0ab379e13 (diff)
SH-2243 work in progress -- application side matrix stack management
Diffstat (limited to 'indra/llrender/llrender.h')
-rw-r--r--indra/llrender/llrender.h36
1 files changed, 35 insertions, 1 deletions
diff --git a/indra/llrender/llrender.h b/indra/llrender/llrender.h
index c202aa4b73..465c16f0de 100644
--- a/indra/llrender/llrender.h
+++ b/indra/llrender/llrender.h
@@ -41,6 +41,8 @@
#include "llstrider.h"
#include "llpointer.h"
#include "llglheaders.h"
+#include "llmatrix4a.h"
+#include "glh/glh_linear.h"
class LLVertexBuffer;
class LLCubeMap;
@@ -48,6 +50,8 @@ class LLImageGL;
class LLRenderTarget;
class LLTexture ;
+#define LL_MATRIX_STACK_DEPTH 32
+
class LLTexUnit
{
friend class LLRender;
@@ -308,6 +312,18 @@ public:
BF_UNDEF
} eBlendFactor;
+ typedef enum
+ {
+ MM_MODELVIEW = 0,
+ MM_PROJECTION,
+ MM_TEXTURE0,
+ MM_TEXTURE1,
+ MM_TEXTURE2,
+ MM_TEXTURE3,
+ NUM_MATRIX_MODES,
+ MM_TEXTURE
+ } eMatrixMode;
+
LLRender();
~LLRender();
void init() ;
@@ -319,8 +335,19 @@ public:
void translatef(const GLfloat& x, const GLfloat& y, const GLfloat& z);
void scalef(const GLfloat& x, const GLfloat& y, const GLfloat& z);
+ void rotatef(const GLfloat& a, const GLfloat& x, const GLfloat& y, const GLfloat& z);
+ void ortho(F32 left, F32 right, F32 bottom, F32 top, F32 zNear, F32 zFar);
+
void pushMatrix();
void popMatrix();
+ void loadMatrix(const GLfloat* m);
+ void loadMatrix(const GLdouble* m);
+ void loadIdentity();
+ void multMatrix(const GLfloat* m);
+ void multMatrix(const GLdouble* m);
+ void matrixMode(U32 mode);
+
+ void syncMatrices();
void translateUI(F32 x, F32 y, F32 z);
void scaleUI(F32 x, F32 y, F32 z);
@@ -397,7 +424,14 @@ public:
static U32 sUIVerts;
private:
- bool mDirty;
+ U32 mMatrixMode;
+ U32 mMatIdx[NUM_MATRIX_MODES];
+ U32 mMatHash[NUM_MATRIX_MODES];
+ glh::matrix4f mMatrix[NUM_MATRIX_MODES][LL_MATRIX_STACK_DEPTH];
+
+ U32 mCurMatHash[NUM_MATRIX_MODES];
+
+ bool mDirty;
U32 mCount;
U32 mMode;
U32 mCurrTextureUnitIndex;