Antkeeper  0.0.1
Public Types | Public Member Functions | Static Public Member Functions | List of all members
render::material_property< T > Class Template Reference

A property of a material which can be uploaded to a shader program via a shader input. More...

#include <material-property.hpp>

Inheritance diagram for render::material_property< T >:
render::material_property_base

Public Types

typedef tween< T > tween_type
 
typedef tween< T >::interpolator_type interpolator_type
 

Public Member Functions

 material_property (std::size_t element_count)
 Creates a material property. More...
 
virtual ~material_property ()
 Destroys a material property. More...
 
 material_property (const material_property< T > &)=delete
 
material_property< T > & operator= (const material_property< T > &)=delete
 
virtual void update_tweens ()
 Sets state 0 = state 1. More...
 
virtual bool upload (double a) const
 
void set_value (const T &value)
 Sets the value of this property. More...
 
void set_value (std::size_t index, const T &value)
 Sets the value of a single element in this array property. More...
 
void set_values (std::size_t index, const T *values, std::size_t count)
 Sets the values of a range of elements in this array property. More...
 
void set_tween_interpolator (interpolator_type interpolator)
 Sets the tween interpolator function. More...
 
const T & get_value () const
 Returns the value of the first element in this property. More...
 
const T & get_value (std::size_t index) const
 Returns the value of the first element in this property. More...
 
virtual gl::shader_variable_type get_data_type () const
 Returns the type of data which the property contains. More...
 
virtual material_property_baseclone () const
 Creates a copy of this material property. More...
 
float default_interpolator (const float &x, const float &y, double a)
 
float2 default_interpolator (const float2 &x, const float2 &y, double a)
 
float3 default_interpolator (const float3 &x, const float3 &y, double a)
 
float4 default_interpolator (const float4 &x, const float4 &y, double a)
 
gl::shader_variable_type get_data_type () const
 Returns the type of data which the property contains. More...
 
gl::shader_variable_type get_data_type () const
 Returns the type of data which the property contains. More...
 
gl::shader_variable_type get_data_type () const
 Returns the type of data which the property contains. More...
 
gl::shader_variable_type get_data_type () const
 Returns the type of data which the property contains. More...
 
gl::shader_variable_type get_data_type () const
 Returns the type of data which the property contains. More...
 
gl::shader_variable_type get_data_type () const
 Returns the type of data which the property contains. More...
 
gl::shader_variable_type get_data_type () const
 Returns the type of data which the property contains. More...
 
gl::shader_variable_type get_data_type () const
 Returns the type of data which the property contains. More...
 
gl::shader_variable_type get_data_type () const
 Returns the type of data which the property contains. More...
 
gl::shader_variable_type get_data_type () const
 Returns the type of data which the property contains. More...
 
gl::shader_variable_type get_data_type () const
 Returns the type of data which the property contains. More...
 
gl::shader_variable_type get_data_type () const
 Returns the type of data which the property contains. More...
 
gl::shader_variable_type get_data_type () const
 Returns the type of data which the property contains. More...
 
gl::shader_variable_type get_data_type () const
 Returns the type of data which the property contains. More...
 
gl::shader_variable_type get_data_type () const
 Returns the type of data which the property contains. More...
 
gl::shader_variable_type get_data_type () const
 Returns the type of data which the property contains. More...
 
gl::shader_variable_type get_data_type () const
 Returns the type of data which the property contains. More...
 
gl::shader_variable_type get_data_type () const
 Returns the type of data which the property contains. More...
 
gl::shader_variable_type get_data_type () const
 Returns the type of data which the property contains. More...
 
gl::shader_variable_type get_data_type () const
 Returns the type of data which the property contains. More...
 
gl::shader_variable_type get_data_type () const
 Returns the type of data which the property contains. More...
 
gl::shader_variable_type get_data_type () const
 Returns the type of data which the property contains. More...
 
gl::shader_variable_type get_data_type () const
 Returns the type of data which the property contains. More...
 
- Public Member Functions inherited from render::material_property_base
bool connect (const gl::shader_input *input)
 Connects the material property to a shader input. More...
 
void disconnect ()
 Disconnects the material property from its shader input. More...
 
bool is_connected () const
 Returns true if the material property is connected to a shader input, false otherwise. More...
 

Static Public Member Functions

static T default_interpolator (const T &x, const T &y, double a)
 Default tween interpolator function for this material property type. More...
 

Additional Inherited Members

- Protected Member Functions inherited from render::material_property_base
 material_property_base ()
 
- Protected Attributes inherited from render::material_property_base
const gl::shader_inputinput
 

Detailed Description

template<class T>
class render::material_property< T >

A property of a material which can be uploaded to a shader program via a shader input.

Template Parameters
TProperty data type.

Definition at line 103 of file material-property.hpp.

Member Typedef Documentation

◆ interpolator_type

Definition at line 107 of file material-property.hpp.

◆ tween_type

template<class T >
typedef tween<T> render::material_property< T >::tween_type

Definition at line 106 of file material-property.hpp.

