3#ifndef GDK_GRAPHICS_CONTEXT_H
4#define GDK_GRAPHICS_CONTEXT_H
6#include <gdk/graphics/entity.h>
7#include <gdk/graphics/limits.h>
8#include <gdk/graphics/types.h>
11#include <gdk/graphics/material.h>
12#include <gdk/graphics/model.h>
13#include <gdk/graphics/scene.h>
14#include <gdk/graphics/screen_camera.h>
15#include <gdk/graphics/shader_program.h>
16#include <gdk/graphics/texture.h>
17#include <gdk/graphics/texture_camera.h>
21namespace gdk::graphics {
32 [[nodiscard]]
virtual screen_camera_ptr_type
make_camera() = 0;
42 const const_model_ptr_type pModel,
43 const const_material_ptr_type pMaterial
56 const const_shader_ptr_type pShader,
62 [[nodiscard]] material_ptr_type
make_material(
const const_shader_ptr_type pShader,
68 [[nodiscard]] material_ptr_type
make_material(
const const_shader_ptr_type pShader) {
74 const const_material_ptr_type &aPrototype) = 0;
107 [[nodiscard]]
virtual model_ptr_type make_sphere_model()
const = 0;
entry point for gdk-graphics
Definition context.h:23
virtual material_ptr_type make_material(const const_shader_ptr_type pShader, const material::render_mode aRenderMode, const material::face_culling_mode aFaceCullingMode)=0
make a material.
virtual ~context()=default
virtual destructor
virtual model_ptr_type make_model()=0
make an empty model
virtual screen_camera_ptr_type make_camera()=0
makes a camera that draws to the screen
virtual model_ptr_type make_model(const gdk::graphics::model::usage_hint, const model_data &vertexData)=0
make a model
virtual shader_ptr_type make_alpha_cutoff_shader() const =0
Basic unlit forward renderer program: Attributes:
virtual graphics::limits limits() const =0
the limits of the device, narrowed to the context's profile when it was given one
texture_ptr_type make_texture(const texture_data::view &aTextureDataView, const texture::wrap_mode aWrapModeU, const texture::wrap_mode aWrapModeV)
make a sharp texture
Definition context.h:85
virtual scene_ptr_type make_scene()=0
makes a scene
virtual shader_ptr_type make_alpha_blend_shader() const =0
a shader that keeps the texel's alpha, for the blender to use.
virtual material_ptr_type make_material(const const_material_ptr_type &aPrototype)=0
make a material that starts as a copy of another
material_ptr_type make_material(const const_shader_ptr_type pShader)
make an opaque material that culls no faces
Definition context.h:68
virtual texture_ptr_type make_texture(const texture_data::view &aTextureDataView, const texture::wrap_mode aWrapModeU, const texture::wrap_mode aWrapModeV, const texture::filter_mode aFilterMode)=0
make a texture
virtual texture_camera_ptr_type make_texture_camera(const intvector2_type &aSize)=0
makes a texture_camera drawing into textures aSize texels across
virtual texture_camera_ptr_type make_texture_camera()=0
makes a texture_camera drawing into textures 1024 texels square
virtual texture_ptr_type make_texture()=0
make an empty texture
texture_ptr_type make_texture(const texture_data::view &aTextureDataView)
make a sharp texture that repeats
Definition context.h:91
virtual model_ptr_type make_cube_model() const =0
a 1x1x1 cube model
virtual entity_ptr_type make_entity(const const_model_ptr_type pModel, const const_material_ptr_type pMaterial)=0
make an entity
material_ptr_type make_material(const const_shader_ptr_type pShader, const material::render_mode aRenderMode)
make a material that culls no faces
Definition context.h:62
render_mode
render mode decides transparency etc
Definition material.h:32
@ opaque
no transparency
Definition material.h:33
face_culling_mode
specify whether front- or back-facing polygons can be culled
Definition material.h:24
@ none
do not cull any polygons
Definition material.h:28
vertex data stored in system memory.
Definition model_data.h:25
usage_hint
Definition model.h:12
filter_mode
how a texel is chosen when a pixel does not land exactly on one
Definition texture.h:27
@ sharp
nearest: the one texel closest to the sample, so texels stay square
Definition texture.h:28
wrap_mode
behavior when sampling outside of the normalized texture range (u0-1, v0-1)
Definition texture.h:20
@ repeat
sampled values repeat. e.g: {2,2}, {3,3}, 100,100} would all sample {1,1}
Definition texture.h:22
used to (optionally) enforce limits on graphical types used across graphics apis
Definition limits.h:12
provides a pointer a contiguous list of channel data representing 2D texture metadata that contains i...
Definition texture_data.h:27