wren
Vulkan-based game engine
Toggle main menu visibility
Loading...
Searching...
No Matches
editor.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <imgui.h>
4
#include <imgui_impl_vulkan.h>
5
#include <imgui_internal.h>
6
7
#include <filesystem>
8
#include <memory>
9
#include <tracy/Tracy.hpp>
10
#include <vulkan/vulkan.hpp>
11
#include <
wren/application.hpp
>
12
#include <
wren/math/vector.hpp
>
13
#include <
wren/mesh.hpp
>
14
#include <
wren/scene/components/mesh.hpp
>
15
#include <
wren/scene/deserialization.hpp
>
16
#include <
wren/scene/scene.hpp
>
17
#include <
wren/scene/serialization.hpp
>
18
#include <
wren/utils/result.hpp
>
19
20
#include "
camera.hpp
"
21
#include "
context.hpp
"
22
#include "
ui.hpp
"
23
24
namespace
editor
{
25
26
class
Editor
{
27
public
:
28
static
auto
create
(
const
std::shared_ptr<wren::Application>& app,
29
const
std::filesystem::path& project_path)
30
->
wren::expected<std::shared_ptr<Editor>
>;
31
32
Editor
(
const
std::shared_ptr<wren::Context>& ctx);
33
34
void
on_update
();
35
36
private
:
37
auto
load_scene
() ->
wren::expected<void>
;
38
39
auto
build_render_graph
(
const
std::shared_ptr<wren::Context>& ctx)
40
->
wren::expected<wren::GraphBuilder>
;
41
42
// Project
43
Context
editor_context_
;
44
45
// Editor camera
46
Camera
camera_
;
47
48
// Panels
49
std::optional<flecs::entity>
selected_entity_
;
50
51
// Scene management
52
std::shared_ptr<wren::scene::Scene>
scene_
;
53
54
std::shared_ptr<wren::Context>
wren_ctx_
;
55
56
std::shared_ptr<wren::vk::Shader>
mesh_shader_
;
57
std::shared_ptr<wren::vk::Shader>
viewer_shader_
;
58
59
// Scene viewer
60
std::vector<VkDescriptorSet>
dset_
{};
61
vk::Sampler
texture_sampler_
;
62
63
std::optional<wren::math::Vec2f>
scene_resized_
;
64
wren::math::Vec2f
last_scene_size_
;
65
};
66
67
}
// namespace editor
application.hpp
editor::Camera
Definition
camera.hpp:9
editor::Editor::Editor
Editor(const std::shared_ptr< wren::Context > &ctx)
Definition
editor.cpp:75
editor::Editor::wren_ctx_
std::shared_ptr< wren::Context > wren_ctx_
Definition
editor.hpp:54
editor::Editor::viewer_shader_
std::shared_ptr< wren::vk::Shader > viewer_shader_
Definition
editor.hpp:57
editor::Editor::load_scene
auto load_scene() -> wren::expected< void >
Definition
editor.cpp:200
editor::Editor::last_scene_size_
wren::math::Vec2f last_scene_size_
Definition
editor.hpp:64
editor::Editor::mesh_shader_
std::shared_ptr< wren::vk::Shader > mesh_shader_
Definition
editor.hpp:56
editor::Editor::on_update
void on_update()
Definition
editor.cpp:80
editor::Editor::texture_sampler_
vk::Sampler texture_sampler_
Definition
editor.hpp:61
editor::Editor::camera_
Camera camera_
Definition
editor.hpp:46
editor::Editor::editor_context_
Context editor_context_
Definition
editor.hpp:43
editor::Editor::create
static auto create(const std::shared_ptr< wren::Application > &app, const std::filesystem::path &project_path) -> wren::expected< std::shared_ptr< Editor > >
Definition
editor.cpp:12
editor::Editor::scene_resized_
std::optional< wren::math::Vec2f > scene_resized_
Definition
editor.hpp:63
editor::Editor::dset_
std::vector< VkDescriptorSet > dset_
Definition
editor.hpp:60
editor::Editor::scene_
std::shared_ptr< wren::scene::Scene > scene_
Definition
editor.hpp:52
editor::Editor::build_render_graph
auto build_render_graph(const std::shared_ptr< wren::Context > &ctx) -> wren::expected< wren::GraphBuilder >
Definition
editor.cpp:214
editor::Editor::selected_entity_
std::optional< flecs::entity > selected_entity_
Definition
editor.hpp:49
deserialization.hpp
camera.hpp
context.hpp
ui.hpp
mesh.hpp
editor
Definition
camera.hpp:8
wren::expected
std::expected< T, Err > expected
Definition
result.hpp:43
mesh.hpp
scene.hpp
serialization.hpp
editor::Context
Definition
context.hpp:8
wren::math::Vec2f
Definition
vector.hpp:161
vector.hpp
result.hpp
editor
src
editor.hpp
Generated by
1.17.0