Path Tracing
Loading...
Searching...
No Matches
shader.cpp File Reference

OpenGL shader compilation on runtime. More...

#include <stdio.h>
#include <string>
#include <vector>
#include <fstream>
#include <sstream>
#include <initializer_list>
#include <utility>
#include <GL/glew.h>
#include <common/shader.hpp>
Include dependency graph for shader.cpp:

Functions

GLuint LoadShaders (std::initializer_list< std::pair< GLenum, const char * > > shaders)
 Compile shaders
Compiles and links on runtime any type of shader (VERTEX, FRAGMENT, COMPUTE).

Detailed Description

OpenGL shader compilation on runtime.

Author
Leonel Matos
Date
2026-04-02

Function Documentation

◆ LoadShaders()

GLuint LoadShaders ( std::initializer_list< std::pair< GLenum, const char * > > shaders)

Compile shaders
Compiles and links on runtime any type of shader (VERTEX, FRAGMENT, COMPUTE).

Returns
GLuint ID

Example: LoadShaders({ { GL_VERTEX_SHADER, "shaders/shader.vert" }, { GL_FRAGMENT_SHADER, "shaders/shader.frag" }, });

Parameters
char*shader list