3D Graphics Engine for ESP32
 
Loading...
Searching...
No Matches
Ragot::Shader Class Reference

Class for managing an OpenGL shader. More...

#include <Shader_Program.hpp>

Inheritance diagram for Ragot::Shader:
Inheritance graph
Collaboration diagram for Ragot::Shader:
Collaboration graph

Public Member Functions

 Shader ()=delete
 Deleted default constructor.
 
 ~Shader ()
 Destructor for the Shader class.
 
GLuint get_id () const
 Gets the shader ID.
 
string * get_error ()
 Gets the compilation error message.
 
bool is_ok () const
 Checks if the shader is compiled successfully.
 

Protected Member Functions

 Shader (const vector< string > &source_code, GLenum type)
 Constructor for the Shader class.
 
GLuint compile_shader ()
 Compiles the shader.
 
void show_compilation_error ()
 Displays compilation errors.
 

Private Attributes

GLuint id
 Shader ID.
 
string error
 Compilation error message.
 
bool compilation_succeeded
 Flag indicating if compilation succeeded.
 

Detailed Description

Class for managing an OpenGL shader.

Constructor & Destructor Documentation

◆ Shader() [1/2]

Ragot::Shader::Shader ( const vector< string > & source_code,
GLenum type )
protected

Constructor for the Shader class.

Parameters
source_codeVector of shader source code.
typeShader type (e.g., GL_VERTEX_SHADER, GL_FRAGMENT_SHADER).
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Shader() [2/2]

Ragot::Shader::Shader ( )
delete

Deleted default constructor.

◆ ~Shader()

Ragot::Shader::~Shader ( )
inline

Destructor for the Shader class.

Member Function Documentation

◆ compile_shader()

GLuint Ragot::Shader::compile_shader ( )
protected

Compiles the shader.

Returns
Shader ID.

◆ get_error()

string * Ragot::Shader::get_error ( )
inline

Gets the compilation error message.

Returns
Pointer to the error message string.

◆ get_id()

GLuint Ragot::Shader::get_id ( ) const
inline

Gets the shader ID.

Returns
Shader ID.
Here is the caller graph for this function:

◆ is_ok()

bool Ragot::Shader::is_ok ( ) const
inline

Checks if the shader is compiled successfully.

Returns
True if compilation succeeded, false otherwise.

◆ show_compilation_error()

void Ragot::Shader::show_compilation_error ( )
protected

Displays compilation errors.

Here is the caller graph for this function:

Member Data Documentation

◆ compilation_succeeded

bool Ragot::Shader::compilation_succeeded
private

Flag indicating if compilation succeeded.

◆ error

string Ragot::Shader::error
private

Compilation error message.

◆ id

GLuint Ragot::Shader::id
private

Shader ID.


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