Euphoria
renderer.h
Go to the documentation of this file.
1#pragma once
2
3#include <memory>
4
6
7#include "eu/render/debug.h"
11#include "eu/render/world.h"
12
13namespace eu::render
14{
15
19
20struct RendererPimpl;
21
22
23// todo(Gustav): move to a different file?
29
30
33{
37
38 std::unique_ptr<RendererPimpl> pimpl;
39
40 Renderer(State* states, Assets* default_assets, const RenderSettings& settings);
42
43 Renderer(const Renderer&) = delete;
44 Renderer(Renderer&&) = delete;
45 void operator=(const Renderer&) = delete;
46 void operator=(Renderer&&) = delete;
47
48 [[nodiscard]] std::shared_ptr<UnlitMaterial> make_unlit_material() const;
49 [[nodiscard]] std::shared_ptr<DefaultMaterial> make_default_material() const;
50
53
54 [[nodiscard]] Skybox make_skybox(std::shared_ptr<TextureCubemap> texture) const;
55
57 [[nodiscard]] bool is_loaded() const;
58
60 void render_world(const Size& window_size, const World&, const CompiledCamera&, const ShadowContext& shadow_context);
61
62 void render_shadows(const Size& window_size, const World&, const CompiledCamera&) const;
63};
64
68
69} // namespace eu::render
constexpr m4 m4_identity
The identity matrix.
Definition mat4.h:177
Definition ui.h:4
a size
Definition size.h:11
A list of CompiledVertexLayoutNoNameList (for geom).
4x4 matrix
Definition mat4.h:19
A "compiled" camera for use in rendering.
Definition camera.h:51
Just stores debug render requests and doesn't actually render anything.
Definition debug.h:24
"render to texture" feature
Definition texture.h:103
Startup settings for the renderer.
Internal state of the renderer.
void render_world(const Size &window_size, const World &, const CompiledCamera &, const ShadowContext &shadow_context)
doesn't set the size, prefer EffectStack::render
DebugRender debug
Definition renderer.h:36
std::shared_ptr< UnlitMaterial > make_unlit_material() const
core::CompiledGeomVertexAttributes default_geom_layout() const
bool is_loaded() const
verify that the renderer was fully loaded
std::shared_ptr< DefaultMaterial > make_default_material() const
std::unique_ptr< RendererPimpl > pimpl
Definition renderer.h:38
Skybox make_skybox(std::shared_ptr< TextureCubemap > texture) const
core::CompiledGeomVertexAttributes unlit_geom_layout() const
RenderSettings settings
Definition renderer.h:35
Renderer(Renderer &&)=delete
Renderer(State *states, Assets *default_assets, const RenderSettings &settings)
void operator=(const Renderer &)=delete
Renderer(const Renderer &)=delete
void render_shadows(const Size &window_size, const World &, const CompiledCamera &) const
void operator=(Renderer &&)=delete
FrameBuffer * directional_shadow_map
Definition renderer.h:26
A skybox model with a cubemap texture.
Definition world.h:193
A "cache" for the current open gl state.
Definition state.h:119
A list of objects to render.
Definition world.h:201