AireEngine
A 3D Open-World Game Engine
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Aire::ShaderProgram Class Reference

A linked OpenGL program. More...

#include <shaderProgram.h>

Public Member Functions

 ShaderProgram (std::vector< ShaderSource > shaderList={})
 
GLuint getProgramId () const
 
void reloadShaders ()
 Reload the shaders in the program. Can be used to reload shaders during execution.
 
void useProgram ()
 Set as the current program to use.
 
 ~ShaderProgram ()
 Destroy the program.
 
 ShaderProgram (ShaderProgram const &)=delete
 
ShaderProgramoperator= (ShaderProgram const &)=delete
 
void set2DTextureUniform (const char *uniformName, const GLuint textureHandle)
 
void setCubeTextureUniform (const char *uniformName, const GLuint textureHandle)
 
void unbindAllTextures ()
 Unbind all textures currently bound to the program.
 
void unbind2DTextures (int numTextures)
 
void unbindCubeTextures (int numTextures)
 

Detailed Description

A linked OpenGL program.

Constructor & Destructor Documentation

◆ ShaderProgram()

ShaderProgram::ShaderProgram ( std::vector< ShaderSource > shaderList = {})
explicit

Create a new shader program. Compiles all the shaders and links the program.

Parameters
shaderListThe list of shaders to compile and link in the program.
Here is the call graph for this function:

Member Function Documentation

◆ getProgramId()

GLuint Aire::ShaderProgram::getProgramId ( ) const
inline
Returns
The OpenGL handle for the program object
Here is the caller graph for this function:

◆ set2DTextureUniform()

void Aire::ShaderProgram::set2DTextureUniform ( const char * uniformName,
const GLuint textureHandle )
inline

Set a uniform sampler2D variable.

Parameters
uniformNameThe name of the uniform
textureHandleThe texture to initialise the uniform with
Here is the caller graph for this function:

◆ setCubeTextureUniform()

void Aire::ShaderProgram::setCubeTextureUniform ( const char * uniformName,
const GLuint textureHandle )
inline

Set a uniform samplerCube variable

Parameters
uniformNameThe name of the uniform
textureHandleThe texture to initialise the uniform with

◆ unbind2DTextures()

void Aire::ShaderProgram::unbind2DTextures ( int numTextures)
inline

Unbind the 2D textures currently bound to the program

Parameters
numTexturesThe number of textures to unbind.
Here is the caller graph for this function:

◆ unbindCubeTextures()

void Aire::ShaderProgram::unbindCubeTextures ( int numTextures)
inline

Unbind the cube textures currently bound to the program

Parameters
numTexturesThe number of textures to unbind.

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