gdk-graphics  1b6d84e044c2c953fd7c9501e628a67e80f4da0d
Public Types | Public Member Functions | List of all members
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  FaceCullingMode { FaceCullingMode::Front, FaceCullingMode::Back, FaceCullingMode::FrontAndBack, FaceCullingMode::None }
 specify whether front- or back-facing polygons can be culled More...
 
enum  render_mode { render_mode::opaque, render_mode::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 setTexture (const std::string &aName, texture_ptr_type aTexturePointer)=0
 assigns a texture to the material. More...
 
virtual void setFloat (const std::string &aName, float aValue)=0
 assigns a float to the material.
 
virtual void setVector2 (const std::string &aName, graphics_vector2_type aValue)=0
 assigns a 2 component vector
 
virtual void setVector3 (const std::string &aName, graphics_vector3_type aValue)=0
 assigns a 3 component vector
 
virtual void setVector4 (const std::string &aName, graphics_vector4_type aValue)=0
 assigns a 4 component vector
 
virtual void setInteger (const std::string &aName, int aValue)=0
 assigns an integer to the material.
 
virtual void setInteger2 (const std::string &aName, int aValue1, int aValue2)=0
 assigns a 2 integer array to the material.
 
virtual void setInteger3 (const std::string &aName, int aValue1, int aValue2, int aValue3)=0
 assigns a 3 integer array to the material.
 
virtual void setInteger4 (const std::string &aName, int aValue1, int aValue2, int aValue3, int aValue4)=0
 assigns a 4 integer array 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

◆ FaceCullingMode

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

Enumerator
Front 

cull front facing polygons

Back 

cull back facing polygons

FrontAndBack 

cull front and back facing polygons

None 

do not cull any polygons

◆ render_mode

render mode decides transparency etc

Enumerator
opaque 

no transparency

transparent 

transparency

Member Function Documentation

◆ setTexture()

virtual void gdk::material::setTexture ( const std::string &  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.


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