FastUIDraw
Public Member Functions | Protected Member Functions | List of all members
fastuidraw::gl::UniformInitalizerBase Class Referenceabstract

A UniformInitalizerBase is a base class for initializing a uniform, the actual GL call to set the uniform value is to be implemented by a derived class in init_uniform(). More...

#include <gl_program.hpp>

Inheritance diagram for fastuidraw::gl::UniformInitalizerBase:
Inheritance graph
[legend]

Public Member Functions

 UniformInitalizerBase (c_string uniform_name)
 
virtual void perform_initialization (Program *pr, bool program_bound) const
 
- Public Member Functions inherited from fastuidraw::reference_counted_base< T, Counter >
 reference_counted_base (void)
 

Protected Member Functions

virtual void init_uniform (GLuint program, Program::shader_variable_info info, unsigned int array_index, bool program_bound) const =0
 

Additional Inherited Members

- Static Public Member Functions inherited from fastuidraw::reference_counted_base< T, Counter >
static void add_reference (const reference_counted_base< T, Counter > *p)
 
static void remove_reference (const reference_counted_base< T, Counter > *p)
 

Detailed Description

A UniformInitalizerBase is a base class for initializing a uniform, the actual GL call to set the uniform value is to be implemented by a derived class in init_uniform().

Definition at line 1465 of file gl_program.hpp.

Constructor & Destructor Documentation

◆ UniformInitalizerBase()

fastuidraw::gl::UniformInitalizerBase::UniformInitalizerBase ( c_string  uniform_name)

Ctor.

Parameters
uniform_namename of uniform to initialize

Member Function Documentation

◆ init_uniform()

virtual void fastuidraw::gl::UniformInitalizerBase::init_uniform ( GLuint  program,
Program::shader_variable_info  info,
unsigned int  array_index,
bool  program_bound 
) const
protectedpure virtual

To be implemented by a derived class to make the GL call to initialize a uniform in a GLSL shader.

Parameters
programGL program
infoinformation on uniform (name, type, location, etc)
array_indexindex into GLSL uniform if it is an array
program_boundtrue if and only if the program named by program is bound (via glUseProgram). If the program is not bound, then one SHOULD not bind the program and instead use the GL API points to set values of the uniform(s) that do not rely on having the program bound. One can also safely assume that those API points are supported in the case it is not bound (in particular the function family ProgramUniform() can be safely used).

Implemented in fastuidraw::gl::SamplerInitializer, fastuidraw::gl::UniformInitializer< c_array< const T > >, and fastuidraw::gl::UniformInitializer< T >.

◆ perform_initialization()

virtual void fastuidraw::gl::UniformInitalizerBase::perform_initialization ( Program pr,
bool  program_bound 
) const
virtual

To be implemented by a derived class to perform additional one-time actions. Function is called after the GL program object is successfully linked.

Parameters
prProgram to initialize
program_boundGLSL Program is already bound, the program is NOT bound if the GL/GLES API supports seperable program objects.

Implements fastuidraw::gl::ProgramInitializer.


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