+ Collaboration diagram for turbo::Shader:

Public Member Functions

 Shader (const Path &pixel_shader_path, const Path &vertex_shader_path)
 
void set_vertex_shader (const Path &vertex_shader_path)
 
void set_pixel_shader (const Path &pixel_shader_path)
 
void remove_vertex_shader ()
 
void remove_pixel_shader ()
 

Static Public Member Functions

static void init_shaders ()
 
static void set_active_shader (Shader *shader)
 
static Shaderget_active_shader ()
 

Static Protected Member Functions

static const char * read_file (const Path &path)
 

Protected Attributes

ALLEGRO_SHADER * shader = nullptr
 
const char * pixel_shader_src = nullptr
 
const char * vertex_shader_src = nullptr
 

Static Protected Attributes

static Shadercurrent_shader = nullptr
 

Member Function Documentation

◆ get_active_shader()

Shader * turbo::Shader::get_active_shader ( )
static

Retrieve the current shader

Returns

◆ init_shaders()

void turbo::Shader::init_shaders ( )
static

already initialized internally, do not call this

◆ remove_pixel_shader()

void turbo::Shader::remove_pixel_shader ( )

Reset the pixel shader to the default shader

◆ remove_vertex_shader()

void turbo::Shader::remove_vertex_shader ( )

Reset the vertex shader to the default shader

◆ set_active_shader()

void turbo::Shader::set_active_shader ( Shader shader)
static

Set the active shader

Parameters
shadertarget shader

◆ set_pixel_shader()

void turbo::Shader::set_pixel_shader ( const Path pixel_shader_path)

Set the specified GLSL pixel shader file

Parameters
pixel_shader_pathpath to the shader file

◆ set_vertex_shader()

void turbo::Shader::set_vertex_shader ( const Path vertex_shader_path)

Load the specified GLSL vertex shader file

Parameters
vertex_shader_pathpath to the shader file

The documentation for this class was generated from the following files:
  • include/turbo/graphics/Shader.hpp
  • src/graphics/Shader.cpp