diff options
| author | Jasper St. Pierre <jstpierre@mecheye.net> | 2014-08-06 22:11:50 -0400 |
|---|---|---|
| committer | Jasper St. Pierre <jstpierre@mecheye.net> | 2014-08-19 10:05:57 -0400 |
| commit | 0dd7f6f5ea816db6dbaf9d7ed424ddb8a58e0847 (patch) | |
| tree | 1485b45f4e0e2db5ff06c19534a37ef9b8685031 /Source/Core/DolphinWX/MainNoGUI.cpp | |
| parent | 071e175a1d1449e078d2279578dbe9a82dbcba93 (diff) | |
MainNoGUI: Supply a window in Host_GetRenderHandle
Our existing code was relying on the GLX backend to create the GLX
window properly, and for the rest of the code to patch that up, sort
of. If we rely on Host_GetRenderHandle() returning a valid window, we
can do a lot better about this.
Create a simple window inside MainNoGUI to make this happen.
Diffstat (limited to 'Source/Core/DolphinWX/MainNoGUI.cpp')
| -rw-r--r-- | Source/Core/DolphinWX/MainNoGUI.cpp | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/Source/Core/DolphinWX/MainNoGUI.cpp b/Source/Core/DolphinWX/MainNoGUI.cpp index 4f8d98d110..74e9cc00a0 100644 --- a/Source/Core/DolphinWX/MainNoGUI.cpp +++ b/Source/Core/DolphinWX/MainNoGUI.cpp @@ -52,9 +52,10 @@ void Host_Message(int Id) } } +void* windowHandle; void* Host_GetRenderHandle() { - return nullptr; + return windowHandle; } void Host_UpdateTitle(const std::string& title){}; @@ -129,6 +130,7 @@ void Host_ShowVideoConfig(void*, const std::string&, const std::string&) {} class PlatformX11 : public Platform { Display *dpy; + Window win; Cursor blankCursor = None; #if defined(HAVE_XRANDR) && HAVE_XRANDR X11Utils::XRRConfiguration *XRRConfig; @@ -138,12 +140,17 @@ class PlatformX11 : public Platform { XInitThreads(); dpy = XOpenDisplay(NULL); - } - void MainLoop() override - { - Window win = (Window)Core::GetWindowHandle(); + win = XCreateSimpleWindow(dpy, DefaultRootWindow(dpy), + SConfig::GetInstance().m_LocalCoreStartupParameter.iRenderWindowXPos, + SConfig::GetInstance().m_LocalCoreStartupParameter.iRenderWindowYPos, + SConfig::GetInstance().m_LocalCoreStartupParameter.iRenderWindowWidth, + SConfig::GetInstance().m_LocalCoreStartupParameter.iRenderWindowHeight, + 0, 0, BlackPixel(dpy, 0)); XSelectInput(dpy, win, KeyPressMask | FocusChangeMask); + XMapRaised(dpy, win); + XFlush(dpy); + windowHandle = (void *) win; if (SConfig::GetInstance().m_LocalCoreStartupParameter.bDisableScreenSaver) X11Utils::InhibitScreensaver(dpy, win, true); @@ -163,7 +170,10 @@ class PlatformX11 : public Platform XFreePixmap (dpy, Blank); XDefineCursor(dpy, win, blankCursor); } + } + void MainLoop() override + { bool fullscreen = SConfig::GetInstance().m_LocalCoreStartupParameter.bFullscreen; if (fullscreen) |
