minor gfx updates

This commit is contained in:
ManDude
2021-08-14 01:06:16 +01:00
parent 67fe412329
commit af5a9f0951
5 changed files with 35 additions and 32 deletions
+6 -2
View File
@@ -109,6 +109,10 @@ int InitMainDisplay(int width, int height, const char* title, GfxSettings& setti
return 0;
}
void KillMainDisplay() {
KillDisplay(GetMainDisplay());
}
void KillDisplay(std::shared_ptr<GfxDisplay> display) {
// lg::debug("kill display #x{:x}", (uintptr_t)display);
if (!display->is_active()) {
@@ -118,8 +122,8 @@ void KillDisplay(std::shared_ptr<GfxDisplay> display) {
if (GetMainDisplay() == display) {
// killing the main display, kill all children displays too!
for (size_t i = 1; i < g_displays.size(); ++i) {
KillDisplay(g_displays.at(i));
while (g_displays.size() > 1) {
KillDisplay(g_displays.at(1));
}
}