CGVIS Utils
Loading...
Searching...
No Matches
GLProgram.h File Reference

RAII wrapper around an OpenGL shader program with rich uniform/texture setters. More...

#include <vector>
#include <string>
#include <exception>
#include <GL/glew.h>
#include <GLFW/glfw3.h>
#include "Vec2.h"
#include "Vec3.h"
#include "Vec4.h"
#include "Mat4.h"
#include "GLTexture2D.h"
#include "GLTexture3D.h"
#include "GLTexture1D.h"
#include "GLDepthTexture.h"
#include "GLTextureCube.h"
Include dependency graph for GLProgram.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  ProgramException
 Exception thrown for program/shader I/O or linkage failures. More...
class  GLProgram
 OpenGL shader program with helpers for creation and data binding. More...

Detailed Description

RAII wrapper around an OpenGL shader program with rich uniform/texture setters.

Declares utilities to compile and link shader programs from files or strings (vertex/fragment/optional geometry), query uniform/attribute locations, set a wide variety of uniform types (scalars, vectors, matrices, arrays), and bind textures (1D/2D/3D/depth/cube) to sampler uniforms.

Note
All GL calls in the implementation are routed through a GL() macro (see GLDebug.h). Matrix uploads invert the transpose flag to account for the row/column-major differences in this code base.