summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinNoGUI/MainNoGUI.cpp
diff options
context:
space:
mode:
authorStenzek <stenzek@gmail.com>2018-10-03 23:03:13 +1000
committerStenzek <stenzek@gmail.com>2018-10-20 21:11:34 +1000
commita3961750a7174be7402fc492367f017d845b8e1f (patch)
tree45f983ab1ef7b87562448e5d93fa97e13925ebdc /Source/Core/DolphinNoGUI/MainNoGUI.cpp
parent134d967be2dd4ba9531abb8ba8494c3ac423ca72 (diff)
Drop Host_GetRenderSurface and pass display to backend
Diffstat (limited to 'Source/Core/DolphinNoGUI/MainNoGUI.cpp')
-rw-r--r--Source/Core/DolphinNoGUI/MainNoGUI.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/Source/Core/DolphinNoGUI/MainNoGUI.cpp b/Source/Core/DolphinNoGUI/MainNoGUI.cpp
index 5097b1b8f9..60c037e005 100644
--- a/Source/Core/DolphinNoGUI/MainNoGUI.cpp
+++ b/Source/Core/DolphinNoGUI/MainNoGUI.cpp
@@ -71,6 +71,9 @@ public:
}
virtual void Shutdown() {}
virtual ~Platform() {}
+
+ virtual void* GetDisplayHandle() { return nullptr; }
+ virtual void* GetWindowHandle() { return nullptr; }
};
static Platform* platform;
@@ -91,12 +94,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 +184,6 @@ class PlatformX11 : public Platform
}
XMapRaised(dpy, win);
XFlush(dpy);
- s_window_handle = (void*)win;
if (SConfig::GetInstance().bDisableScreenSaver)
X11Utils::InhibitScreensaver(win, true);
@@ -354,6 +350,10 @@ class PlatformX11 : public Platform
XCloseDisplay(dpy);
}
+
+ void* GetDisplayHandle() override { return static_cast<void*>(dpy); }
+
+ void* GetWindowHandle() override { return reinterpret_cast<void*>(win); }
};
#endif
@@ -433,6 +433,9 @@ int main(int argc, char* argv[])
DolphinAnalytics::Instance()->ReportDolphinStart("nogui");
+ boot->display_connection = platform->GetDisplayHandle();
+ boot->render_surface = platform->GetWindowHandle();
+
if (!BootManager::BootCore(std::move(boot)))
{
fprintf(stderr, "Could not boot the specified file\n");