summaryrefslogtreecommitdiff
path: root/src/demo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/demo.cpp')
-rw-r--r--src/demo.cpp28
1 files changed, 4 insertions, 24 deletions
diff --git a/src/demo.cpp b/src/demo.cpp
index 64d75a7..279e59d 100644
--- a/src/demo.cpp
+++ b/src/demo.cpp
@@ -112,28 +112,6 @@ int demo(const fud::String& m_filename)
bool ret = LoadTextureFromFile(m_filename, &my_image_texture, &my_image_width, &my_image_height);
IM_ASSERT(ret);
- // Load Fonts
- // - If no fonts are loaded, dear imgui will use the default font. You can also load multiple fonts and use
- // ImGui::PushFont()/PopFont() to select them.
- // - AddFontFromFileTTF() will return the ImFont* so you can store it if you need to select the font among multiple.
- // - If the file cannot be loaded, the function will return a nullptr. Please handle those errors in your
- // application (e.g. use an assertion, or display an error and quit).
- // - The fonts will be rasterized at a given size (w/ oversampling) and stored into a texture when calling
- // ImFontAtlas::Build()/GetTexDataAsXXXX(), which ImGui_ImplXXXX_NewFrame below will call.
- // - Use '#define IMGUI_ENABLE_FREETYPE' in your imconfig file to use Freetype for higher quality font rendering.
- // - Read 'docs/FONTS.md' for more instructions and details.
- // - Remember that in C/C++ if you want to include a backslash \ in a string literal you need to write a double
- // backslash \\ !
- // - Our Emscripten build process allows embedding fonts to be accessible at runtime from the "fonts/" folder. See
- // Makefile.emscripten for details.
- // io.Fonts->AddFontDefault();
- // io.Fonts->AddFontFromFileTTF("c:\\Windows\\Fonts\\segoeui.ttf", 18.0f);
- // io.Fonts->AddFontFromFileTTF("../../misc/fonts/DroidSans.ttf", 16.0f);
- // io.Fonts->AddFontFromFileTTF("../../misc/fonts/Roboto-Medium.ttf", 16.0f);
- // io.Fonts->AddFontFromFileTTF("../../misc/fonts/Cousine-Regular.ttf", 15.0f);
- // ImFont* font = io.Fonts->AddFontFromFileTTF("c:\\Windows\\Fonts\\ArialUni.ttf", 18.0f, nullptr,
- // io.Fonts->GetGlyphRangesJapanese()); IM_ASSERT(font != nullptr);
-
// Our state
bool show_demo_window = true;
bool show_another_window = false;
@@ -155,11 +133,13 @@ int demo(const fud::String& m_filename)
SDL_Event event;
while (SDL_PollEvent(&event)) {
ImGui_ImplSDL2_ProcessEvent(&event);
- if (event.type == SDL_QUIT)
+ if (event.type == SDL_QUIT) {
done = true;
+ }
if (event.type == SDL_WINDOWEVENT && event.window.event == SDL_WINDOWEVENT_CLOSE &&
- event.window.windowID == SDL_GetWindowID(mainWindow.window()))
+ event.window.windowID == SDL_GetWindowID(mainWindow.window())) {
done = true;
+ }
}
if (SDL_GetWindowFlags(mainWindow.window()) & SDL_WINDOW_MINIMIZED) {
SDL_Delay(10);