17#include "../Submodules/imgui/imgui.h"
18#include "../Submodules/imgui/backends/imgui_impl_opengl3.h"
19#include "../Submodules/imgui/backends/imgui_impl_glfw.h"
28#define START_WITH_IMGUI true
30#define START_WITH_IMGUI false
44#pragma region static_functions
66#pragma region overridden_functions
70 return std::make_unique<Editor>(*
this);
73 auto onUpdate(
float dt) ->
void override;
81 auto save(
Stream& stream)
const ->
void override;
85#pragma region Editor_Functions
163#pragma region member_variables
182#pragma region helper_functions
189#pragma region static_variables
196#undef START_WITH_IMGUI
sys::Json Stream
Definition AudioObject.h:20
#define START_WITH_IMGUI
Definition Editor.h:28
The component responsible for facilitating the gameplay.
friend Entity
Definition GameObject.h:84
GameObject(std::string typeName, gobj::Type parentType, gobj::Type type)
constructor for gameobject.
Definition GameObject.cpp:23
Type
Definition System.h:20
@ Editor
Definition System.h:25
System(const std::string &typeName, Type systemType)
Definition System.cpp:75
bool compactEntityView
Whether the Scene Tree should be rendered more compact.
Definition Editor.h:174
auto getSliderRatio() const -> float
Definition Editor.cpp:626
Entity * selectedEntity
The entity currently selected in the Scene Tree.
Definition Editor.h:172
auto PreRender() -> void
Definition Editor.cpp:530
auto shouldShowGui() const -> bool
Definition Editor.h:90
auto drawEntitiesCompact() -> bool
used to determine how much spacing to give entities in the scene view
Definition Editor.cpp:436
auto load(Stream &stream) -> void override
Implementations will load the state of a GameObject from a th::Json Object.
Definition Editor.cpp:564
static auto getEnum() -> Type
function required by all systems
Definition Editor.h:49
auto deselect(Entity *entity) -> void
deselects and entity if it is currently selected.
Definition Editor.cpp:611
auto operator=(Editor &&other) noexcept -> Editor &=default
ImFont * defaultFont
The default font of the Editor.
Definition Editor.h:165
auto drawSceneMenu() -> void
draw the tree of Entities that exist in a scene
Definition Editor.cpp:394
auto isPassingFilter(Entity *entity) -> bool
See if the an Entity is passing the filter and should be drawn in the Scene View Currently unimplemen...
Definition Editor.cpp:619
auto getSelectedEntity() -> Entity *
return selected entity, or nullptr if no entity is selected
Definition Editor.cpp:606
auto isSelected(Entity *entity) -> bool
check whether an entity is currently selected in the editor
Definition Editor.cpp:601
auto select(Entity *selected) -> void
selects an Entity, and shows it's children in the Component view editor
Definition Editor.cpp:596
auto endWindow() -> void override
currently unused, but intended to but was assumed to be necessary for a proper ImGui editor
Definition Editor.h:75
auto clone() const -> std::unique_ptr< GameObject > override
makes a copy a GameObject even if it's held polymorphically
Definition Editor.h:68
~Editor() override
Definition Editor.cpp:488
auto PostRender() -> void
Post render will run all the normal Render() stuff instead of old function to allow for frame bufferi...
Definition Editor.cpp:633
auto operator=(const Editor &other) -> Editor &
Definition Editor.cpp:502
auto save(Stream &stream) const -> void override
Implementations will load the state of a GameObject to a th::Json object.
Definition Editor.cpp:569
auto receiveShowGUIKeyPressed(const Message *message) -> Message
Definition Editor.cpp:577
Editor()
Definition Editor.cpp:441
auto drawSystemMenu() -> void
Draw the window that shows all the systems in the game.
Definition Editor.cpp:371
bool showImGui
Whether the Editor should be shown.
Definition Editor.h:177
auto onRender() -> void override
called every frame after update has been called for every object.
Definition Editor.cpp:560
auto EntityComponentsEditor() -> void
Definition Editor.cpp:516
float sliderRatio
The ratio of the total width a slider should take up.
Definition Editor.h:167
Editor(const Editor &other)=default
ImGuiTextFilter entityFilter
IMGui filter for searching the scene tree. currently unused, as filtering a tree is non-trivial.
Definition Editor.h:170
auto getDefaultFont() -> ImFont *
Definition Editor.h:39
auto onUpdate(float dt) -> void override
called once every frame.
Definition Editor.cpp:539
static auto SceneViewPort() -> void
This is the Window that activates the viewport and renders the framebuffer.
Definition Editor.cpp:657
the type of elements in a basic_json container
Definition GameObject.h:32