Skip to content

Commit b37544d

Browse files
committed
Menu item to enable multi-viewport
1 parent 73d09d1 commit b37544d

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

platforms/desktop-shared/config.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ void config_read(void)
160160
config_debug.show_video = read_bool("Debug", "Video", false);
161161
config_debug.show_video_registers = read_bool("Debug", "VideoRegisters", false);
162162
config_debug.font_size = read_int("Debug", "FontSize", 0);
163+
config_debug.multi_viewport = read_bool("Debug", "MultiViewport", false);
163164

164165
config_emulator.fullscreen = read_bool("Emulator", "FullScreen", false);
165166
config_emulator.show_menu = read_bool("Emulator", "ShowMenu", true);
@@ -327,6 +328,7 @@ void config_write(void)
327328
write_bool("Debug", "Video", config_debug.show_video);
328329
write_bool("Debug", "VideoRegisters", config_debug.show_video_registers);
329330
write_int("Debug", "FontSize", config_debug.font_size);
331+
write_bool("Debug", "MultiViewport", config_debug.multi_viewport);
330332

331333
write_bool("Emulator", "FullScreen", config_emulator.fullscreen);
332334
write_bool("Emulator", "ShowMenu", config_emulator.show_menu);

platforms/desktop-shared/config.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ struct config_Debug
144144
bool show_video = false;
145145
bool show_video_registers = true;
146146
int font_size = 0;
147+
bool multi_viewport = false;
147148
};
148149

149150
EXTERN mINI::INIFile* config_ini_file;

platforms/desktop-shared/gui.cpp

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,6 @@ void gui_init(void)
9797
io.IniFilename = config_imgui_file_path;
9898
io.FontGlobalScale /= application_display_scale;
9999

100-
#if defined(__APPLE__) || defined(_WIN32)
101-
io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable;
102-
#endif
103-
104100
gui_roboto_font = io.Fonts->AddFontFromMemoryCompressedTTF(RobotoMedium_compressed_data, RobotoMedium_compressed_size, 17.0f * application_display_scale, NULL, io.Fonts->GetGlyphRangesCyrillic());
105101

106102
ImFontConfig font_cfg;
@@ -899,6 +895,18 @@ static void main_menu(void)
899895

900896
ImGui::Separator();
901897

898+
#if defined(__APPLE__) || defined(_WIN32)
899+
if (ImGui::MenuItem("Multi-Viewport", "", &config_debug.multi_viewport, config_debug.debug))
900+
{
901+
if (config_debug.multi_viewport)
902+
ImGui::GetIO().ConfigFlags &= ~ImGuiConfigFlags_ViewportsEnable;
903+
else
904+
ImGui::GetIO().ConfigFlags |= ImGuiConfigFlags_ViewportsEnable;
905+
}
906+
907+
ImGui::Separator();
908+
#endif
909+
902910
if (ImGui::MenuItem("Load Symbols...", "", (void*)0, config_debug.debug))
903911
{
904912
open_symbols = true;

0 commit comments

Comments
 (0)