diff options
author | Brad Kittenbrink <brad@lindenlab.com> | 2009-02-18 21:10:16 +0000 |
---|---|---|
committer | Brad Kittenbrink <brad@lindenlab.com> | 2009-02-18 21:10:16 +0000 |
commit | abdc99f21b542c4fea67030ddbd7166c9d1c6c63 (patch) | |
tree | 3e984e405adfdec189ca8a047daca5250737ffbf /indra/llrender/llrender.h | |
parent | 34412f0530cf6a411b4de906a8e9da59cbcb3a85 (diff) |
Merge of QAR-1267 to trunk. This was a combo merge of QAR-1175 (maint-render-9) and QAR-1236 (dll-msvcrt-2)
svn merge -r 109838:112264 svn+ssh://svn.lindenlab.com/svn/linden/branches/maint-render/maint-render-9-merge-r109833
Diffstat (limited to 'indra/llrender/llrender.h')
-rw-r--r-- | indra/llrender/llrender.h | 44 |
1 files changed, 38 insertions, 6 deletions
diff --git a/indra/llrender/llrender.h b/indra/llrender/llrender.h index 752a4e0b37..437c715c2f 100644 --- a/indra/llrender/llrender.h +++ b/indra/llrender/llrender.h @@ -71,6 +71,14 @@ public: TAM_CLAMP // No texture type is currently enabled } eTextureAddressMode; + typedef enum + { // Note: If mipmapping or anisotropic are not enabled or supported it should fall back gracefully + TFO_POINT = 0, // Equal to: min=point, mag=point, mip=none. + TFO_BILINEAR, // Equal to: min=linear, mag=linear, mip=point. + TFO_TRILINEAR, // Equal to: min=linear, mag=linear, mip=linear. + TFO_ANISOTROPIC // Equal to: min=anisotropic, max=anisotropic, mip=linear. + } eTextureFilterOptions; + typedef enum { TB_REPLACE = 0, @@ -131,30 +139,43 @@ public: // Sets this tex unit to be the currently active one void activate(void); - // Enables this texture unit for the given texture type (automatically disables any previously enabled texture type) + // Enables this texture unit for the given texture type + // (automatically disables any previously enabled texture type) void enable(eTextureType type); + // Disables the current texture unit void disable(void); // Binds the LLImageGL to this texture unit // (automatically enables the unit for the LLImageGL's texture type) - bool bind(const LLImageGL* texture, bool forceBind = false); + bool bind(LLImageGL* texture, bool forceBind = false); // Binds a cubemap to this texture unit // (automatically enables the texture unit for cubemaps) bool bind(LLCubeMap* cubeMap); - // Binds a render target to this texture unit (automatically enables the texture unit for the RT's texture type) + // Binds a render target to this texture unit + // (automatically enables the texture unit for the RT's texture type) bool bind(LLRenderTarget * renderTarget, bool bindDepth = false); - // Manually binds a texture to the texture unit (automatically enables the tex unit for the given texture type) - bool bindManual(eTextureType type, U32 texture); + // Manually binds a texture to the texture unit + // (automatically enables the tex unit for the given texture type) + bool bindManual(eTextureType type, U32 texture, bool hasMips = false); - // Unbinds the currently bound texture of the given type (only if there's a texture of the given type currently bound) + // Unbinds the currently bound texture of the given type + // (only if there's a texture of the given type currently bound) void unbind(eTextureType type); + // Sets the addressing mode used to sample the texture + // Warning: this stays set for the bound texture forever, + // make sure you want to permanently change the address mode for the bound texture. void setTextureAddressMode(eTextureAddressMode mode); + // Sets the filtering options used to sample the texture + // Warning: this stays set for the bound texture forever, + // make sure you want to permanently change the filtering for the bound texture. + void setTextureFilteringOption(LLTexUnit::eTextureFilterOptions option); + void setTextureBlendType(eTextureBlendType type); inline void setTextureColorBlend(eTextureBlendOp op, eTextureBlendSrc src1, eTextureBlendSrc src2 = TBS_PREV_COLOR) @@ -166,6 +187,12 @@ public: static U32 getInternalType(eTextureType type); + U32 getCurrTexture(void) { return mCurrTexture; } + + eTextureType getCurrType(void) { return mCurrTexType; } + + void setHasMipMaps(bool hasMips) { mHasMipMaps = hasMips; } + protected: S32 mIndex; U32 mCurrTexture; @@ -179,6 +206,7 @@ protected: eTextureBlendSrc mCurrAlphaSrc2; S32 mCurrColorScale; S32 mCurrAlphaScale; + bool mHasMipMaps; void debugTextureUnit(void); void setColorScale(S32 scale); @@ -292,6 +320,8 @@ public: void debugTexUnits(void); + void clearErrors(); + struct Vertex { GLfloat v[3]; @@ -316,6 +346,8 @@ private: LLStrider<LLColor4U> mColorsp; std::vector<LLTexUnit*> mTexUnits; LLTexUnit* mDummyTexUnit; + + F32 mMaxAnisotropy; }; extern F64 gGLModelView[16]; |