glot::shader_primitive Class Reference

shader_primitive: the parent class of all primitives that use their own shaders More...

#include <shader_primitive.h>

Inheritance diagram for glot::shader_primitive:

glot::primitive glot::contour glot::curve glot::flow glot::scalar_field

List of all members.

Public Member Functions

 shader_primitive ()
 Default constructor.
 shader_primitive (const color &col)
 Constructor.
virtual ~shader_primitive ()
 Destructor.
void printProgramInfoLog (GLuint obj)
 Program linking errors.
void printShaderInfoLog (GLuint obj)
 Shader compiling errors.
string read_file (const char *filename)
 Read in a file.

Protected Attributes

GLhandleARB f
 Shader source handles.
GLhandleARB g
GLhandleARB v


Detailed Description

shader_primitive: the parent class of all primitives that use their own shaders

This class is the parent of all the primitives that get drawn to the screen but use their own shaders. It helps out by providing a few helpful functions for compiling shader programs and reading files and so forth.

See also:
shader_primitive

Constructor & Destructor Documentation

glot::shader_primitive::shader_primitive (  )  [inline]

Default constructor.

glot::shader_primitive::shader_primitive ( const color col  )  [inline]

Constructor.

Parameters:
col - the color of the primitive

virtual glot::shader_primitive::~shader_primitive (  )  [inline, virtual]

Destructor.

Virtual classes need virtual destructors


Member Function Documentation

void glot::shader_primitive::printProgramInfoLog ( GLuint  obj  ) 

Program linking errors.

Parameters:
obj - the program to talk about
This function prints out information about the linking stage of the GLSL shader program generation. GLSL prefers to fail silently, but provides ways to query back on the status of the linking of the shader program and this provides a way to check on that status in a human-readable format.

I found this helpful function at: http://www.lighthouse3d.com/opengl/glsl/index.php?oglinfo

void glot::shader_primitive::printShaderInfoLog ( GLuint  obj  ) 

Shader compiling errors.

Parameters:
obj - the shader to talk about
This function prints out information about the compiling of the GLSL shader. GLSL fails silently, but has a way to the status of the compilation of a shader and this prints out that information.

I found this helpful function at: http://www.lighthouse3d.com/opengl/glsl/index.php?oglinfo

string glot::shader_primitive::read_file ( const char *  filename  ) 

Read in a file.

Parameters:
filename - the name of the file to read
Reads a file, returns a string with the contents of that file. Meant to facilitate reading in the shader source, which is usually stored in a file.


Member Data Documentation

GLhandleARB glot::shader_primitive::f [protected]

Shader source handles.

I'm not entirely sure if it's necessary to store these handles beyond the compiling and then linking the shader program, but these are for that purpose.

GLhandleARB glot::shader_primitive::g [protected]

GLhandleARB glot::shader_primitive::v [protected]


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

Generated on Fri Nov 20 18:09:06 2009 for OpenGLot by  doxygen 1.5.8