Skip to content

Commit

Permalink
Menu item to enable multi-viewport
Browse files Browse the repository at this point in the history
  • Loading branch information
drhelius committed Jul 30, 2024
1 parent 73d09d1 commit b37544d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
2 changes: 2 additions & 0 deletions platforms/desktop-shared/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ void config_read(void)
config_debug.show_video = read_bool("Debug", "Video", false);
config_debug.show_video_registers = read_bool("Debug", "VideoRegisters", false);
config_debug.font_size = read_int("Debug", "FontSize", 0);
config_debug.multi_viewport = read_bool("Debug", "MultiViewport", false);

config_emulator.fullscreen = read_bool("Emulator", "FullScreen", false);
config_emulator.show_menu = read_bool("Emulator", "ShowMenu", true);
Expand Down Expand Up @@ -327,6 +328,7 @@ void config_write(void)
write_bool("Debug", "Video", config_debug.show_video);
write_bool("Debug", "VideoRegisters", config_debug.show_video_registers);
write_int("Debug", "FontSize", config_debug.font_size);
write_bool("Debug", "MultiViewport", config_debug.multi_viewport);

write_bool("Emulator", "FullScreen", config_emulator.fullscreen);
write_bool("Emulator", "ShowMenu", config_emulator.show_menu);
Expand Down
1 change: 1 addition & 0 deletions platforms/desktop-shared/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ struct config_Debug
bool show_video = false;
bool show_video_registers = true;
int font_size = 0;
bool multi_viewport = false;
};

EXTERN mINI::INIFile* config_ini_file;
Expand Down
16 changes: 12 additions & 4 deletions platforms/desktop-shared/gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,6 @@ void gui_init(void)
io.IniFilename = config_imgui_file_path;
io.FontGlobalScale /= application_display_scale;

#if defined(__APPLE__) || defined(_WIN32)
io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable;
#endif

gui_roboto_font = io.Fonts->AddFontFromMemoryCompressedTTF(RobotoMedium_compressed_data, RobotoMedium_compressed_size, 17.0f * application_display_scale, NULL, io.Fonts->GetGlyphRangesCyrillic());

ImFontConfig font_cfg;
Expand Down Expand Up @@ -899,6 +895,18 @@ static void main_menu(void)

ImGui::Separator();

#if defined(__APPLE__) || defined(_WIN32)
if (ImGui::MenuItem("Multi-Viewport", "", &config_debug.multi_viewport, config_debug.debug))
{
if (config_debug.multi_viewport)
ImGui::GetIO().ConfigFlags &= ~ImGuiConfigFlags_ViewportsEnable;
else
ImGui::GetIO().ConfigFlags |= ImGuiConfigFlags_ViewportsEnable;
}

ImGui::Separator();
#endif

if (ImGui::MenuItem("Load Symbols...", "", (void*)0, config_debug.debug))
{
open_symbols = true;
Expand Down

0 comments on commit b37544d

Please sign in to comment.