From ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Thu, 30 Apr 2009 13:04:20 -0500 Subject: Second Life viewer sources 1.23.0-RC --- linden/indra/llrender/llrender.h | 47 ++++++++++++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 7 deletions(-) (limited to 'linden/indra/llrender/llrender.h') diff --git a/linden/indra/llrender/llrender.h b/linden/indra/llrender/llrender.h index e949190..437c715 100644 --- a/linden/indra/llrender/llrender.h +++ b/linden/indra/llrender/llrender.h @@ -22,7 +22,8 @@ * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, @@ -70,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, @@ -130,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) @@ -165,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; @@ -178,6 +206,7 @@ protected: eTextureBlendSrc mCurrAlphaSrc2; S32 mCurrColorScale; S32 mCurrAlphaScale; + bool mHasMipMaps; void debugTextureUnit(void); void setColorScale(S32 scale); @@ -291,6 +320,8 @@ public: void debugTexUnits(void); + void clearErrors(); + struct Vertex { GLfloat v[3]; @@ -315,6 +346,8 @@ private: LLStrider mColorsp; std::vector mTexUnits; LLTexUnit* mDummyTexUnit; + + F32 mMaxAnisotropy; }; extern F64 gGLModelView[16]; -- cgit v1.1