GLSLShaderSetup Class Reference

#include <GLSLShaderSetup.h>

List of all members.

Public Member Functions

 GLSLShaderSetup (const std::string &filename_vshader, const std::string &filename_fshader, const GLSLShader::defines_list &dl=GLSLShader::defines_list())
 create shader setup of two shaders
 ~GLSLShaderSetup ()
void use () const
 use this setup
void set_gl_texture (GLTexture &tex, const char *texname, unsigned texunitnr) const
 set up texture for a particular shader name
void set_gl_texture (GLShadowFrameBuffer &tex, const char *texname, unsigned texunitnr) const
void set_gl_texture_unit (const char *texname, unsigned texunitnr) const
void set_uniform (const char *name, const Vector &value) const
 set uniform variable
void set_uniform (const char *name, const float value) const
unsigned get_vertex_attrib_index (const char *name) const
 get vertex attribute index

Static Public Member Functions

static void use_fixed ()
 use fixed function pipeline instead of particular setup

Protected Attributes

GLSLShader vs_
GLSLShader fs_
GLSLProgram prog_

Private Member Functions

 GLSLShaderSetup (const GLSLShaderSetup &)
GLSLShaderSetupoperator= (const GLSLShaderSetup &)


Detailed Description

Definition at line 27 of file GLSLShaderSetup.h.


Constructor & Destructor Documentation

GLSLShaderSetup::GLSLShaderSetup ( const std::string filename_vshader,
const std::string filename_fshader,
const GLSLShader::defines_list dl = GLSLShader::defines_list() 
)

create shader setup of two shaders

Definition at line 23 of file GLSLShaderSetup.cpp.

References GLSLProgram::attach(), fs_, GLSLProgram::link(), prog_, and vs_.

GLSLShaderSetup::~GLSLShaderSetup (  ) 

Definition at line 35 of file GLSLShaderSetup.cpp.

GLSLShaderSetup::GLSLShaderSetup ( const GLSLShaderSetup  )  [private]


Member Function Documentation

void GLSLShaderSetup::use (  )  const [inline]

use this setup

Definition at line 38 of file GLSLShaderSetup.h.

References prog_, and GLSLProgram::use().

Referenced by Landscape::actualDrawLandShader(), Water2Renderer::drawWaterShaders(), and Water2Renderer::generate().

static void GLSLShaderSetup::use_fixed (  )  [inline, static]

use fixed function pipeline instead of particular setup

Definition at line 41 of file GLSLShaderSetup.h.

References GLSLProgram::use_fixed().

Referenced by Landscape::actualDrawLandShader(), Water2Renderer::drawWaterShaders(), and Water2Renderer::generate().

void GLSLShaderSetup::set_gl_texture ( GLTexture tex,
const char *  texname,
unsigned  texunitnr 
) const [inline]

set up texture for a particular shader name

Definition at line 44 of file GLSLShaderSetup.h.

References prog_, and GLSLProgram::set_gl_texture().

Referenced by Landscape::actualDrawLandShader(), and Water2Renderer::drawWaterShaders().

void GLSLShaderSetup::set_gl_texture ( GLShadowFrameBuffer tex,
const char *  texname,
unsigned  texunitnr 
) const [inline]

Definition at line 48 of file GLSLShaderSetup.h.

References prog_, and GLSLProgram::set_gl_texture().

void GLSLShaderSetup::set_gl_texture_unit ( const char *  texname,
unsigned  texunitnr 
) const [inline]

Definition at line 52 of file GLSLShaderSetup.h.

References prog_, and GLSLProgram::set_gl_texture_unit().

void GLSLShaderSetup::set_uniform ( const char *  name,
const Vector value 
) const [inline]

set uniform variable

Definition at line 58 of file GLSLShaderSetup.h.

References prog_, and GLSLProgram::set_uniform().

Referenced by Landscape::actualDrawLandShader(), VisibilityPatchGrid::drawWater(), Water2Renderer::drawWaterShaders(), and Water2Renderer::generate().

void GLSLShaderSetup::set_uniform ( const char *  name,
const float  value 
) const [inline]

Definition at line 62 of file GLSLShaderSetup.h.

References prog_, and GLSLProgram::set_uniform().

unsigned GLSLShaderSetup::get_vertex_attrib_index ( const char *  name  )  const [inline]

get vertex attribute index

Definition at line 68 of file GLSLShaderSetup.h.

References GLSLProgram::get_vertex_attrib_index(), and prog_.

GLSLShaderSetup& GLSLShaderSetup::operator= ( const GLSLShaderSetup  )  [private]


Member Data Documentation

GLSLShader GLSLShaderSetup::vs_ [protected]

Definition at line 74 of file GLSLShaderSetup.h.

Referenced by GLSLShaderSetup().

GLSLShader GLSLShaderSetup::fs_ [protected]

Definition at line 74 of file GLSLShaderSetup.h.

Referenced by GLSLShaderSetup().

GLSLProgram GLSLShaderSetup::prog_ [protected]

Definition at line 75 of file GLSLShaderSetup.h.

Referenced by get_vertex_attrib_index(), GLSLShaderSetup(), set_gl_texture(), set_gl_texture_unit(), set_uniform(), and use().


The documentation for this class was generated from the following files:
Generated on Mon Feb 16 15:15:02 2009 for Scorched3D by  doxygen 1.5.3