FastUIDraw
Public Types | Public Member Functions | List of all members
fastuidraw::glsl::varying_list Class Reference

A varying_list lists all the in's of a frag shader (and their names) which is the same as the out's of the vertex shader which which it is paired. More...

#include <varying_list.hpp>

Public Types

enum  interpolator_type_t {
  interpolator_smooth, interpolator_noperspective, interpolator_flat, interpolator_uint,
  interpolator_int, interpolator_number_types
}
 Enumeration to define the interpolator type of a varying. More...
 

Public Member Functions

 varying_list (void)
 
 varying_list (const varying_list &rhs)
 
varying_listadd_float (c_string pname)
 
varying_listadd_float_flat (c_string pname)
 
varying_listadd_float_noperspective (c_string pname)
 
varying_listadd_int (c_string pname)
 
varying_listadd_uint (c_string pname)
 
varying_listadd_varying (c_string pname, enum interpolator_type_t q)
 
varying_listadd_varying_alias (c_string name, c_string src_name)
 
c_array< const c_stringalias_varying_names (void) const
 
c_array< const c_stringalias_varying_source_names (void) const
 
varying_listoperator= (const varying_list &rhs)
 
void swap (varying_list &obj)
 
c_array< const c_stringvaryings (enum interpolator_type_t q) const
 

Detailed Description

A varying_list lists all the in's of a frag shader (and their names) which is the same as the out's of the vertex shader which which it is paired.

A varying is ALWAYS a SCALAR. The varyings of shaders should -never- be declared in the shader code. Instead, each varying should be declared in the varying_list object passed to the shader object's ctor. The GLSL module will share the varyings across different shaders within the uber-shader. Indeed, the number of varying the uber-shader has is not the sum of the varyings across all the shaders, but rather is the maximum number of varyings across the shaders present in the uber-shader.

Definition at line 50 of file varying_list.hpp.

Member Enumeration Documentation

◆ interpolator_type_t

Enumeration to define the interpolator type of a varying.

Enumerator
interpolator_smooth 

corresponds to "smooth" of type float in GLSL

interpolator_noperspective 

corresponds to "noperspective" of type float in GLSL

interpolator_flat 

corresponds to "flat" of type float in GLSL

interpolator_uint 

corresponds to "flat" of type uint in GLSL

interpolator_int 

corresponds to "flat" of type int in GLSL

Definition at line 57 of file varying_list.hpp.

Constructor & Destructor Documentation

◆ varying_list() [1/2]

fastuidraw::glsl::varying_list::varying_list ( void  )

Ctor.

◆ varying_list() [2/2]

fastuidraw::glsl::varying_list::varying_list ( const varying_list rhs)

Copy ctor.

Parameters
rhsvalue from which to copy

Member Function Documentation

◆ add_float()

varying_list& fastuidraw::glsl::varying_list::add_float ( c_string  pname)
inline

Add an uint varying, equivalent to

Definition at line 158 of file varying_list.hpp.

◆ add_float_flat()

varying_list& fastuidraw::glsl::varying_list::add_float_flat ( c_string  pname)
inline

Add an uint varying, equivalent to

Definition at line 170 of file varying_list.hpp.

◆ add_float_noperspective()

varying_list& fastuidraw::glsl::varying_list::add_float_noperspective ( c_string  pname)
inline

Add an uint varying, equivalent to

Definition at line 182 of file varying_list.hpp.

◆ add_int()

varying_list& fastuidraw::glsl::varying_list::add_int ( c_string  pname)
inline

Add an uint varying, equivalent to

Definition at line 146 of file varying_list.hpp.

◆ add_uint()

varying_list& fastuidraw::glsl::varying_list::add_uint ( c_string  pname)
inline

Add an uint varying, equivalent to

Definition at line 134 of file varying_list.hpp.

◆ add_varying()

varying_list& fastuidraw::glsl::varying_list::add_varying ( c_string  pname,
enum interpolator_type_t  q 
)

Add a varying

Parameters
pnamename by which to reference the varying
qinterpolator type of the varying

◆ add_varying_alias()

varying_list& fastuidraw::glsl::varying_list::add_varying_alias ( c_string  name,
c_string  src_name 
)

Add an alias to a varying. The use case being if a fixed varying is used in two different roles and aliasing the name makes the GLSL shader code more readable.

Parameters
namethe new identifier to reference an existing varying
src_namethe varying referenced by name, which should be a string value that has been passed as the first argument to add_varying() or add_varying_alias().

◆ alias_varying_names()

c_array<const c_string> fastuidraw::glsl::varying_list::alias_varying_names ( void  ) const

Returns the alias names of the aliases, i.e. the values of the first argument of calls to add_varying_alias().

◆ alias_varying_source_names()

c_array<const c_string> fastuidraw::glsl::varying_list::alias_varying_source_names ( void  ) const

Returns the source names of the aliases, i.e. the values of the second argument of calls to add_varying_alias().

◆ operator=()

varying_list& fastuidraw::glsl::varying_list::operator= ( const varying_list rhs)

Assignment operator.

Parameters
rhsvalue from which to copy

◆ swap()

void fastuidraw::glsl::varying_list::swap ( varying_list obj)

Swap operation

Parameters
objobject with which to swap

◆ varyings()

c_array<const c_string> fastuidraw::glsl::varying_list::varyings ( enum interpolator_type_t  q) const

Returns the names of the varyings of the specified interpolator type.

Parameters
qinterpolator type

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