summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinNoGUI/MainNoGUI.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/DolphinNoGUI/MainNoGUI.cpp')
-rw-r--r--Source/Core/DolphinNoGUI/MainNoGUI.cpp33
1 files changed, 14 insertions, 19 deletions
diff --git a/Source/Core/DolphinNoGUI/MainNoGUI.cpp b/Source/Core/DolphinNoGUI/MainNoGUI.cpp
index 5097b1b8f9..6cd71bd353 100644
--- a/Source/Core/DolphinNoGUI/MainNoGUI.cpp
+++ b/Source/Core/DolphinNoGUI/MainNoGUI.cpp
@@ -71,6 +71,10 @@ public:
}
virtual void Shutdown() {}
virtual ~Platform() {}
+
+ virtual WindowSystemType GetWindowSystem() const { return WindowSystemType::Headless; }
+ virtual void* GetDisplayHandle() const { return nullptr; }
+ virtual void* GetWindowHandle() const { return nullptr; }
};
static Platform* platform;
@@ -91,12 +95,6 @@ void Host_Message(HostMessageID id)
updateMainFrameEvent.Set();
}
-static void* s_window_handle = nullptr;
-void* Host_GetRenderHandle()
-{
- return s_window_handle;
-}
-
void Host_UpdateTitle(const std::string& title)
{
platform->SetTitle(title);
@@ -187,7 +185,6 @@ class PlatformX11 : public Platform
}
XMapRaised(dpy, win);
XFlush(dpy);
- s_window_handle = (void*)win;
if (SConfig::GetInstance().bDisableScreenSaver)
X11Utils::InhibitScreensaver(win, true);
@@ -213,9 +210,6 @@ class PlatformX11 : public Platform
void MainLoop() override
{
bool fullscreen = SConfig::GetInstance().bFullscreen;
- int last_window_width = SConfig::GetInstance().iRenderWindowWidth;
- int last_window_height = SConfig::GetInstance().iRenderWindowHeight;
-
if (fullscreen)
{
rendererIsFullscreen = X11Utils::ToggleFullscreen(dpy, win);
@@ -315,14 +309,8 @@ class PlatformX11 : public Platform
break;
case ConfigureNotify:
{
- if (last_window_width != event.xconfigure.width ||
- last_window_height != event.xconfigure.height)
- {
- last_window_width = event.xconfigure.width;
- last_window_height = event.xconfigure.height;
- if (g_renderer)
- g_renderer->ResizeSurface(last_window_width, last_window_height);
- }
+ if (g_renderer)
+ g_renderer->ResizeSurface();
}
break;
}
@@ -354,6 +342,10 @@ class PlatformX11 : public Platform
XCloseDisplay(dpy);
}
+
+ WindowSystemType GetWindowSystem() const override { return WindowSystemType::X11; }
+ void* GetDisplayHandle() const override { return static_cast<void*>(dpy); }
+ void* GetWindowHandle() const override { return reinterpret_cast<void*>(win); }
};
#endif
@@ -433,7 +425,10 @@ int main(int argc, char* argv[])
DolphinAnalytics::Instance()->ReportDolphinStart("nogui");
- if (!BootManager::BootCore(std::move(boot)))
+ WindowSystemInfo wsi(platform->GetWindowSystem(), platform->GetDisplayHandle(),
+ platform->GetWindowHandle());
+
+ if (!BootManager::BootCore(std::move(boot), wsi))
{
fprintf(stderr, "Could not boot the specified file\n");
return 1;