gdk-graphics 0b051eb9b5c1eaa0658babaa4463dd7a80aa9d2c
Loading...
Searching...
No Matches
gdk::webgl1es2_material Class Reference

#include <webgl1es2_material.h>

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

Public Types

using shader_ptr_type = std::shared_ptr<gdk::webgl1es2_shader_program>
 shaders can be shared among many webgl1es2_materials
 
- Public Types inherited from gdk::material
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

webgl1es2_materialoperator= (webgl1es2_material &&)=default
 support move semantics
 
 webgl1es2_material (webgl1es2_material &&)=default
 support move semantics
 
webgl1es2_materialoperator= (const webgl1es2_material &)=default
 support copy semantics
 
 webgl1es2_material (const webgl1es2_material &)=default
 support copy semantics
 
 webgl1es2_material (shader_ptr_type pShader, material::face_culling_mode aface_culling_mode, material::render_mode aRenderMode)
 
 ~webgl1es2_material ()=default
 trivial destructor
 
external interface
virtual void set_texture (const std::string_view aName, const texture_ptr_type aTexture) override
 assigns a texture to the material.
 
virtual void set_float (const std::string_view aName, float aValue) override
 assigns a float to the material.
 
virtual void set_vector2 (const std::string_view aName, graphics_vector2_type aValue) override
 assigns a 2 component vector
 
virtual void set_vector3 (const std::string_view aName, graphics_vector3_type aValue) override
 assigns a 3 component vector
 
virtual void set_vector4 (const std::string_view aName, graphics_vector4_type aValue) override
 assigns a 4 component vector
 
virtual void set_integer (const std::string_view aName, int aValue) override
 assigns an integer to the material.
 
virtual void set_integer2 (const std::string_view aName, int aValue1, int aValue2) override
 assigns a 2 integer array to the material.
 
virtual void set_integer3 (const std::string_view aName, int aValue1, int aValue2, int aValue3) override
 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) override
 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) override
 assigns an array of integer vector2s to the material
 
internal interface
material::render_mode get_render_mode () const
 
shader_ptr_type getShaderProgram ()
 
void activate ()
 modifies the opengl state, assigning the program, assigning values to the program's uniforms etc.
 

Detailed Description

Todo
think about how to model blend functionality. subclass that provides blend func related state , in opaque case force opaque options?

Constructor & Destructor Documentation

◆ webgl1es2_material()

gdk::webgl1es2_material::webgl1es2_material ( shader_ptr_type pShader,
material::face_culling_mode aface_culling_mode,
material::render_mode aRenderMode )

constructs a webgl1es2_material. non-shader pipeline state and uniform values are 0 constructed, given default values specified by the opengl standard however a shader must be provided at ctor time, since the pipeline cannot be invoked without first using a shader logically, a webgl1es2_material without a shader_program implies a pipeline without a programmable vertex shader stage nor a programmable fragment shader stage, which is not a valid pipeline

Member Function Documentation

◆ set_float()

virtual void gdk::webgl1es2_material::set_float ( const std::string_view aName,
float aValue )
overridevirtual

assigns a float to the material.

Implements gdk::material.

◆ set_int_vector2_array()

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

assigns an array of integer vector2s to the material

Implements gdk::material.

◆ set_integer()

virtual void gdk::webgl1es2_material::set_integer ( const std::string_view aName,
int aValue )
overridevirtual

assigns an integer to the material.

Implements gdk::material.

◆ set_integer2()

virtual void gdk::webgl1es2_material::set_integer2 ( const std::string_view aName,
int aValue1,
int aValue2 )
overridevirtual

assigns a 2 integer array to the material.

Implements gdk::material.

◆ set_integer3()

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

assigns a 3 integer array to the material.

Implements gdk::material.

◆ set_integer4()

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

assigns a 4 integer array to the material.

Implements gdk::material.

◆ set_texture()

virtual void gdk::webgl1es2_material::set_texture ( const std::string_view aName,
const texture_ptr_type aTexturePointer )
overridevirtual

assigns a texture to the material.

Note
note that this is passed by pointer, not value

Implements gdk::material.

◆ set_vector2()

virtual void gdk::webgl1es2_material::set_vector2 ( const std::string_view aName,
graphics_vector2_type aValue )
overridevirtual

assigns a 2 component vector

Implements gdk::material.

◆ set_vector3()

virtual void gdk::webgl1es2_material::set_vector3 ( const std::string_view aName,
graphics_vector3_type aValue )
overridevirtual

assigns a 3 component vector

Implements gdk::material.

◆ set_vector4()

virtual void gdk::webgl1es2_material::set_vector4 ( const std::string_view aName,
graphics_vector4_type aValue )
overridevirtual

assigns a 4 component vector

Implements gdk::material.


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