Turbo Engine 0.3
A C++ game engine using Allegro 5
turbo::UniformValue Struct Reference

A single, typed shader uniform value. More...

#include <Uniform.hpp>

Collaboration diagram for turbo::UniformValue:

Public Types

enum class  Type {
  Float , Int , Bool , Vec2 ,
  Vec3 , Vec4 , Sampler
}

Static Public Member Functions

static UniformValue Float (float v)
static UniformValue Int (int v)
static UniformValue Bool (bool v)
static UniformValue Vec2 (float x, float y)
static UniformValue Vec3 (float x, float y, float z)
static UniformValue Vec4 (float x, float y, float z, float w)
static UniformValue Sampler (Texture *t, int unit)

Public Attributes

Type type = Type::Float
float f [4] = {0.0f, 0.0f, 0.0f, 0.0f}
int i = 0
bool b = false
Texturesampler = nullptr
int sampler_unit = 0

Detailed Description

A single, typed shader uniform value.

Materials store these so uniform values can be set at any time (and later edited from an inspector UI) and pushed to the GPU only at bind time.

Member Enumeration Documentation

◆ Type

enum class turbo::UniformValue::Type
strong
Enumerator
Float 
Int 
Bool 
Vec2 
Vec3 
Vec4 
Sampler 

Member Function Documentation

◆ Bool()

UniformValue turbo::UniformValue::Bool ( bool v)
inlinestatic

◆ Float()

UniformValue turbo::UniformValue::Float ( float v)
inlinestatic

◆ Int()

UniformValue turbo::UniformValue::Int ( int v)
inlinestatic

◆ Sampler()

UniformValue turbo::UniformValue::Sampler ( Texture * t,
int unit )
inlinestatic

◆ Vec2()

UniformValue turbo::UniformValue::Vec2 ( float x,
float y )
inlinestatic

◆ Vec3()

UniformValue turbo::UniformValue::Vec3 ( float x,
float y,
float z )
inlinestatic

◆ Vec4()

UniformValue turbo::UniformValue::Vec4 ( float x,
float y,
float z,
float w )
inlinestatic

Member Data Documentation

◆ b

bool turbo::UniformValue::b = false

◆ f

float turbo::UniformValue::f[4] = {0.0f, 0.0f, 0.0f, 0.0f}

◆ i

int turbo::UniformValue::i = 0

◆ sampler

Texture* turbo::UniformValue::sampler = nullptr

◆ sampler_unit

int turbo::UniformValue::sampler_unit = 0

◆ type

Type turbo::UniformValue::type = Type::Float

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