Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moving out per-lib Window impl from core engine #382

Draft
wants to merge 8 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions Tetragrama/Editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <fmt/format.h>

using namespace Tetragrama::Messengers;
using namespace ZEngine;

namespace Tetragrama
{
Expand Down Expand Up @@ -34,18 +35,21 @@ namespace Tetragrama
title = fmt::format("{0} - Active Scene : {1}", title, s_editor_scene->GetName());
}
m_engine_configuration.WindowConfiguration = {.EnableVsync = true, .Title = title, .RenderingLayerCollection = {m_render_layer}, .OverlayLayerCollection = {m_ui_layer}};

m_window.reset(ZEngine::Window::Create(m_engine_configuration.WindowConfiguration));
}

Editor::~Editor()
{
m_ui_layer.reset();
m_render_layer.reset();
m_window.reset();
ZEngine::Engine::Dispose();
}

void Editor::Initialize()
{
ZEngine::Engine::Initialize(m_engine_configuration);
ZEngine::Engine::Initialize(m_engine_configuration, m_window);

using PairFloat = std::pair<float, float>;
MESSENGER_REGISTER(
Expand Down Expand Up @@ -80,7 +84,7 @@ namespace Tetragrama

void Editor::Run()
{
ZEngine::Engine::Start();
ZEngine::Engine::Run();
}

const EditorConfiguration& Editor::GetCurrentEditorConfiguration()
Expand Down
4 changes: 4 additions & 0 deletions Tetragrama/Editor.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include <Layers/RenderLayer.h>
#include <ZEngine/Engine.h>
#include <ZEngine/Layers/ImguiLayer.h>
#include <ZEngine/Window/CoreWindow.h>
#include <ZEngine/ZEngineDef.h>

namespace Tetragrama::Serializers
Expand Down Expand Up @@ -69,6 +70,9 @@ namespace Tetragrama
static ZEngine::Ref<EditorScene> GetCurrentEditorScene();
static void SetCurrentEditorScene(EditorScene&&);

private:
ZEngine::Ref<ZEngine::Window::CoreWindow> m_window;

private:
static EditorConfiguration s_editor_configuration;
static ZEngine::Ref<EditorScene> s_editor_scene;
Expand Down
Loading