diff options
author | Dave Parks <davep@lindenlab.com> | 2011-11-15 17:04:37 -0600 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2011-11-15 17:04:37 -0600 |
commit | cfb666e9d9eb8945a79e2f7999459267caca36ee (patch) | |
tree | b02e73c02f6f377c99fffc950d72525516647f52 /indra/llrender/llrender.h | |
parent | 09c74484ae0df267f01610ab4b594e50a01c05c1 (diff) | |
parent | b493b8cca491c4b7a76f4c98b34272970d3bb58b (diff) |
merge
Diffstat (limited to 'indra/llrender/llrender.h')
-rw-r--r-- | indra/llrender/llrender.h | 61 |
1 files changed, 55 insertions, 6 deletions
diff --git a/indra/llrender/llrender.h b/indra/llrender/llrender.h index 8f7ee30d87..7581b9f908 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; @@ -235,6 +239,8 @@ public: void setSpotDirection(const LLVector3& direction); protected: + friend class LLRender; + S32 mIndex; bool mEnabled; LLColor4 mDiffuse; @@ -308,6 +314,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 +337,20 @@ 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 loadIdentity(); + void multMatrix(const GLfloat* m); + void matrixMode(U32 mode); + + const glh::matrix4f& getModelviewMatrix(); + + void syncMatrices(); + void syncLightState(); void translateUI(F32 x, F32 y, F32 z); void scaleUI(F32 x, F32 y, F32 z); @@ -351,6 +381,12 @@ public: void color3fv(const GLfloat* c); void color4ubv(const GLubyte* c); + void diffuseColor3f(F32 r, F32 g, F32 b); + void diffuseColor3fv(const F32* c); + void diffuseColor4f(F32 r, F32 g, F32 b, F32 a); + void diffuseColor4fv(const F32* c); + void diffuseColor4ubv(const U8* c); + void vertexBatchPreTransformed(LLVector3* verts, S32 vert_count); void vertexBatchPreTransformed(LLVector3* verts, LLVector2* uvs, S32 vert_count); void vertexBatchPreTransformed(LLVector3* verts, LLVector2* uvs, LLColor4U*, S32 vert_count); @@ -368,7 +404,8 @@ public: eBlendFactor alpha_sfactor, eBlendFactor alpha_dfactor); LLLightState* getLight(U32 index); - + void setAmbientLightColor(const LLColor4& color); + LLTexUnit* getTexUnit(U32 index); U32 getCurrentTexUnitIndex(void) const { return mCurrTextureUnitIndex; } @@ -389,9 +426,21 @@ public: public: static U32 sUICalls; static U32 sUIVerts; + static bool sGLCoreProfile; private: - bool mDirty; + friend class LLLightState; + + 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]; + U32 mLightHash; + LLColor4 mAmbientLightColor; + + bool mDirty; + U32 mQuadCycle; U32 mCount; U32 mMode; U32 mCurrTextureUnitIndex; @@ -419,10 +468,10 @@ private: }; -extern F64 gGLModelView[16]; -extern F64 gGLLastModelView[16]; -extern F64 gGLLastProjection[16]; -extern F64 gGLProjection[16]; +extern F32 gGLModelView[16]; +extern F32 gGLLastModelView[16]; +extern F32 gGLLastProjection[16]; +extern F32 gGLProjection[16]; extern S32 gGLViewport[4]; extern LLRender gGL; |