|
|
|
@ -103,13 +103,16 @@ namespace editor
|
|
|
|
int w, h;
|
|
|
|
int w, h;
|
|
|
|
Core::MainWindow().GetFramebufferSize(&w, &h);
|
|
|
|
Core::MainWindow().GetFramebufferSize(&w, &h);
|
|
|
|
OrthographicCamera main_cam(Vec2f { 0.0f, 0.0f }, Sizef { (float)w, (float)h });
|
|
|
|
OrthographicCamera main_cam(Vec2f { 0.0f, 0.0f }, Sizef { (float)w, (float)h });
|
|
|
|
|
|
|
|
|
|
|
|
Core::GUI().NewFrame();
|
|
|
|
Core::GUI().NewFrame();
|
|
|
|
Core::Graphics().ResetFrameStats();
|
|
|
|
Core::Graphics().ResetFrameStats();
|
|
|
|
Core::Graphics().BeginDraw(&main_cam);
|
|
|
|
Core::Graphics().BeginDraw(&main_cam);
|
|
|
|
|
|
|
|
|
|
|
|
// No non-gui graphics are drawn
|
|
|
|
// No non-gui graphics are drawn
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Core::Graphics().EndDraw(); // Graphics end draw must happen before GUI end frame
|
|
|
|
Core::Graphics().EndDraw(); // Graphics end draw must happen before GUI end frame
|
|
|
|
|
|
|
|
|
|
|
|
OnRender(&Core::Graphics());
|
|
|
|
OnRender(&Core::Graphics());
|
|
|
|
Core::GUI().EndFrame();
|
|
|
|
Core::GUI().EndFrame();
|
|
|
|
Core::MainWindow().SwapBuffers();
|
|
|
|
Core::MainWindow().SwapBuffers();
|
|
|
|
@ -117,6 +120,7 @@ namespace editor
|
|
|
|
|
|
|
|
|
|
|
|
void Editor::OnRender(lunarium::Renderer2D* g)
|
|
|
|
void Editor::OnRender(lunarium::Renderer2D* g)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
DoMainMenu();
|
|
|
|
DoMainMenu();
|
|
|
|
//DoStatusBar();
|
|
|
|
//DoStatusBar();
|
|
|
|
RenderWindow();
|
|
|
|
RenderWindow();
|
|
|
|
@ -170,6 +174,7 @@ namespace editor
|
|
|
|
void Editor::RenderWindow()
|
|
|
|
void Editor::RenderWindow()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ImGuiViewport* Viewport = ImGui::GetWindowViewport();
|
|
|
|
ImGuiViewport* Viewport = ImGui::GetWindowViewport();
|
|
|
|
|
|
|
|
|
|
|
|
ImGui::SetNextWindowPos( Viewport->WorkPos );
|
|
|
|
ImGui::SetNextWindowPos( Viewport->WorkPos );
|
|
|
|
ImGui::SetNextWindowSize( Viewport->WorkSize );
|
|
|
|
ImGui::SetNextWindowSize( Viewport->WorkSize );
|
|
|
|
ImGui::SetNextWindowViewport( Viewport->ID );
|
|
|
|
ImGui::SetNextWindowViewport( Viewport->ID );
|
|
|
|
@ -208,6 +213,7 @@ namespace editor
|
|
|
|
////////////////////////////////////////////////////////////
|
|
|
|
////////////////////////////////////////////////////////////
|
|
|
|
void Editor::DoMainMenu()
|
|
|
|
void Editor::DoMainMenu()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
//throw std::exception("TEST ERROR");
|
|
|
|
ImGui::BeginMainMenuBar();
|
|
|
|
ImGui::BeginMainMenuBar();
|
|
|
|
|
|
|
|
|
|
|
|
// File
|
|
|
|
// File
|
|
|
|
|