Constructor & Destructor Documentation

◆ material_property() [1/2]

template<class T >
render::material_property< T >::material_property ( std::size_t  element_count)

Creates a material property.

Parameters
element_countNumber of elements in the property array.

Definition at line 217 of file material-property.hpp.

◆ ~material_property()

template<class T >
render::material_property< T >::~material_property
virtual

Destroys a material property.

Definition at line 226 of file material-property.hpp.

◆ material_property() [2/2]

template<class T >
render::material_property< T >::material_property ( const material_property< T > &  )
delete

Member Function Documentation

◆ clone()

template<class T >
material_property_base * render::material_property< T >::clone
virtual

Creates a copy of this material property.

Implements render::material_property_base.

Definition at line 445 of file material-property.hpp.

◆ default_interpolator() [1/5]

float render::material_property< float >::default_interpolator ( const float &  x,
const float &  y,
double  a 
)
inline

Definition at line 193 of file material-property.hpp.

◆ default_interpolator() [2/5]

float2 render::material_property< float2 >::default_interpolator ( const float2 x,
const float2 y,
double  a 
)
inline

Definition at line 199 of file material-property.hpp.

◆ default_interpolator() [3/5]

float3 render::material_property< float3 >::default_interpolator ( const float3 x,
const float3 y,
double  a 
)
inline

Definition at line 205 of file material-property.hpp.

◆ default_interpolator() [4/5]

float4 render::material_property< float4 >::default_interpolator ( const float4 x,
const float4 y,
double  a 
)
inline

Definition at line 211 of file material-property.hpp.

◆ default_interpolator() [5/5]

template<typename T >
T render::material_property< T >::default_interpolator ( const T &  x,
const T &  y,
double  a 
)
inlinestatic

Default tween interpolator function for this material property type.

Definition at line 187 of file material-property.hpp.

◆ get_data_type() [1/24]

template<class T >
virtual gl::shader_variable_type render::material_property< T >::get_data_type ( ) const
virtual

Returns the type of data which the property contains.

Implements render::material_property_base.

◆ get_data_type() [2/24]

gl::shader_variable_type render::material_property< bool >::get_data_type ( ) const
inlinevirtual

Returns the type of data which the property contains.

Implements render::material_property_base.

Definition at line 307 of file material-property.hpp.

◆ get_data_type() [3/24]

gl::shader_variable_type render::material_property< bool2 >::get_data_type ( ) const
inlinevirtual

Returns the type of data which the property contains.

Implements render::material_property_base.

Definition at line 313 of file material-property.hpp.

◆ get_data_type() [4/24]

gl::shader_variable_type render::material_property< bool3 >::get_data_type ( ) const
inlinevirtual

Returns the type of data which the property contains.

Implements render::material_property_base.

Definition at line 319 of file material-property.hpp.

◆ get_data_type() [5/24]

gl::shader_variable_type render::material_property< bool4 >::get_data_type ( ) const
inlinevirtual

Returns the type of data which the property contains.

Implements render::material_property_base.

Definition at line 325 of file material-property.hpp.

◆ get_data_type() [6/24]

gl::shader_variable_type render::material_property< int >::get_data_type ( ) const
inlinevirtual

Returns the type of data which the property contains.

Implements render::material_property_base.

Definition at line 331 of file material-property.hpp.

◆ get_data_type() [7/24]

gl::shader_variable_type render::material_property< int2 >::get_data_type ( ) const
inlinevirtual

Returns the type of data which the property contains.

Implements render::material_property_base.

Definition at line 337 of file material-property.hpp.

◆ get_data_type() [8/24]

gl::shader_variable_type render::material_property< int3 >::get_data_type ( ) const
inlinevirtual

Returns the type of data which the property contains.

Implements render::material_property_base.

Definition at line 343 of file material-property.hpp.

◆ get_data_type() [9/24]

gl::shader_variable_type render::material_property< int4 >::get_data_type ( ) const
inlinevirtual

Returns the type of data which the property contains.

Implements render::material_property_base.

Definition at line 349 of file material-property.hpp.

◆ get_data_type() [10/24]

gl::shader_variable_type render::material_property< unsigned int >::get_data_type ( ) const
inlinevirtual

Returns the type of data which the property contains.

Implements render::material_property_base.

Definition at line 355 of file material-property.hpp.

◆ get_data_type() [11/24]

gl::shader_variable_type render::material_property< uint2 >::get_data_type ( ) const
inlinevirtual

Returns the type of data which the property contains.

Implements render::material_property_base.

Definition at line 361 of file material-property.hpp.

◆ get_data_type() [12/24]

gl::shader_variable_type render::material_property< uint3 >::get_data_type ( ) const
inlinevirtual

Returns the type of data which the property contains.

Implements render::material_property_base.

Definition at line 367 of file material-property.hpp.

◆ get_data_type() [13/24]

gl::shader_variable_type render::material_property< uint4 >::get_data_type ( ) const
inlinevirtual

Returns the type of data which the property contains.

Implements render::material_property_base.

Definition at line 373 of file material-property.hpp.

◆ get_data_type() [14/24]

gl::shader_variable_type render::material_property< float >::get_data_type ( ) const
inlinevirtual

Returns the type of data which the property contains.

Implements render::material_property_base.

Definition at line 379 of file material-property.hpp.

◆ get_data_type() [15/24]

gl::shader_variable_type render::material_property< float2 >::get_data_type ( ) const
inlinevirtual

Returns the type of data which the property contains.

Implements render::material_property_base.

Definition at line 385 of file material-property.hpp.

◆ get_data_type() [16/24]

gl::shader_variable_type render::material_property< float3 >::get_data_type ( ) const
inlinevirtual

Returns the type of data which the property contains.

Implements render::material_property_base.

Definition at line 391 of file material-property.hpp.

◆ get_data_type() [17/24]

gl::shader_variable_type render::material_property< float4 >::get_data_type ( ) const
inlinevirtual

Returns the type of data which the property contains.

Implements render::material_property_base.

Definition at line 397 of file material-property.hpp.

◆ get_data_type() [18/24]

gl::shader_variable_type render::material_property< float2x2 >::get_data_type ( ) const
inlinevirtual

Returns the type of data which the property contains.

Implements render::material_property_base.

Definition at line 403 of file material-property.hpp.

◆ get_data_type() [19/24]

gl::shader_variable_type render::material_property< float3x3 >::get_data_type ( ) const
inlinevirtual

Returns the type of data which the property contains.

Implements render::material_property_base.

Definition at line 409 of file material-property.hpp.

◆ get_data_type() [20/24]

gl::shader_variable_type render::material_property< float4x4 >::get_data_type ( ) const
inlinevirtual

Returns the type of data which the property contains.

Implements render::material_property_base.

Definition at line 415 of file material-property.hpp.

◆ get_data_type() [21/24]

gl::shader_variable_type render::material_property< const gl::texture_1d * >::get_data_type ( ) const
inlinevirtual

Returns the type of data which the property contains.

Implements render::material_property_base.

Definition at line 421 of file material-property.hpp.

◆ get_data_type() [22/24]

gl::shader_variable_type render::material_property< const gl::texture_2d * >::get_data_type ( ) const
inlinevirtual

Returns the type of data which the property contains.

Implements render::material_property_base.

Definition at line 427 of file material-property.hpp.

◆ get_data_type() [23/24]

gl::shader_variable_type render::material_property< const gl::texture_3d * >::get_data_type ( ) const
inlinevirtual

Returns the type of data which the property contains.

Implements render::material_property_base.

Definition at line 433 of file material-property.hpp.

◆ get_data_type() [24/24]

gl::shader_variable_type render::material_property< const gl::texture_cube * >::get_data_type ( ) const
inlinevirtual

Returns the type of data which the property contains.

Implements render::material_property_base.

Definition at line 439 of file material-property.hpp.

◆ get_value() [1/2]

template<class T >
const T & render::material_property< T >::get_value
inline

Returns the value of the first element in this property.

Definition at line 295 of file material-property.hpp.

◆ get_value() [2/2]

template<class T >
const T & render::material_property< T >::get_value ( std::size_t  index) const
inline

Returns the value of the first element in this property.

Parameters
indexIndex of an array element.
Returns
Value of the element at the specified index.

Definition at line 301 of file material-property.hpp.

◆ operator=()

template<class T >
material_property<T>& render::material_property< T >::operator= ( const material_property< T > &  )
delete

◆ set_tween_interpolator()

template<class T >
void render::material_property< T >::set_tween_interpolator ( interpolator_type  interpolator)

Sets the tween interpolator function.

Parameters
interpolatorTween interpolator function.

Definition at line 286 of file material-property.hpp.

◆ set_value() [1/2]

template<class T >
void render::material_property< T >::set_value ( const T &  value)

Sets the value of this property.

Parameters
valueValue to set.

Definition at line 265 of file material-property.hpp.

◆ set_value() [2/2]

template<class T >
void render::material_property< T >::set_value ( std::size_t  index,
const T &  value 
)

Sets the value of a single element in this array property.

Parameters
indexIndex of an array element.
valueValue to set.

Definition at line 271 of file material-property.hpp.

◆ set_values()

template<class T >
void render::material_property< T >::set_values ( std::size_t  index,
const T *  values,
std::size_t  count 
)

Sets the values of a range of elements in this array property.

Parameters
indexIndex of the first array element to set.
valuesPointer to an array of values to set.
countNumber of elements to set.

Definition at line 277 of file material-property.hpp.

◆ update_tweens()

template<class T >
void render::material_property< T >::update_tweens
virtual

Sets state 0 = state 1.

Implements render::material_property_base.

Definition at line 232 of file material-property.hpp.

◆ upload()

template<class T >
bool render::material_property< T >::upload ( double  a) const
virtual

Implements render::material_property_base.

Definition at line 241 of file material-property.hpp.


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