PanoramaViewer
 All Classes Namespaces Files Functions Variables Macros Pages
LayerSceneGraph::Shader Class Reference

#include <Shader.h>

Public Member Functions

 Shader (const char *vertexshaderCode, const char *fragmentShaderCode)
 
virtual ~Shader ()
 
void setUpShader (const char *vertexshaderCode, const char *fragmentShaderCode)
 
void bindAttributes ()
 
void enableTexture ()
 
GLuint loadShader (GLenum type, const char *shaderSrc)
 
GLint getLinkStatus ()
 
GLuint getProgram ()
 

Private Attributes

GLuint vertexShader
 
GLuint fragmentShader
 
GLint linked
 
GLuint program
 
GLuint textureId
 
GLuint gvSamplerHandle
 

Constructor & Destructor Documentation

LayerSceneGraph::Shader::Shader ( const char *  vertexshaderCode,
const char *  fragmentShaderCode 
)
LayerSceneGraph::Shader::~Shader ( )
virtual

Shader destructor Detachs and deletes each shader. Deletes shader program too.

Member Function Documentation

void LayerSceneGraph::Shader::bindAttributes ( )

Binds attributes "position" and "textureCoordinates"

void LayerSceneGraph::Shader::enableTexture ( )
inline

Some routines necessaries to use textures. It generates a texture and configures texture filters.

GLint LayerSceneGraph::Shader::getLinkStatus ( )

Returns the value of "linked" variable for debug purposes.

GLuint LayerSceneGraph::Shader::getProgram ( )

Returns shader program.

GLuint LayerSceneGraph::Shader::loadShader ( GLenum  type,
const char *  shaderSrc 
)

This method creates, loads and compiles a new shader.

void LayerSceneGraph::Shader::setUpShader ( const char *  vertexshaderCode,
const char *  fragmentShaderCode 
)
inline

This method attachs both vertex and fragment shaders to a shader program. it also binds default attributes inside the shaders and calls a routine which enable texturing

Member Data Documentation

GLuint LayerSceneGraph::Shader::fragmentShader
private
GLuint LayerSceneGraph::Shader::gvSamplerHandle
private
GLint LayerSceneGraph::Shader::linked
private
GLuint LayerSceneGraph::Shader::program
private
GLuint LayerSceneGraph::Shader::textureId
private
GLuint LayerSceneGraph::Shader::vertexShader
private

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