GPU-Accelerated Coverage  0.1.0
Compute coverage tours for known environment with articulated objects on GPU
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
gpu_coverage::AbstractProgram Class Reference

Abstract superclass for all shader programs. More...

#include <Programs.h>

Inheritance diagram for gpu_coverage::AbstractProgram:
Inheritance graph
[legend]

Public Member Functions

void use () const
 Bind this program to the GPU.
 
bool isReady () const
 Returns true if the program is ready to be used. More...
 

Static Public Member Functions

static void setOpenGLVersion ()
 Reads versions and available extensions from the GPU. More...
 

Protected Member Functions

 AbstractProgram ()
 Constructor.
 
virtual ~AbstractProgram ()
 Destructor.
 
GLuint createShader (const GLenum shaderType, const GLchar *const code, const char *const name) const
 Create a shader from source code. More...
 
GLuint loadShader (const GLenum shaderType, const char *const filename) const
 Create a shader from a file. More...
 
bool link (const char *const name) const
 Link the associated shader stages. More...
 

Protected Attributes

const GLuint program
 OpenGL program ID.
 
bool ready
 True if program is ready, see isReady().
 

Detailed Description

Abstract superclass for all shader programs.

Member Function Documentation

GLuint gpu_coverage::AbstractProgram::createShader ( const GLenum  shaderType,
const GLchar *const  code,
const char *const  name 
) const
protected

Create a shader from source code.

Parameters
[in]shaderTypeShader type GL_VERTEX_SHADER, GL_FRAGMENT_SHADER, ...
[in]codeSource code for the shader.
Returns
Shader number or 0 in case of failure.
bool gpu_coverage::AbstractProgram::isReady ( ) const
inline

Returns true if the program is ready to be used.

Returns
True if ready.
bool gpu_coverage::AbstractProgram::link ( const char *const  name) const
protected

Link the associated shader stages.

Parameters
nameHuman-readable program name for debugging.
Returns
True on success.
GLuint gpu_coverage::AbstractProgram::loadShader ( const GLenum  shaderType,
const char *const  filename 
) const
protected

Create a shader from a file.

Parameters
[in]shaderTypeShader type GL_VERTEX_SHADER, GL_FRAGMENT_SHADER, ...
[in]codeFile name of the shader source code file.
Returns
Shader number or 0 in case of failure.
static void gpu_coverage::AbstractProgram::setOpenGLVersion ( )
static

Reads versions and available extensions from the GPU.

This method must be called after initializing OpenGL and before instantiating any shader program.


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