All Classes Files Functions Variables Typedefs Pages
Public Member Functions | Public Attributes | Protected Attributes | Static Protected Attributes | List of all members
Program Class Reference

Description

Represents the configuration of an OpenGL pipeline.

It contains all important stages of the OpenGL Pipeline:

The vertex and fragment shader are neccessary to create a valid Program. To use the Program you have to prime it.

See Also
HotProgram

Inherits GLObject.

Public Member Functions

void create (VShader &vs, FShader &fs)
 Links the shaders and creates the Program. More...
 
void prime (std::function< void(HotProgram &)> func)
 Primes the Program in order to use it. More...
 
- Public Member Functions inherited from SingleBase
void setServiceContext (config::ServiceContext cnt)
 
template<typename Ex , LogLevel LL, typename... Ts>
Error Notice Debug void logAndThrow (Ts...args)
 

Public Attributes

PrimitiveProcessing primitiveProc
 PrimitiveProcessing pipeline stage.
 
PerFragmentProcessing perFragProc
 PerFragmentProcessing pipeline stage.
 

Protected Attributes

GLuint m_handle
 
friend HotProgram
 

Static Protected Attributes

static bool s_isPrimed = false
 
- Static Protected Attributes inherited from GLContextFreeObject
static constexpr PrintGL GLERR = PrintGL::Error
 

Additional Inherited Members

- Protected Member Functions inherited from GLContextFreeObject
template<typename... Ts>
void checkGLError (Ts...)
 
template<typename... Ts>
void checkGLWarning (Ts...)
 
template<typename... Ts>
void logThrowGL (Ts...)
 
- Protected Member Functions inherited from SingleBase
template<typename... Ts>
void logCritical (Ts...args)
 
template<typename... Ts>
void logError (Ts...args)
 
template<typename... Ts>
void logWarning (Ts...args)
 
template<typename... Ts>
void logNotice (Ts...args)
 
template<typename... Ts>
void log (Ts...args)
 
template<typename... Ts>
void logDebug (Ts...args)
 
template<typename Ex , LogLevel LL = LogLevel::Error, typename... Ts>
void logAndThrow (Ts...args)
 
- Protected Member Functions inherited from NotCopyable
 NotCopyable (const NotCopyable &)=delete
 
NotCopyableoperator= (const NotCopyable &)=delete
 

Member Function Documentation

void create ( VShader vs,
FShader fs 
)

Links the shaders and creates the Program.

Note
Both shaders need to be already compiled!
Parameters
vsvertex shader
fsfragment shader
void prime ( std::function< void(HotProgram &)>  func)

Primes the Program in order to use it.

Binds the program and applies all attributes of the configurable pipline stages. You need a HotProgram to draw something.

Parameters
funcA functor that accepts a HotProgram& as parameter