Drop Host_GetRenderSurface and pass display to backend

This commit is contained in:
Stenzek
2018-10-03 23:03:13 +10:00
parent 134d967be2
commit a3961750a7
35 changed files with 129 additions and 124 deletions

View File

@ -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");