FastUIDraw
Public Member Functions | Protected Member Functions | List of all members
fastuidraw::gl::SamplerInitializer Class Reference

Class to intialize the binding points of samplers. If the uniform is an array, the first element will be given the specified binding point and successive elements in the array will be given successive binding points. More...

#include <gl_program.hpp>

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

Public Member Functions

 SamplerInitializer (c_string uniform_name, int binding_point)
 
- Public Member Functions inherited from fastuidraw::gl::UniformInitalizerBase
 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
 

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

Class to intialize the binding points of samplers. If the uniform is an array, the first element will be given the specified binding point and successive elements in the array will be given successive binding points.

Definition at line 1620 of file gl_program.hpp.

Constructor & Destructor Documentation

◆ SamplerInitializer()

fastuidraw::gl::SamplerInitializer::SamplerInitializer ( c_string  uniform_name,
int  binding_point 
)
inline

Ctor.

Parameters
uniform_namename of uniform sampler2D in GLSL to initialize
binding_pointbinding point to initialize the uniform to; If the uniform is an array, the first element will be given the specified binding point and successive elements in the array will be given successive binding points.

Definition at line 1633 of file gl_program.hpp.

Member Function Documentation

◆ init_uniform()

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

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).

Implements fastuidraw::gl::UniformInitalizerBase.


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