Overload  1.1
Game engine with editor
Public Member Functions | Public Attributes | Friends | List of all members
OvRendering::Resources::Shader Class Reference

#include <Shader.h>

Public Member Functions

void Bind () const
 
void Unbind () const
 
void SetUniformInt (const std::string &p_name, int p_value)
 
void SetUniformFloat (const std::string &p_name, float p_value)
 
void SetUniformVec2 (const std::string &p_name, const OvMaths::FVector2 &p_vec2)
 
void SetUniformVec3 (const std::string &p_name, const OvMaths::FVector3 &p_vec3)
 
void SetUniformVec4 (const std::string &p_name, const OvMaths::FVector4 &p_vec4)
 
void SetUniformMat4 (const std::string &p_name, const OvMaths::FMatrix4 &p_mat4)
 
int GetUniformInt (const std::string &p_name)
 
float GetUniformFloat (const std::string &p_name)
 
OvMaths::FVector2 GetUniformVec2 (const std::string &p_name)
 
OvMaths::FVector3 GetUniformVec3 (const std::string &p_name)
 
OvMaths::FVector4 GetUniformVec4 (const std::string &p_name)
 
OvMaths::FMatrix4 GetUniformMat4 (const std::string &p_name)
 
const UniformInfoGetUniformInfo (const std::string &p_name) const
 
void QueryUniforms ()
 

Public Attributes

const uint32_t id
 
const std::string path
 
std::vector< UniformInfouniforms
 

Friends

class Loaders::ShaderLoader
 

Detailed Description

OpenGL shader program wrapper

Member Function Documentation

◆ Bind()

void OvRendering::Resources::Shader::Bind ( ) const

Bind the program

◆ GetUniformFloat()

float OvRendering::Resources::Shader::GetUniformFloat ( const std::string &  p_name)

Returns the float uniform value identified by the given name

Parameters
p_name

◆ GetUniformInfo()

const OvRendering::Resources::UniformInfo * OvRendering::Resources::Shader::GetUniformInfo ( const std::string &  p_name) const

Returns information about the uniform identified by the given name or nullptr if not found

Parameters
p_name

◆ GetUniformInt()

int OvRendering::Resources::Shader::GetUniformInt ( const std::string &  p_name)

Returns the int uniform value identified by the given name

Parameters
p_name

◆ GetUniformMat4()

OvMaths::FMatrix4 OvRendering::Resources::Shader::GetUniformMat4 ( const std::string &  p_name)

Returns the mat4 uniform value identified by the given name

Parameters
p_name

◆ GetUniformVec2()

OvMaths::FVector2 OvRendering::Resources::Shader::GetUniformVec2 ( const std::string &  p_name)

Returns the vec2 uniform value identified by the given name

Parameters
p_name

◆ GetUniformVec3()

OvMaths::FVector3 OvRendering::Resources::Shader::GetUniformVec3 ( const std::string &  p_name)

Returns the vec3 uniform value identified by the given name

Parameters
p_name

◆ GetUniformVec4()

OvMaths::FVector4 OvRendering::Resources::Shader::GetUniformVec4 ( const std::string &  p_name)

Returns the vec4 uniform value identified by the given name

Parameters
p_name

◆ QueryUniforms()

void OvRendering::Resources::Shader::QueryUniforms ( )

Query the uniforms from the program and store them in the uniform vector

◆ SetUniformFloat()

void OvRendering::Resources::Shader::SetUniformFloat ( const std::string &  p_name,
float  p_value 
)

Send a float to the GPU via a shader uniform

Parameters
p_name
p_value

◆ SetUniformInt()

void OvRendering::Resources::Shader::SetUniformInt ( const std::string &  p_name,
int  p_value 
)

Send a int to the GPU via a shader uniform

Parameters
p_name
p_value

◆ SetUniformMat4()

void OvRendering::Resources::Shader::SetUniformMat4 ( const std::string &  p_name,
const OvMaths::FMatrix4 p_mat4 
)

Send a mat4 to the GPU via a shader uniform

Parameters
p_name
p_mat4

◆ SetUniformVec2()

void OvRendering::Resources::Shader::SetUniformVec2 ( const std::string &  p_name,
const OvMaths::FVector2 p_vec2 
)

Send a vec2 to the GPU via a shader uniform

Parameters
p_name
p_vec2

◆ SetUniformVec3()

void OvRendering::Resources::Shader::SetUniformVec3 ( const std::string &  p_name,
const OvMaths::FVector3 p_vec3 
)

Send a vec3 to the GPU via a shader uniform

Parameters
p_name
p_vec3

◆ SetUniformVec4()

void OvRendering::Resources::Shader::SetUniformVec4 ( const std::string &  p_name,
const OvMaths::FVector4 p_vec4 
)

Send a vec4 to the GPU via a shader uniform

Parameters
p_name
p_vec4

◆ Unbind()

void OvRendering::Resources::Shader::Unbind ( ) const

Unbind the program

Friends And Related Function Documentation

◆ Loaders::ShaderLoader

friend class Loaders::ShaderLoader
friend

Member Data Documentation

◆ id

const uint32_t OvRendering::Resources::Shader::id

◆ path

const std::string OvRendering::Resources::Shader::path

◆ uniforms

std::vector<UniformInfo> OvRendering::Resources::Shader::uniforms

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