SLProject
4.2.000
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
|
Template for a single GLSL uniform variable. More...
#include <SLGLUniform.h>
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) | |
Constructs a custom uniform variable. More... | |
SLGLUniform (const SLchar *name, function< T(void)> getFunc) | |
const SLchar * | name () |
T | 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 | 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... | |
T | _value |
Current value. More... | |
T | _max |
Max. value for IncInc, IncDec & random types. More... | |
T | _min |
Min. value for IncInc, IncDec & random types. More... | |
T | _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... | |
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.
Definition at line 23 of file SLGLUniform.h.
|
inline |
Constructs a custom uniform variable.
type | Type of uniform variable |
name | Name of uniform variable |
value | Current value |
inc | Increment value |
min | Minimal value |
max | Maximal value |
keyInc | Key F1-F10 to increment the value decrement with SHIFT key |
Definition at line 36 of file SLGLUniform.h.
|
inline |
Definition at line 56 of file SLGLUniform.h.
|
inline |
Definition at line 64 of file SLGLUniform.h.
|
inlineoverridevirtual |
Key press event-handler.
Reimplemented from SLEventHandler.
Definition at line 116 of file SLGLUniform.h.
|
inline |
calculates the current value & returns it. This method is called on every frame.
Definition at line 70 of file SLGLUniform.h.
|
private |
Increment value for IncInc, IncDec & Inc types.
Definition at line 156 of file SLGLUniform.h.
|
private |
keyboard key incrementing const values
Definition at line 158 of file SLGLUniform.h.
|
private |
Max. value for IncInc, IncDec & random types.
Definition at line 154 of file SLGLUniform.h.
|
private |
Min. value for IncInc, IncDec & random types.
Definition at line 155 of file SLGLUniform.h.
|
private |
Name of the variable.
Definition at line 152 of file SLGLUniform.h.
|
private |
Uniform1f type.
Definition at line 157 of file SLGLUniform.h.
|
private |
Current value.
Definition at line 153 of file SLGLUniform.h.
|
private |
lambda getter function
Definition at line 159 of file SLGLUniform.h.