Skip to content

Commit

Permalink
Re-enable editor (but now only the console shows up??)
Browse files Browse the repository at this point in the history
  • Loading branch information
xezno committed Dec 23, 2024
1 parent f1c8220 commit 1ebc43b
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1047,6 +1047,8 @@ RenderStatus VulkanRenderContext::BeginImGui()
ImGui_ImplVulkan_NewFrame();
ImGui_ImplSDL2_NewFrame( m_window->GetSDLWindow() );

ImGui::NewFrame();

return RENDER_STATUS_OK;
}

Expand Down
17 changes: 15 additions & 2 deletions Source/Mocha.Host/Rendering/rendermanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,12 @@ void SceneMeshPass::RenderMesh( RenderPushConstants constants, Mesh* mesh )
{
}

void EditorPass::Execute()
{
Globals::m_hostManager->Render();
Globals::m_hostManager->DrawEditor();
}

void RenderManager::Render()
{
// Server is headless - don't render
Expand Down Expand Up @@ -261,14 +267,21 @@ void RenderManager::Render()
sceneMeshPass.AddMesh( mesh );
} );

//
// B. Editor pass
//
EditorPass editorPass{};

//
// 2. Execute passes
//
Globals::m_renderContext->BeginRendering();
sceneMeshPass.Execute();
Globals::m_renderContext->EndRendering();

Globals::m_hostManager->Render();
Globals::m_renderContext->BeginImGui();
editorPass.Execute();
Globals::m_renderContext->EndImGui();
Globals::m_renderContext->EndRendering();
}

void RenderPass::Execute()
Expand Down
6 changes: 6 additions & 0 deletions Source/Mocha.Host/Rendering/rendermanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,10 @@ class RenderManager : ISubSystem
void Shutdown();

void Render();
};

class EditorPass : public RenderPass
{
public:
void Execute() override;
};
2 changes: 1 addition & 1 deletion Source/Mocha.Hotload/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ public static void DrawEditor()
{
// Render editor.
SetServerContext( false );
// s_editor.EntryPoint?.FrameUpdate();
s_editor.EntryPoint?.FrameUpdate();
}

/// <summary>
Expand Down

0 comments on commit 1ebc43b

Please sign in to comment.