eXperiment robotics framework

Shader related functions
[OpenGL utilities]

Collaboration diagram for Shader related functions:
Contains functions to make working with shaders easier. More...
std::string readTextFile (const std::string &path)
 Read a text file to a std::string that is returned.
GLuint newProgram (string vert_file_name, string frag_file_name)
 Create a new shader.
bool glew_check ()
 Check for glew sanity.
bool printShaderInfoLog (GLuint obj)
 Debug information log on the shader loading.
bool printProgramInfoLog (GLuint obj)
 Debug information log on the program loading.
GLuint loadShader (const std::string &path, GLuint shader_type)
 Shader loading function.

Detailed Description

Contains functions to make working with shaders easier.

Author:
smogzer_at_gmail.com

Function Documentation

bool glew_check (  ) 

Check for glew sanity.

This should be the first thing to do.

Returns:
true if glew ok.

GLuint loadShader ( const std::string &  path,
GLuint  shader_type 
)

Shader loading function.

Parameters:
path path of the shader file.
shader_type type of shader. Can be GL_VERTEX_SHADER or GL_FRAGEMENT_SHADER.
Returns:
the unsigned int representing the shader.

GLuint newProgram ( string  vert_file_name,
string  frag_file_name 
)

Create a new shader.

After this use glUseProgram(GLuint) to run.

Parameters:
vert_file_name the vertice shader file.
frag_file_name the fragment shader file.
Returns:
returns an unsigned integer representing the shader.

bool printProgramInfoLog ( GLuint  obj  ) 

Debug information log on the program loading.

Parameters:
obj program number.
Returns:
boolean ok.

bool printShaderInfoLog ( GLuint  obj  ) 

Debug information log on the shader loading.

Parameters:
obj the shader number.
Returns:
boolean ok.

std::string readTextFile ( const std::string &  path  ) 

Read a text file to a std::string that is returned.

Parameters:
path the location of the file to open
Returns:
the whole file in a std::string


The miarn project - written by Joao Xavier