gdk-graphics  1b6d84e044c2c953fd7c9501e628a67e80f4da0d
Public Member Functions | List of all members
gdk::webgl1es2_context Class Referencefinal

brief webgl1/gles2.0 context implementation More...

#include <webgl1es2_context.h>

Inheritance diagram for gdk::webgl1es2_context:
gdk::graphics::context

Public Member Functions

virtual scene_ptr_type make_scene () const override
 makes a scene
 
virtual std::shared_ptr< screen_cameramake_camera () const override
 makes a camera TODO: rename to make_screen_camera probably
 
virtual std::shared_ptr< screen_cameramake_camera (const camera &other) const override
 makes a camera by copy
 
virtual std::shared_ptr< texture_cameramake_texture_camera () const override
 makes a texture_camera
 
virtual entity_ptr_type make_entity (model_shared_ptr_type pModel, material_shared_ptr_type pMaterial) const override
 make an entity
 
virtual entity_ptr_type make_entity (const entity &other) const override
 make an entity by copy
 
virtual graphics::context::material_ptr_type make_material (shader_program_shared_ptr_type pShader, material::render_mode aRenderMode, material::FaceCullingMode aFaceCullingMode) const override
 make a material.
 
virtual graphics::context::model_ptr_type make_model (const gdk::model::UsageHint &, const vertex_data &vertexDataView) const override
 construct model by vertext data view
 
virtual graphics::context::model_ptr_type make_model () const override
 construct an empty model
 
virtual shader_program_ptr_type make_shader (const std::string &aVertexGLSL, const std::string &aFragGLSL) const override
 make a shader program containing a user-defined vertex shader stage and fragment shader stage
 
virtual graphics::context::texture_ptr_type make_texture (const texture::image_data_2d_view &imageView) const override
 make a texture using a 2d image view
 
virtual graphics::context::texture_ptr_type make_texture (const std::vector< std::underlying_type< std::byte >::type > &aRGBA32PNGData) const override
 make a texture from an in-memory RGBA32 PNG
 
virtual graphics::context::built_in_shader_ptr_type get_alpha_cutoff_shader () const override
 A forward renderer shader program with the following properties: More...
 
virtual built_in_shader_ptr_type get_pink_shader_of_death () const override
 A forward renderer shader program useful for displaying render errors: More...
 
virtual built_in_model_ptr_type get_cube_model () const override
 WebGLES2 impl of built in cube model.
 
virtual built_in_model_ptr_type get_quad_model () const override
 WebGLES2 impl of built in quad model.
 
 webgl1es2_context ()
 default ctor
 
virtual ~webgl1es2_context () override=default
 default dtor
 
- Public Member Functions inherited from gdk::graphics::context
virtual ~context ()=default
 virtual destructor
 

Additional Inherited Members

- Public Types inherited from gdk::graphics::context
enum  implementation { implementation::opengl_webgl1_gles2, null }
 specifies implementation to use in context construction More...
 
using context_ptr_type = std::shared_ptr< context >
 ptr type returned by factory method
 
using scene_ptr_type = std::shared_ptr< scene >
 scene factory return type
 
using entity_ptr_type = std::shared_ptr< entity >
 entity factory return type
 
using shader_program_ptr_type = std::shared_ptr< shader_program >
 shader_program factory return type
 
using model_ptr_type = std::shared_ptr< model >
 model factory return type
 
using material_ptr_type = std::shared_ptr< material >
 material factory return type
 
using texture_ptr_type = std::shared_ptr< texture >
 texture factory return type
 
using built_in_model_ptr_type = std::shared_ptr< model >
 ptr type for built in models provided by the implementation
 
using built_in_shader_ptr_type = std::shared_ptr< shader_program >
 ptr type for built in shaders provided by the implementation
 
using context_shared_ptr_type = std::shared_ptr< context >
 shared ptr to a context
 
using scene_shared_ptr_type = std::shared_ptr< scene >
 shared ptr for scene
 
using shader_program_shared_ptr_type = std::shared_ptr< shader_program >
 shared ptr to a shader_program
 
using material_shared_ptr_type = std::shared_ptr< material >
 shared ptr to a material
 
using model_shared_ptr_type = std::shared_ptr< model >
 shared ptr to a model
 
using texture_shared_ptr_type = std::shared_ptr< texture >
 shared ptr to a texture
 
- Static Public Member Functions inherited from gdk::graphics::context
static context_ptr_type make (const implementation &)
 context factory method
 

Detailed Description

brief webgl1/gles2.0 context implementation

Member Function Documentation

◆ get_alpha_cutoff_shader()

virtual graphics::context::built_in_shader_ptr_type gdk::webgl1es2_context::get_alpha_cutoff_shader ( ) const
overridevirtual

A forward renderer shader program with the following properties:

  • required attributes: vec3 pos, vec2 uv
  • vertex shader: mvp mul only
  • fragment shader: colors frags with 2d sampler named "_Texture"
  • If alpha channel is < 1.0, the fragment is discarded

Implements gdk::graphics::context.

◆ get_pink_shader_of_death()

virtual built_in_shader_ptr_type gdk::webgl1es2_context::get_pink_shader_of_death ( ) const
overridevirtual

A forward renderer shader program useful for displaying render errors:

  • required attributes: vec3 pos
  • vertex shader: mvp mul
  • fragment shader: all frags are colored neon pink

Implements gdk::graphics::context.


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