Pyrogenesis  13997
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Attributes | List of all members
CShaderProgramARB Class Reference
Inheritance diagram for CShaderProgramARB:
CShaderProgram

Public Member Functions

 CShaderProgramARB (const VfsPath &vertexFile, const VfsPath &fragmentFile, const CShaderDefines &defines, const std::map< CStrIntern, int > &vertexIndexes, const std::map< CStrIntern, frag_index_pair_t > &fragmentIndexes, int streamflags)
 
 ~CShaderProgramARB ()
 
bool Compile (GLuint target, const char *targetName, GLuint program, const VfsPath &file, const CStr &code)
 
virtual void Reload ()
 
void Unload ()
 
virtual void Bind ()
 Binds the shader into the GL context. More...
 
virtual void Unbind ()
 Unbinds the shader from the GL context. More...
 
int GetUniformVertexIndex (CStrIntern id)
 
frag_index_pair_t GetUniformFragmentIndex (CStrIntern id)
 
virtual Binding GetTextureBinding (texture_id_t id)
 
virtual void BindTexture (texture_id_t id, Handle tex)
 
virtual void BindTexture (texture_id_t id, GLuint tex)
 
virtual void BindTexture (Binding id, Handle tex)
 
virtual Binding GetUniformBinding (uniform_id_t id)
 
virtual void Uniform (Binding id, float v0, float v1, float v2, float v3)
 
virtual void Uniform (Binding id, const CMatrix3D &v)
 
virtual void Uniform (Binding id, size_t count, const CMatrix3D *v)
 
- Public Member Functions inherited from CShaderProgram
virtual ~CShaderProgram ()
 
bool IsValid () const
 Returns whether this shader was successfully loaded. More...
 
