gdk-graphics 0b051eb9b5c1eaa0658babaa4463dd7a80aa9d2c
Loading...
Searching...
No Matches
graphics_context.h
1// © Joseph Cameron - All Rights Reserved
2
3#ifndef GDK_GFX_CONTEXT_H
4#define GDK_GFX_CONTEXT_H
5
6#include <gdk/entity.h>
7#include <gdk/graphics_types.h>
8#include <gdk/material.h>
9#include <gdk/model.h>
10#include <gdk/scene.h>
11#include <gdk/screen_camera.h>
12#include <gdk/shader_program.h>
13#include <gdk/texture.h>
14#include <gdk/texture_camera.h>
15
16#include <memory>
17
18namespace gdk {
19 namespace graphics {
21 class context {
22 public:
25 //
27 [[nodiscard]] virtual scene_ptr_type make_scene() = 0;
28
30 [[nodiscard]] virtual camera_ptr_type make_camera() = 0;
31
33 [[nodiscard]] virtual texture_camera_ptr_type make_texture_camera() = 0;
34
36 [[nodiscard]] virtual entity_ptr_type make_entity(
37 const const_model_ptr_type pModel,
38 const const_material_ptr_type pMaterial
39 ) = 0;
40
42 [[nodiscard]] virtual model_ptr_type make_model(
44 const model_data &vertexData
45 ) = 0;
47 [[nodiscard]] virtual model_ptr_type make_model() = 0;
48
50 [[nodiscard]] virtual material_ptr_type make_material(
51 const const_shader_ptr_type pShader,
54 ) = 0;
55
57 [[nodiscard]] virtual texture_ptr_type make_texture(
58 const texture_data::view &aTextureDataView,
61 ) = 0;
63 [[nodiscard]] virtual texture_ptr_type make_texture() = 0;
65
68 //
69 //TODO: get_cube and get_quad dont need to rely on impl anymore. move these to statics on model_data
72 [[nodiscard]] virtual model_ptr_type get_cube_model() const = 0;
73
86 [[nodiscard]] virtual shader_ptr_type get_alpha_cutoff_shader() const = 0;
88
90 virtual ~context() = default;
91 };
92 }
93}
94
95#endif
96
entry point for gdk-graphics
Definition graphics_context.h:21
virtual model_ptr_type make_model(const gdk::model::usage_hint, const model_data &vertexData)=0
make a model
virtual ~context()=default
virtual destructor
virtual model_ptr_type make_model()=0
make an empty model
virtual scene_ptr_type make_scene()=0
makes a scene
virtual material_ptr_type make_material(const const_shader_ptr_type pShader, const material::render_mode aRenderMode=material::render_mode::opaque, const material::face_culling_mode aFaceCullingMode=material::face_culling_mode::none)=0
make a material.
virtual shader_ptr_type get_alpha_cutoff_shader() const =0
Basic unlit forward renderer program: Attributes:
virtual camera_ptr_type make_camera()=0
makes a camera
virtual model_ptr_type get_cube_model() const =0
a 1x1x1 cube model
virtual texture_camera_ptr_type make_texture_camera()=0
makes a texture_camera
virtual texture_ptr_type make_texture()=0
make an empty texture
virtual texture_ptr_type make_texture(const texture_data::view &aTextureDataView, const texture::wrap_mode aWrapModeU=texture::wrap_mode::repeat, const texture::wrap_mode aWrapModeV=texture::wrap_mode::repeat)=0
make a texture
virtual entity_ptr_type make_entity(const const_model_ptr_type pModel, const const_material_ptr_type pMaterial)=0
make an entity
face_culling_mode
specify whether front- or back-facing polygons can be culled
Definition material.h:25
@ none
do not cull any polygons
Definition material.h:29
render_mode
render mode decides transparency etc
Definition material.h:33
@ opaque
no transparency
Definition material.h:34
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
@ repeat
sampled values repeat. e.g: {2,2}, {3,3}, 100,100} would all sample {1,1}
Definition texture.h:33
provides a pointer a contiguous list of channel data representing 2D texture metadata that contains i...
Definition texture_data.h:20