gdk-graphics 0b051eb9b5c1eaa0658babaa4463dd7a80aa9d2c
Loading...
Searching...
No Matches
webgl1es2_context.h
1// © Joseph Cameron - All Rights Reserved
2
3#ifndef GDK_GFX_WEBGL1ES2_CONTEXT_H
4#define GDK_GFX_WEBGL1ES2_CONTEXT_H
5
6#include <gdk/graphics_context.h>
7
8#include <string_view>
9
10namespace gdk {
11 class model_data;
12
14 class webgl1es2_context final : public graphics::context {
15 public:
16 [[nodiscard]] static context_ptr_type make();
17
18 [[nodiscard]] shader_ptr_type make_shader(
19 const std::string_view aVertexShaderStageSourceCodeGLSL,
20 const std::string_view aFragmentShaderStageSourceCodeGLSL
21 );
22
23 [[nodiscard]] virtual scene_ptr_type make_scene() override;
24
25 [[nodiscard]] virtual camera_ptr_type make_camera() override;
26
27 [[nodiscard]] virtual texture_camera_ptr_type make_texture_camera() override;
28
29 [[nodiscard]] virtual entity_ptr_type make_entity(
30 const const_model_ptr_type pModel,
31 const const_material_ptr_type pMaterial
32 ) override;
33
34 [[nodiscard]] virtual material_ptr_type make_material(
35 const const_shader_ptr_type pShader,
36 const material::render_mode aRenderMode,
37 const material::face_culling_mode aface_culling_mode
38 ) override;
39
40 [[nodiscard]] virtual model_ptr_type make_model() override;
41
42 [[nodiscard]] virtual model_ptr_type make_model(
44 const model_data &vertexDataView
45 ) override;
46
47 [[nodiscard]] virtual texture_ptr_type make_texture(
48 const texture_data::view &imageView,
51 ) override;
52
53 [[nodiscard]] virtual texture_ptr_type make_texture() override;
54
55 [[nodiscard]] virtual shader_ptr_type get_alpha_cutoff_shader() const override;
56
57 [[nodiscard]] virtual model_ptr_type get_cube_model() const override;
58
59 webgl1es2_context(webgl1es2_context &&);
60
61 virtual ~webgl1es2_context() override;
62
63 private:
64 webgl1es2_context();
65 };
66}
67
68#endif
69
entry point for gdk-graphics
Definition graphics_context.h:21
face_culling_mode
specify whether front- or back-facing polygons can be culled
Definition material.h:25
render_mode
render mode decides transparency etc
Definition material.h:33
vertex data stored in system memory.
Definition model_data.h:22
usage_hint
Definition model.h:12
wrap_mode
behavior when sampling outside of the normalized texture range (u0-1, v0-1)
Definition texture.h:31
virtual camera_ptr_type make_camera() override
makes a camera
virtual scene_ptr_type make_scene() override
makes a scene
virtual model_ptr_type get_cube_model() const override
a 1x1x1 cube model
virtual texture_ptr_type make_texture() override
make an empty texture
virtual texture_ptr_type make_texture(const texture_data::view &imageView, const texture::wrap_mode, const texture::wrap_mode) override
make a texture
virtual model_ptr_type make_model(const gdk::model::usage_hint, const model_data &vertexDataView) override
make a model
virtual material_ptr_type make_material(const const_shader_ptr_type pShader, const material::render_mode aRenderMode, const material::face_culling_mode aface_culling_mode) override
make a material.
virtual shader_ptr_type get_alpha_cutoff_shader() const override
Basic unlit forward renderer program: Attributes:
virtual texture_camera_ptr_type make_texture_camera() override
makes a texture_camera
virtual entity_ptr_type make_entity(const const_model_ptr_type pModel, const const_material_ptr_type pMaterial) override
make an entity
virtual model_ptr_type make_model() override
make an empty model
provides a pointer a contiguous list of channel data representing 2D texture metadata that contains i...
Definition texture_data.h:20