Skip to content

Commit b774e1d

Browse files
committed
Supressed the catch of ESC for debug mode.
1 parent 0df4ef5 commit b774e1d

File tree

2 files changed

+6
-23
lines changed

2 files changed

+6
-23
lines changed

examples/02-scene_simple/main.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
#include <windows.h>
1010
#endif
1111

12-
#include <imgui.h>
13-
1412
#include "frame/common/application.h"
1513
#include "frame/file/file_system.h"
1614
#include "frame/file/image_stb.h"
@@ -51,9 +49,6 @@ try
5149
gui_window->AddWindow(std::make_unique<frame::gui::WindowLogger>("Logger"));
5250
// Set the main window in full.
5351
// gui_window->SetVisible(false);
54-
ImGuiStyle& style = ImGui::GetStyle();
55-
style.Colors[ImGuiCol_PopupBg] = ImVec4(
56-
0.1f, 0.5f, 0.1f, 0.9f); // Dark background with some transparency
5752
gui_window->AddModalWindow(
5853
std::make_unique<ModalInfo>("Info", "This is a test modal window."));
5954
win->GetDevice().AddPlugin(std::move(gui_window));

src/frame/opengl/sdl_opengl_window.cpp

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,18 @@ void SDLOpenGLWindow::Run(std::function<void()> lambda)
9292
}
9393
}
9494
if (skip)
95+
{
9596
continue;
97+
}
9698
if (!RunEvent(event, dt))
9799
{
98100
loop = false;
99101
}
100102
}
101103
if (input_interface_)
104+
{
102105
input_interface_->NextFrame();
103-
106+
}
104107
device_->Display(time.count());
105108

106109
// Draw the Scene not used?
@@ -122,7 +125,9 @@ void SDLOpenGLWindow::Run(std::function<void()> lambda)
122125

123126
// TODO(anirul): Fix me to check which device this is.
124127
if (device_)
128+
{
125129
SDL_GL_SwapWindow(sdl_window_);
130+
}
126131
} while (loop);
127132
}
128133

@@ -140,23 +145,6 @@ bool SDLOpenGLWindow::RunEvent(const SDL_Event& event, const double dt)
140145
{
141146
switch (event.key.keysym.sym)
142147
{
143-
case SDLK_ESCAPE: {
144-
if (has_window_plugin)
145-
{
146-
for (PluginInterface* plugin : device_->GetPluginPtrs())
147-
{
148-
auto* window_plugin =
149-
dynamic_cast<frame::gui::DrawGuiInterface*>(plugin);
150-
if (window_plugin)
151-
{
152-
auto is_visible = window_plugin->IsVisible();
153-
window_plugin->SetVisible(!is_visible);
154-
}
155-
}
156-
return true;
157-
}
158-
return false;
159-
}
160148
case SDLK_PRINTSCREEN:
161149
device_->ScreenShot("ScreenShot.png");
162150
return true;

0 commit comments

Comments
 (0)