Raftel Engine
 
Loading...
Searching...
No Matches
shader.hpp File Reference

Defines the Shader and ShaderProgram classes for managing shaders in OpenGL. More...

#include <GL/glew.h>
#include <string>
#include <glm/mat4x4.hpp>
#include <raftel/global_macros.hpp>

Go to the source code of this file.

Classes

class  Raftel::Shader
 A class to represent an OpenGL shader (vertex, fragment, etc.). More...
 
class  Raftel::ShaderProgram
 A class to represent an OpenGL shader program, combining vertex and fragment shaders. More...
 

Detailed Description

Defines the Shader and ShaderProgram classes for managing shaders in OpenGL.

Date
2025-03-10
Authors
Carlos Mazcuñán Blanes, Marc Folgado Balbás

This file contains the definitions of the Shader and ShaderProgram classes, which are used to load, compile, and manage shaders (vertex, fragment, etc.) in an OpenGL program.

  • The Shader class provides methods to load shaders either from files or directly from source code, compile them, and retrieve errors related to shader compilation.
  • The ShaderProgram class allows linking shaders together into a program, setting uniform variables, and managing OpenGL shader programs (e.g., using, un-using, and setting uniforms).

The classes are designed to handle OpenGL shader objects and program management, enabling rendering with custom shaders in a graphics application.

Note
This code assumes that the GLEW library is initialized before using these classes.
It is also assumed that the OpenGL context is properly set up.

Definition in file shader.hpp.