LLGLSLShader Class Reference

#include <llglslshader.h>

Collaboration diagram for LLGLSLShader:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 LLGLSLShader ()
void unload ()
void attachObject (GLhandleARB object)
void attachObjects (GLhandleARB *objects=NULL, S32 count=0)
BOOL mapAttributes (const char **attrib_names=NULL, S32 count=0)
BOOL mapUniforms (const char **uniform_names=NULL, S32 count=0)
void mapUniform (GLint index, const char **uniform_names=NULL, S32 count=0)
void vertexAttrib4f (U32 index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
void vertexAttrib4fv (U32 index, GLfloat *v)
GLint mapUniformTextureChannel (GLint location, GLenum type)
S32 enableTexture (S32 uniform, S32 mode=GL_TEXTURE_2D)
S32 disableTexture (S32 uniform, S32 mode=GL_TEXTURE_2D)
BOOL link (BOOL suppress_errors=FALSE)
void bind ()
void unbind ()

Public Attributes

GLhandleARB mProgramObject
std::vector< GLint > mAttribute
std::vector< GLint > mUniform
std::vector< GLint > mTexture
S32 mActiveTextureChannels

Detailed Description

Definition at line 37 of file llglslshader.h.


Constructor & Destructor Documentation

LLGLSLShader::LLGLSLShader (  ) 

Definition at line 974 of file llglslshader.cpp.


Member Function Documentation

void LLGLSLShader::attachObject ( GLhandleARB  object  ) 

Definition at line 1007 of file llglslshader.cpp.

References llendl, llwarns, mProgramObject, and stop_glerror.

Referenced by attachObjects(), LLShaderMgr::loadShadersAvatar(), LLShaderMgr::loadShadersEnvironment(), LLShaderMgr::loadShadersInterface(), and LLShaderMgr::loadShadersObject().

void LLGLSLShader::attachObjects ( GLhandleARB *  objects = NULL,
S32  count = 0 
)

Definition at line 1021 of file llglslshader.cpp.

References attachObject(), i, and S32.

Referenced by LLShaderMgr::loadShadersAvatar(), LLShaderMgr::loadShadersEnvironment(), and LLShaderMgr::loadShadersObject().

void LLGLSLShader::bind (  ) 

Definition at line 1160 of file llglslshader.cpp.

References gMaterialIndex, mAttribute, and mProgramObject.

Referenced by LLDrawPoolBump::beginShiny(), LLDrawPoolAvatar::beginSkinned(), mapUniforms(), LLDrawPoolTerrain::render(), LLPipeline::renderBloom(), LLDrawPoolAvatar::renderForSelect(), LLPipeline::renderHighlights(), LLDrawPoolWater::renderShaderSimple(), and LLDrawPoolWater::shade().

S32 LLGLSLShader::disableTexture ( S32  uniform,
S32  mode = GL_TEXTURE_2D 
)

Definition at line 1193 of file llglslshader.cpp.

References glDisable, mTexture, and S32.

Referenced by LLDrawPoolAvatar::endSkinned(), LLDrawPoolTerrain::renderFull4TUShader(), LLDrawPoolWater::renderShaderSimple(), and LLDrawPoolWater::shade().

S32 LLGLSLShader::enableTexture ( S32  uniform,
S32  mode = GL_TEXTURE_2D 
)

Definition at line 1178 of file llglslshader.cpp.

References glEnable, llendl, llerrs, mTexture, and S32.

Referenced by LLDrawPoolAvatar::beginSkinned(), LLDrawPoolTerrain::renderFull4TUShader(), LLDrawPoolWater::renderShaderSimple(), and LLDrawPoolWater::shade().

BOOL LLGLSLShader::link ( BOOL  suppress_errors = FALSE  ) 

Definition at line 1155 of file llglslshader.cpp.

References LLShaderMgr::linkProgramObject(), and mProgramObject.

Referenced by mapAttributes().

BOOL LLGLSLShader::mapAttributes ( const char **  attrib_names = NULL,
S32  count = 0 
)

Definition at line 1029 of file llglslshader.cpp.

References FALSE, i, link(), llendl, llinfos, mAttribute, mProgramObject, S32, LLShaderMgr::sReservedAttribCount, LLShaderMgr::sReservedAttribs, and TRUE.

Referenced by LLShaderMgr::loadShadersAvatar(), LLShaderMgr::loadShadersEnvironment(), LLShaderMgr::loadShadersInterface(), and LLShaderMgr::loadShadersObject().

void LLGLSLShader::mapUniform ( GLint  index,
const char **  uniform_names = NULL,
S32  count = 0 
)

Definition at line 1069 of file llglslshader.cpp.

References i, llendl, llinfos, mapUniformTextureChannel(), mProgramObject, mTexture, mUniform, S32, size, and type.

Referenced by mapUniforms().

BOOL LLGLSLShader::mapUniforms ( const char **  uniform_names = NULL,
S32  count = 0 
)

Definition at line 1127 of file llglslshader.cpp.

References bind(), i, mActiveTextureChannels, mapUniform(), mProgramObject, mTexture, mUniform, S32, TRUE, and unbind().

Referenced by LLShaderMgr::loadShadersAvatar(), LLShaderMgr::loadShadersEnvironment(), LLShaderMgr::loadShadersInterface(), and LLShaderMgr::loadShadersObject().

GLint LLGLSLShader::mapUniformTextureChannel ( GLint  location,
GLenum  type 
)

Definition at line 1116 of file llglslshader.cpp.

References llendl, llinfos, and mActiveTextureChannels.

Referenced by mapUniform().

void LLGLSLShader::unbind (  ) 

Definition at line 1169 of file llglslshader.cpp.

References i, mAttribute, and vertexAttrib4f().

Referenced by LLDrawPoolBump::endShiny(), LLDrawPoolAvatar::endSkinned(), mapUniforms(), LLPipeline::renderBloom(), LLDrawPoolAvatar::renderForSelect(), and LLPipeline::renderHighlights().

void LLGLSLShader::unload (  ) 

Definition at line 978 of file llglslshader.cpp.

References count, glGetError, i, mAttribute, mProgramObject, mTexture, mUniform, and stop_glerror.

Referenced by LLShaderMgr::loadShadersAvatar(), LLShaderMgr::loadShadersEnvironment(), LLShaderMgr::loadShadersInterface(), LLShaderMgr::loadShadersObject(), and LLShaderMgr::unloadShaders().

void LLGLSLShader::vertexAttrib4f ( U32  index,
GLfloat  x,
GLfloat  y,
GLfloat  z,
GLfloat  w 
)

Definition at line 1204 of file llglslshader.cpp.

References mAttribute.

Referenced by LLDrawPoolTerrain::render(), LLPipeline::renderHighlights(), and unbind().

void LLGLSLShader::vertexAttrib4fv ( U32  index,
GLfloat *  v 
)

Definition at line 1212 of file llglslshader.cpp.

References mAttribute.

Referenced by LLDrawPoolAvatar::renderAvatars().


Member Data Documentation

S32 LLGLSLShader::mActiveTextureChannels

Definition at line 69 of file llglslshader.h.

Referenced by mapUniforms(), and mapUniformTextureChannel().

std::vector<GLint> LLGLSLShader::mAttribute

Definition at line 66 of file llglslshader.h.

Referenced by LLDrawPoolAvatar::beginSkinned(), bind(), LLDrawPoolAvatar::endSkinned(), LLDrawPoolTree::getMaterialAttribIndex(), LLDrawPoolTerrain::getMaterialAttribIndex(), mapAttributes(), LLDrawPoolAvatar::renderForSelect(), LLVertexBufferAvatar::setupVertexBuffer(), unbind(), unload(), vertexAttrib4f(), and vertexAttrib4fv().

GLhandleARB LLGLSLShader::mProgramObject

Definition at line 65 of file llglslshader.h.

Referenced by attachObject(), bind(), link(), LLShaderMgr::loadShadersAvatar(), LLShaderMgr::loadShadersEnvironment(), LLShaderMgr::loadShadersInterface(), LLShaderMgr::loadShadersObject(), mapAttributes(), mapUniform(), mapUniforms(), and unload().

std::vector<GLint> LLGLSLShader::mTexture

Definition at line 68 of file llglslshader.h.

Referenced by disableTexture(), enableTexture(), mapUniform(), mapUniforms(), and unload().

std::vector<GLint> LLGLSLShader::mUniform

Definition at line 67 of file llglslshader.h.

Referenced by LLDrawPoolBump::beginShiny(), mapUniform(), mapUniforms(), LLDrawPoolAvatar::renderAvatars(), LLPipeline::renderBloom(), LLDrawPoolAvatar::renderForSelect(), LLDrawPoolWater::shade(), and unload().


The documentation for this class was generated from the following files:
Generated on Thu Jul 1 06:11:23 2010 for Second Life Viewer by  doxygen 1.4.7