Conquer Space 0.0.0
A space themed grand strategy game set in the near future, with realistic orbital mechanics, and an emphasis on economics and politics.
Public Member Functions | Public Attributes | List of all members
cqsp::asset::ShaderProgram Class Reference

A shader program. More...

#include <shader.h>

Public Member Functions

 ShaderProgram ()
 
 ShaderProgram (const Shader &vert, const Shader &frag)
 
 ShaderProgram (const Shader &vert, const Shader &frag, const Shader &geom)
 
 ~ShaderProgram ()
 
void setBool (const std::string &name, bool value)
 
void setInt (const std::string &name, int value)
 
void setFloat (const std::string &name, float value)
 
void setVec2 (const std::string &name, const glm::vec2 &value)
 
void setVec2 (const std::string &name, float x, float y)
 
void setVec3 (const std::string &name, const glm::vec3 &value)
 
void setVec3 (const std::string &name, float x, float y, float z)
 
void setVec4 (const std::string &name, const glm::vec4 &value)
 
void setVec4 (const std::string &name, float x, float y, float z, float w)
 
void setMat2 (const std::string &name, const glm::mat2 &mat)
 
void setMat3 (const std::string &name, const glm::mat3 &mat)
 
void setMat4 (const std::string &name, const glm::mat4 &mat)
 
void Set (const std::string &name, bool value)
 
void Set (const std::string &name, int value)
 
void Set (const std::string &name, float value)
 
void Set (const std::string &name, const glm::vec2 &value)
 
void Set (const std::string &name, float x, float y)
 
void Set (const std::string &name, const glm::vec3 &value)
 
void Set (const std::string &name, float x, float y, float z)
 
void Set (const std::string &name, const glm::vec4 &value)
 
void Set (const std::string &name, float x, float y, float z, float w)
 
void Set (const std::string &name, const glm::mat2 &mat)
 
void Set (const std::string &name, const glm::mat3 &mat)
 
void Set (const std::string &name, const glm::mat4 &mat)
 
void UseProgram ()
 
void SetMVP (const glm::mat4 &model, const glm::mat4 &view, const glm::mat4 &projection)
 
 operator unsigned int () const
 

Public Attributes

unsigned int program
 

Detailed Description

A shader program.

Do note that using this as a direct object is not the preferred usage of the class, and ShaderProgram_t is the preferred way of using it.

Using ShaderDefinition to load and initialize a shader is also the preferred way of using this class.

Constructor & Destructor Documentation

◆ ShaderProgram() [1/3]

ShaderProgram::ShaderProgram ( )

◆ ShaderProgram() [2/3]

ShaderProgram::ShaderProgram ( const Shader vert,
const Shader frag 
)

◆ ShaderProgram() [3/3]

cqsp::asset::ShaderProgram::ShaderProgram ( const Shader vert,
const Shader frag,
const Shader geom 
)

◆ ~ShaderProgram()

cqsp::asset::ShaderProgram::~ShaderProgram ( )

Member Function Documentation

◆ operator unsigned int()

cqsp::asset::ShaderProgram::operator unsigned int ( ) const
inline

◆ Set() [1/12]

void ShaderProgram::Set ( const std::string &  name,
bool  value 
)

◆ Set() [2/12]

void ShaderProgram::Set ( const std::string &  name,
const glm::mat2 &  mat 
)

◆ Set() [3/12]

void ShaderProgram::Set ( const std::string &  name,
const glm::mat3 &  mat 
)

◆ Set() [4/12]

void ShaderProgram::Set ( const std::string &  name,
const glm::mat4 &  mat 
)

◆ Set() [5/12]

void ShaderProgram::Set ( const std::string &  name,
const glm::vec2 &  value 
)

◆ Set() [6/12]

void ShaderProgram::Set ( const std::string &  name,
const glm::vec3 &  value 
)

◆ Set() [7/12]

void ShaderProgram::Set ( const std::string &  name,
const glm::vec4 &  value 
)

◆ Set() [8/12]

void ShaderProgram::Set ( const std::string &  name,
float  value 
)

◆ Set() [9/12]

void ShaderProgram::Set ( const std::string &  name,
float  x,
float  y 
)

◆ Set() [10/12]

void ShaderProgram::Set ( const std::string &  name,
float  x,
float  y,
float  z 
)

◆ Set() [11/12]

void ShaderProgram::Set ( const std::string &  name,
float  x,
float  y,
float  z,
float  w 
)

◆ Set() [12/12]

void ShaderProgram::Set ( const std::string &  name,
int  value 
)

◆ setBool()

void ShaderProgram::setBool ( const std::string &  name,
bool  value 
)

◆ setFloat()

void ShaderProgram::setFloat ( const std::string &  name,
float  value 
)

◆ setInt()

void ShaderProgram::setInt ( const std::string &  name,
int  value 
)

◆ setMat2()

void ShaderProgram::setMat2 ( const std::string &  name,
const glm::mat2 &  mat 
)

◆ setMat3()

void ShaderProgram::setMat3 ( const std::string &  name,
const glm::mat3 &  mat 
)

◆ setMat4()

void ShaderProgram::setMat4 ( const std::string &  name,
const glm::mat4 &  mat 
)

◆ SetMVP()

void ShaderProgram::SetMVP ( const glm::mat4 &  model,
const glm::mat4 &  view,
const glm::mat4 &  projection 
)

◆ setVec2() [1/2]

void ShaderProgram::setVec2 ( const std::string &  name,
const glm::vec2 &  value 
)

◆ setVec2() [2/2]

void ShaderProgram::setVec2 ( const std::string &  name,
float  x,
float  y 
)

◆ setVec3() [1/2]

void ShaderProgram::setVec3 ( const std::string &  name,
const glm::vec3 &  value 
)

◆ setVec3() [2/2]

void ShaderProgram::setVec3 ( const std::string &  name,
float  x,
float  y,
float  z 
)

◆ setVec4() [1/2]

void ShaderProgram::setVec4 ( const std::string &  name,
const glm::vec4 &  value 
)

◆ setVec4() [2/2]

void ShaderProgram::setVec4 ( const std::string &  name,
float  x,
float  y,
float  z,
float  w 
)

◆ UseProgram()

void ShaderProgram::UseProgram ( )

Member Data Documentation

◆ program

unsigned int cqsp::asset::ShaderProgram::program

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