SLProject 4.0.000
SLGLUniform< T > Class Template Reference

Template for a single GLSL uniform variable. More...

#include <SLGLUniform.h>

Inheritance diagram for SLGLUniform< T >:
[legend]

Public Member Functions

 SLGLUniform (SLUniformType type, const SLchar *name, T value, T inc=0.0f, T min=0.0f, T max=0.0f, SLKey keyInc=K_none)
 
 SLGLUniform (const SLchar *name, function< T(void)> getFunc)
 
const SLcharname ()
 
value ()
 
SLbool onKeyPress (const SLKey key, const SLKey mod) override
 Key press event-handler. More...
 
- Public Member Functions inherited from SLEventHandler
 SLEventHandler ()
 
virtual ~SLEventHandler ()
 
virtual SLbool onMouseDown (const SLMouseButton button, const SLint x, const SLint y, const SLKey mod)
 
virtual SLbool onMouseUp (const SLMouseButton button, const SLint x, const SLint y, const SLKey mod)
 
virtual SLbool onMouseMove (const SLMouseButton button, const SLint x, const SLint y, const SLKey mod)
 
virtual SLbool onDoubleClick (const SLMouseButton button, const SLint x, const SLint y, const SLKey mod)
 
virtual SLbool onMouseWheel (const SLint delta, const SLKey mod)
 
virtual SLbool onTouch2Down (const SLint x1, const SLint y1, const SLint x2, const SLint y2)
 
virtual SLbool onTouch2Move (const SLint x1, const SLint y1, const SLint x2, const SLint y2)
 
virtual SLbool onTouch2Up (const SLint x1, const SLint y1, const SLint x2, const SLint y2)
 
virtual SLbool onTouch3Down (const SLint x1, const SLint y1)
 
virtual SLbool onTouch3Move (const SLint x1, const SLint y1)
 
virtual SLbool onTouch3Up (const SLint x1, const SLint y1)
 
virtual SLbool onKeyPress (const SLKey key, const SLKey mod)
 
virtual SLbool onKeyRelease (const SLKey key, const SLKey mod)
 
virtual SLbool onRotationPYR (const SLfloat pitchRAD, const SLfloat yawRAD, const SLfloat rollRAD)
 
void mouseRotationFactor (SLfloat rf)
 
SLfloat mouseRotationFactor ()
 

Private Attributes

SLstring _name
 Name of the variable. More...
 
_value
 Current value. More...
 
_max
 Max. value for IncInc, IncDec & random types. More...
 
_min
 Min. value for IncInc, IncDec & random types. More...
 
_inc
 Increment value for IncInc, IncDec & Inc types. More...
 
SLUniformType _type
 Uniform1f type. More...
 
SLKey _keyInc
 keyboard key incrementing const values More...
 
function< T(void)> getValue
 lambda getter function More...
 

Additional Inherited Members

- Protected Attributes inherited from SLEventHandler
SLfloat _mouseRotationFactor
 Mouse rotation sensibility. More...
 
SLfloat _keyboardDeltaPos
 Delta dist. for keyboard translation. More...
 

Detailed Description

template<class T>
class SLGLUniform< T >

Template for a single GLSL uniform variable.

Class for GLSL uniform variables that change per frame. An SLGLProgram holds a list of this type of uniform variables that are applied within the beginUse method.

Constructor & Destructor Documentation

◆ SLGLUniform() [1/2]

template<class T >
SLGLUniform< T >::SLGLUniform ( SLUniformType  type,
const SLchar name,
value,
inc = 0.0f,
min = 0.0f,
max = 0.0f,
SLKey  keyInc = K_none 
)
inline

◆ SLGLUniform() [2/2]

template<class T >
SLGLUniform< T >::SLGLUniform ( const SLchar name,
function< T(void)>  getFunc 
)
inline

Member Function Documentation

◆ name()

template<class T >
const SLchar * SLGLUniform< T >::name ( )
inline

◆ onKeyPress()

template<class T >
SLbool SLGLUniform< T >::onKeyPress ( const SLKey  key,
const SLKey  mod 
)
inlineoverridevirtual

Key press event-handler.

Reimplemented from SLEventHandler.

◆ value()

template<class T >
T SLGLUniform< T >::value ( )
inline

calculates the current value & returns it. This method is called on every frame.

Member Data Documentation

◆ _inc

template<class T >
T SLGLUniform< T >::_inc
private

Increment value for IncInc, IncDec & Inc types.

◆ _keyInc

template<class T >
SLKey SLGLUniform< T >::_keyInc
private

keyboard key incrementing const values

◆ _max

template<class T >
T SLGLUniform< T >::_max
private

Max. value for IncInc, IncDec & random types.

◆ _min

template<class T >
T SLGLUniform< T >::_min
private

Min. value for IncInc, IncDec & random types.

◆ _name

template<class T >
SLstring SLGLUniform< T >::_name
private

Name of the variable.

◆ _type

template<class T >
SLUniformType SLGLUniform< T >::_type
private

Uniform1f type.

◆ _value

template<class T >
T SLGLUniform< T >::_value
private

Current value.

◆ getValue

template<class T >
function<T(void)> SLGLUniform< T >::getValue
private

lambda getter function


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