![]() |
gdk-graphics 0b051eb9b5c1eaa0658babaa4463dd7a80aa9d2c
|
#include <webgl1es2_material.h>
Public Types | |
using | shader_ptr_type = std::shared_ptr<gdk::webgl1es2_shader_program> |
shaders can be shared among many webgl1es2_materials | |
![]() | |
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_material & | operator= (webgl1es2_material &&)=default |
support move semantics | |
webgl1es2_material (webgl1es2_material &&)=default | |
support move semantics | |
webgl1es2_material & | operator= (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. | |
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
|
overridevirtual |
assigns a float to the material.
Implements gdk::material.
|
overridevirtual |
assigns an array of integer vector2s to the material
Implements gdk::material.
|
overridevirtual |
assigns an integer to the material.
Implements gdk::material.
|
overridevirtual |
assigns a 2 integer array to the material.
Implements gdk::material.
|
overridevirtual |
assigns a 3 integer array to the material.
Implements gdk::material.
|
overridevirtual |
assigns a 4 integer array to the material.
Implements gdk::material.
|
overridevirtual |
assigns a texture to the material.
Implements gdk::material.
|
overridevirtual |
assigns a 2 component vector
Implements gdk::material.
|
overridevirtual |
assigns a 3 component vector
Implements gdk::material.
|
overridevirtual |
assigns a 4 component vector
Implements gdk::material.