int GetStreamFlags () const
 Returns bitset of STREAM_* value, indicating what vertex data streams the vertex shader needs (e.g. More...
 
void BindTexture (texture_id_t id, CTexturePtr tex)
 
void Uniform (Binding id, int v)
 
void Uniform (Binding id, float v)
 
void Uniform (Binding id, float v0, float v1)
 
void Uniform (Binding id, const CVector3D &v)
 
void Uniform (Binding id, const CColor &v)
 
void Uniform (uniform_id_t id, int v)
 
void Uniform (uniform_id_t id, float v)
 
void Uniform (uniform_id_t id, float v0, float v1)
 
void Uniform (uniform_id_t id, const CVector3D &v)
 
void Uniform (uniform_id_t id, const CColor &v)
 
void Uniform (uniform_id_t id, float v0, float v1, float v2, float v3)
 
void Uniform (uniform_id_t id, const CMatrix3D &v)
 
void Uniform (uniform_id_t id, size_t count, const CMatrix3D *v)
 
virtual void VertexPointer (GLint size, GLenum type, GLsizei stride, void *pointer)
 
virtual void NormalPointer (GLenum type, GLsizei stride, void *pointer)
 
virtual void ColorPointer (GLint size, GLenum type, GLsizei stride, void *pointer)
 
virtual void TexCoordPointer (GLenum texture, GLint size, GLenum type, GLsizei stride, void *pointer)
 
virtual void VertexAttribPointer (attrib_id_t id, GLint size, GLenum type, GLboolean normalized, GLsizei stride, void *pointer)
 
virtual void VertexAttribIPointer (attrib_id_t id, GLint size, GLenum type, GLsizei stride, void *pointer)
 
void AssertPointersBound ()
 Checks that all the required vertex attributes have been set. More...
 

Private Attributes

VfsPath m_VertexFile
 
VfsPath m_FragmentFile
 
CShaderDefines m_Defines
 
GLuint m_VertexProgram
 
GLuint m_FragmentProgram
 
std::map< CStrIntern, int > m_VertexIndexes
 
std::map< CStrIntern,
frag_index_pair_t
m_FragmentIndexes
 

Additional Inherited Members

- Public Types inherited from CShaderProgram
typedef CStrIntern attrib_id_t
 
typedef CStrIntern texture_id_t
 
typedef CStrIntern uniform_id_t
 
typedef std::pair< int, GLenum > frag_index_pair_t
 
- Static Public Member Functions inherited from CShaderProgram
static CShaderProgramConstructARB (const VfsPath &vertexFile, const VfsPath &fragmentFile, const CShaderDefines &defines, const std::map< CStrIntern, int > &vertexIndexes, const std::map< CStrIntern, frag_index_pair_t > &fragmentIndexes, int streamflags)
 Construct based on ARB vertex/fragment program files. More...
 
static CShaderProgramConstructGLSL (const VfsPath &vertexFile, const VfsPath &fragmentFile, const CShaderDefines &defines, const std::map< CStrIntern, int > &vertexAttribs, int streamflags)
 Construct based on GLSL vertex/fragment shader files. More...
 
static CShaderProgramConstructFFP (const std::string &id, const CShaderDefines &defines)
 Construct an instance of a pre-defined fixed-function pipeline setup. More...
 
- Protected Member Functions inherited from CShaderProgram
 CShaderProgram (int streamflags)
 
void BindClientStates ()
 
void UnbindClientStates ()
 
- Protected Attributes inherited from CShaderProgram
bool m_IsValid
 
int m_StreamFlags
 
int m_ValidStreams
 

Detailed Description

Definition at line 34 of file ShaderProgram.cpp.

Constructor & Destructor Documentation

CShaderProgramARB::CShaderProgramARB ( const VfsPath vertexFile,
const VfsPath fragmentFile,
const CShaderDefines defines,
const std::map< CStrIntern, int > &  vertexIndexes,
const std::map< CStrIntern, frag_index_pair_t > &  fragmentIndexes,
int  streamflags 
)
inline

Definition at line 37 of file ShaderProgram.cpp.

CShaderProgramARB::~CShaderProgramARB ( )
inline

Definition at line 50 of file ShaderProgram.cpp.

Member Function Documentation

virtual void CShaderProgramARB::Bind ( )
inlinevirtual

Binds the shader into the GL context.

Call this before calling Uniform() or trying to render with it.

Implements CShaderProgram.

Definition at line 120 of file ShaderProgram.cpp.

virtual void CShaderProgramARB::BindTexture ( texture_id_t  id,
Handle  tex 
)
inlinevirtual

Implements CShaderProgram.

Definition at line 168 of file ShaderProgram.cpp.

virtual void CShaderProgramARB::BindTexture ( texture_id_t  id,
GLuint  tex 
)
inlinevirtual

Implements CShaderProgram.

Definition at line 181 of file ShaderProgram.cpp.

virtual void CShaderProgramARB::BindTexture ( Binding  id,
Handle  tex 
)
inlinevirtual

Implements CShaderProgram.

Definition at line 192 of file ShaderProgram.cpp.

bool CShaderProgramARB::Compile ( GLuint  target,
const char *  targetName,
GLuint  program,
const VfsPath file,
const CStr &  code 
)
inline

Definition at line 58 of file ShaderProgram.cpp.

virtual Binding CShaderProgramARB::GetTextureBinding ( texture_id_t  id)
inlinevirtual

Implements CShaderProgram.

Definition at line 158 of file ShaderProgram.cpp.

virtual Binding CShaderProgramARB::GetUniformBinding ( uniform_id_t  id)
inlinevirtual

Implements CShaderProgram.

Definition at line 199 of file ShaderProgram.cpp.

frag_index_pair_t CShaderProgramARB::GetUniformFragmentIndex ( CStrIntern  id)
inline

Definition at line 150 of file ShaderProgram.cpp.

int CShaderProgramARB::GetUniformVertexIndex ( CStrIntern  id)
inline

Definition at line 142 of file ShaderProgram.cpp.

virtual void CShaderProgramARB::Reload ( )
inlinevirtual

Implements CShaderProgram.

Definition at line 85 of file ShaderProgram.cpp.

virtual void CShaderProgramARB::Unbind ( )
inlinevirtual

Unbinds the shader from the GL context.

Call this after rendering with it.

Implements CShaderProgram.

Definition at line 130 of file ShaderProgram.cpp.

virtual void CShaderProgramARB::Uniform ( Binding  id,
float  v0,
float  v1,
float  v2,
float  v3 
)
inlinevirtual

Implements CShaderProgram.

Definition at line 204 of file ShaderProgram.cpp.

virtual void CShaderProgramARB::Uniform ( Binding  id,
const CMatrix3D v 
)
inlinevirtual

Implements CShaderProgram.

Definition at line 213 of file ShaderProgram.cpp.

virtual void CShaderProgramARB::Uniform ( Binding  id,
size_t  count,
const CMatrix3D v 
)
inlinevirtual

Implements CShaderProgram.

Definition at line 232 of file ShaderProgram.cpp.

void CShaderProgramARB::Unload ( )
inline

Definition at line 115 of file ShaderProgram.cpp.

Member Data Documentation

CShaderDefines CShaderProgramARB::m_Defines
private

Definition at line 241 of file ShaderProgram.cpp.

VfsPath CShaderProgramARB::m_FragmentFile
private

Definition at line 240 of file ShaderProgram.cpp.

std::map<CStrIntern, frag_index_pair_t> CShaderProgramARB::m_FragmentIndexes
private

Definition at line 249 of file ShaderProgram.cpp.

GLuint CShaderProgramARB::m_FragmentProgram
private

Definition at line 244 of file ShaderProgram.cpp.

VfsPath CShaderProgramARB::m_VertexFile
private

Definition at line 239 of file ShaderProgram.cpp.

std::map<CStrIntern, int> CShaderProgramARB::m_VertexIndexes
private

Definition at line 246 of file ShaderProgram.cpp.

GLuint CShaderProgramARB::m_VertexProgram
private

Definition at line 243 of file ShaderProgram.cpp.


The documentation for this class was generated from the following file: