gdk-graphics 0b051eb9b5c1eaa0658babaa4463dd7a80aa9d2c
Loading...
Searching...
No Matches
gdk::material Class Referenceabstract

decides how models using the material should be drawn. More...

#include <material.h>

Inheritance diagram for gdk::material:
gdk::webgl1es2_material

Public Types

enum class  face_culling_mode { front , back , front_and_back , none }
 specify whether front- or back-facing polygons can be culled More...
 
enum class  render_mode { opaque , transparent }
 render mode decides transparency etc More...
 
using texture_ptr_type = std::shared_ptr<gdk::texture>
 textures can be shared among many webgl1es2_materials.
 

Public Member Functions

virtual void set_texture (const std::string_view aName, texture_ptr_type aTexturePointer)=0
 assigns a texture to the material.
 
virtual void set_float (const std::string_view aName, float aValue)=0
 assigns a float to the material.
 
virtual void set_vector2 (const std::string_view aName, graphics_vector2_type aValue)=0
 assigns a 2 component vector
 
virtual void set_vector3 (const std::string_view aName, graphics_vector3_type aValue)=0
 assigns a 3 component vector
 
virtual void set_vector4 (const std::string_view aName, graphics_vector4_type aValue)=0
 assigns a 4 component vector
 
virtual void set_integer (const std::string_view aName, int aValue)=0
 assigns an integer to the material.
 
virtual void set_integer2 (const std::string_view aName, int aValue1, int aValue2)=0
 assigns a 2 integer array to the material.
 
virtual void set_integer3 (const std::string_view aName, int aValue1, int aValue2, int aValue3)=0
 assigns a 3 integer array to the material.
 
virtual void set_integer4 (const std::string_view aName, int aValue1, int aValue2, int aValue3, int aValue4)=0
 assigns a 4 integer array to the material.
 
virtual void set_int_vector2_array (const std::string_view aName, const std::vector< graphics_intvector2_type > &aValue)=0
 assigns an array of integer vector2s to the material
 

Detailed Description

decides how models using the material should be drawn.

This includes expected effects, such as texture colors, lightning, but can also include unexpected effects, like vertex displacements, transformations. Material is really pipeline state and persistent uniform values

Member Enumeration Documentation

◆ face_culling_mode

specify whether front- or back-facing polygons can be culled

Enumerator
front 

cull front facing polygons

back 

cull back facing polygons

front_and_back 

cull front and back facing polygons

none 

do not cull any polygons

◆ render_mode

enum class gdk::material::render_mode
strong

render mode decides transparency etc

Enumerator
opaque 

no transparency

transparent 

transparency

Member Function Documentation

◆ set_float()

virtual void gdk::material::set_float ( const std::string_view aName,
float aValue )
pure virtual

assigns a float to the material.

Implemented in gdk::webgl1es2_material.

◆ set_int_vector2_array()

virtual void gdk::material::set_int_vector2_array ( const std::string_view aName,
const std::vector< graphics_intvector2_type > & aValue )
pure virtual

assigns an array of integer vector2s to the material

Implemented in gdk::webgl1es2_material.

◆ set_integer()

virtual void gdk::material::set_integer ( const std::string_view aName,
int aValue )
pure virtual

assigns an integer to the material.

Implemented in gdk::webgl1es2_material.

◆ set_integer2()

virtual void gdk::material::set_integer2 ( const std::string_view aName,
int aValue1,
int aValue2 )
pure virtual

assigns a 2 integer array to the material.

Implemented in gdk::webgl1es2_material.

◆ set_integer3()

virtual void gdk::material::set_integer3 ( const std::string_view aName,
int aValue1,
int aValue2,
int aValue3 )
pure virtual

assigns a 3 integer array to the material.

Implemented in gdk::webgl1es2_material.

◆ set_integer4()

virtual void gdk::material::set_integer4 ( const std::string_view aName,
int aValue1,
int aValue2,
int aValue3,
int aValue4 )
pure virtual

assigns a 4 integer array to the material.

Implemented in gdk::webgl1es2_material.

◆ set_texture()

virtual void gdk::material::set_texture ( const std::string_view aName,
texture_ptr_type aTexturePointer )
pure virtual

assigns a texture to the material.

Note
note that this is passed by pointer, not value

Implemented in gdk::webgl1es2_material.

◆ set_vector2()

virtual void gdk::material::set_vector2 ( const std::string_view aName,
graphics_vector2_type aValue )
pure virtual

assigns a 2 component vector

Implemented in gdk::webgl1es2_material.

◆ set_vector3()

virtual void gdk::material::set_vector3 ( const std::string_view aName,
graphics_vector3_type aValue )
pure virtual

assigns a 3 component vector

Implemented in gdk::webgl1es2_material.

◆ set_vector4()

virtual void gdk::material::set_vector4 ( const std::string_view aName,
graphics_vector4_type aValue )
pure virtual

assigns a 4 component vector

Implemented in gdk::webgl1es2_material.


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