Brenta Engine 1.2
Loading...
Searching...
No Matches
brenta::Shader Class Reference

Data Structures

class  Builder
 
class  Object
 

Public Types

enum class  Type { Vertex , Fragment , Geometry , Compute }
 
using Id = unsigned int
 

Public Member Functions

 Shader (Shader::Id id)
 
 Shader (Shader &&other)
 
Shader::Id get_id () const
 
bool use ()
 
bool set_bool (const std::string &unif_name, bool value)
 
bool set_int (const std::string &unif_name, int value)
 
bool set_float (const std::string &unif_name, float value)
 
bool set_float2 (const std::string &unif_name, float v1, float v2)
 
bool set_float3 (const std::string &unif_name, float v1, float v2, float v3)
 
bool set_mat4 (const std::string &unif_name, glm::mat4 value)
 
bool set_vec3 (const std::string &unif_name, float x, float y, float z)
 
bool set_vec3 (const std::string &unif_name, glm::vec3 value)
 

Static Public Member Functions

static std::optional< Shadercreate (const tenno::vector< Shader::Object > &objects)
 
static std::optional< Shadercreate (const GLchar **feedback_varyings, int num_varyings, const tenno::vector< Shader::Object > &objects)
 
static bool set_bool (Shader::Id id, const std::string &unif_name, bool value)
 
static bool set_int (Shader::Id id, const std::string &unif_name, int value)
 
static bool set_float (Shader::Id id, const std::string &unif_name, float value)
 
static bool set_float2 (Shader::Id id, const std::string &unif_name, float v1, float v2)
 
static bool set_float3 (Shader::Id id, const std::string &unif_name, float v1, float v2, float v3)
 
static bool set_mat4 (Shader::Id id, const std::string &unif_name, glm::mat4 value)
 
static bool set_vec3 (Shader::Id id, const std::string &unif_name, float x, float y, float z)
 
static bool set_vec3 (Shader::Id id, const std::string &unif_name, glm::vec3 value)
 

Detailed Description

Definition at line 40 of file shader.hpp.

Member Typedef Documentation

◆ Id

using brenta::Shader::Id = unsigned int

Definition at line 44 of file shader.hpp.

Member Enumeration Documentation

◆ Type

enum class brenta::Shader::Type
strong

Definition at line 46 of file shader.hpp.

Constructor & Destructor Documentation

◆ Shader() [1/2]

brenta::Shader::Shader ( Shader::Id  id)
inline

Definition at line 111 of file shader.hpp.

◆ Shader() [2/2]

brenta::Shader::Shader ( Shader &&  other)
inline

Definition at line 112 of file shader.hpp.

◆ ~Shader()

Shader::~Shader ( )

Definition at line 15 of file shader.cpp.

Member Function Documentation

◆ create() [1/2]

std::optional< Shader > Shader::create ( const GLchar **  feedback_varyings,
int  num_varyings,
const tenno::vector< Shader::Object > &  objects 
)
static

Definition at line 46 of file shader.cpp.

◆ create() [2/2]

std::optional< Shader > Shader::create ( const tenno::vector< Shader::Object > &  objects)
static

Definition at line 27 of file shader.cpp.

◆ get_id()

Shader::Id Shader::get_id ( ) const

Definition at line 122 of file shader.cpp.

◆ set_bool() [1/2]

bool Shader::set_bool ( const std::string &  unif_name,
bool  value 
)

Definition at line 327 of file shader.cpp.

◆ set_bool() [2/2]

bool Shader::set_bool ( Shader::Id  id,
const std::string &  unif_name,
bool  value 
)
static

Definition at line 141 of file shader.cpp.

◆ set_float() [1/2]

bool Shader::set_float ( const std::string &  unif_name,
float  value 
)

Definition at line 331 of file shader.cpp.

◆ set_float() [2/2]

bool Shader::set_float ( Shader::Id  id,
const std::string &  unif_name,
float  value 
)
static

Definition at line 187 of file shader.cpp.

◆ set_float2() [1/2]

bool Shader::set_float2 ( const std::string &  unif_name,
float  v1,
float  v2 
)

Definition at line 333 of file shader.cpp.

◆ set_float2() [2/2]

bool Shader::set_float2 ( Shader::Id  id,
const std::string &  unif_name,
float  v1,
float  v2 
)
static

Definition at line 210 of file shader.cpp.

◆ set_float3() [1/2]

bool Shader::set_float3 ( const std::string &  unif_name,
float  v1,
float  v2,
float  v3 
)

Definition at line 335 of file shader.cpp.

◆ set_float3() [2/2]

bool Shader::set_float3 ( Shader::Id  id,
const std::string &  unif_name,
float  v1,
float  v2,
float  v3 
)
static

Definition at line 233 of file shader.cpp.

◆ set_int() [1/2]

bool Shader::set_int ( const std::string &  unif_name,
int  value 
)

Definition at line 329 of file shader.cpp.

◆ set_int() [2/2]

bool Shader::set_int ( Shader::Id  id,
const std::string &  unif_name,
int  value 
)
static

Definition at line 164 of file shader.cpp.

◆ set_mat4() [1/2]

bool Shader::set_mat4 ( const std::string &  unif_name,
glm::mat4  value 
)

Definition at line 337 of file shader.cpp.

◆ set_mat4() [2/2]

bool Shader::set_mat4 ( Shader::Id  id,
const std::string &  unif_name,
glm::mat4  value 
)
static

Definition at line 256 of file shader.cpp.

◆ set_vec3() [1/4]

bool Shader::set_vec3 ( const std::string &  unif_name,
float  x,
float  y,
float  z 
)

Definition at line 339 of file shader.cpp.

◆ set_vec3() [2/4]

bool Shader::set_vec3 ( const std::string &  unif_name,
glm::vec3  value 
)

Definition at line 341 of file shader.cpp.

◆ set_vec3() [3/4]

bool Shader::set_vec3 ( Shader::Id  id,
const std::string &  unif_name,
float  x,
float  y,
float  z 
)
static

Definition at line 279 of file shader.cpp.

◆ set_vec3() [4/4]

bool Shader::set_vec3 ( Shader::Id  id,
const std::string &  unif_name,
glm::vec3  value 
)
static

Definition at line 303 of file shader.cpp.

◆ use()

bool Shader::use ( )

Definition at line 128 of file shader.cpp.


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