Path Tracing
Loading...
Searching...
No Matches
GLProgram Class Reference

RAII wrapper around an OpenGL shader program. load() only replaces the held program on a successfull compile+link, a failed reload keeps whatever program was there, instead of putting the renderer without a valid program. This works as a safeguard to call reloadShaders(). More...

#include <program.hpp>

Public Member Functions

 GLProgram ()=default
 ~GLProgram ()
 GLProgram (const GLProgram &)=delete
GLProgram & operator= (const GLProgram &)=delete
 GLProgram (GLProgram &&other) noexcept
GLProgram & operator= (GLProgram &&other) noexcept
bool load (std::initializer_list< std::pair< GLenum, const char * > > shaders)
void reset ()
GLuint id () const
 operator bool () const
void use () const

Detailed Description

RAII wrapper around an OpenGL shader program. load() only replaces the held program on a successfull compile+link, a failed reload keeps whatever program was there, instead of putting the renderer without a valid program. This works as a safeguard to call reloadShaders().

Constructor & Destructor Documentation

◆ GLProgram() [1/3]

GLProgram::GLProgram ( )
default

◆ ~GLProgram()

GLProgram::~GLProgram ( )
inline

◆ GLProgram() [2/3]

GLProgram::GLProgram ( const GLProgram & )
delete

◆ GLProgram() [3/3]

GLProgram::GLProgram ( GLProgram && other)
inlinenoexcept

Member Function Documentation

◆ id()

GLuint GLProgram::id ( ) const
inline

◆ load()

bool GLProgram::load ( std::initializer_list< std::pair< GLenum, const char * > > shaders)
inline

◆ operator bool()

GLProgram::operator bool ( ) const
inlineexplicit

◆ operator=() [1/2]

GLProgram & GLProgram::operator= ( const GLProgram & )
delete

◆ operator=() [2/2]

GLProgram & GLProgram::operator= ( GLProgram && other)
inlinenoexcept

◆ reset()

void GLProgram::reset ( )
inline

◆ use()

void GLProgram::use ( ) const
inline

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