diff --git a/Source/Core/Core/Core.cpp b/Source/Core/Core/Core.cpp index c64eb1e22e..91f1200f73 100644 --- a/Source/Core/Core/Core.cpp +++ b/Source/Core/Core/Core.cpp @@ -214,6 +214,9 @@ bool Init(std::unique_ptr boot, const WindowSystemInfo& wsi) Host_UpdateMainFrame(); // Disable any menus or buttons at boot + // Issue any API calls which must occur on the main thread for the graphics backend. + g_video_backend->PrepareWindow(wsi); + // Start the emu thread s_emu_thread = std::thread(EmuThread, std::move(boot), wsi); return true; diff --git a/Source/Core/VideoCommon/VideoBackendBase.h b/Source/Core/VideoCommon/VideoBackendBase.h index 83a74b0608..d1dada2247 100644 --- a/Source/Core/VideoCommon/VideoBackendBase.h +++ b/Source/Core/VideoCommon/VideoBackendBase.h @@ -43,6 +43,10 @@ public: virtual std::string GetDisplayName() const { return GetName(); } virtual void InitBackendInfo() = 0; + // Prepares a native window for rendering. This is called on the main thread, or the + // thread which owns the window. + virtual void PrepareWindow(const WindowSystemInfo& wsi) {} + void Video_ExitLoop(); void Video_BeginField(u32 xfb_addr, u32 fb_width, u32 fb_stride, u32 fb_height, u64 ticks);