Explicitly initialize COM library in main and opengl threads, hopefully fixing filedialog issues.

This commit is contained in:
ts-korhonen
2021-06-17 19:15:35 +03:00
parent a389e2988a
commit ed86f69c85
2 changed files with 11 additions and 0 deletions

View File

@@ -468,6 +468,9 @@ static void __stdcall opengl_debugmsg_callback(GLenum source, GLenum type, GLuin
*/
static void opengl_main(void* param)
{
/* Initialize COM library for this thread before SDL does so. */
CoInitializeEx(NULL, COINIT_MULTITHREADED);
SDL_InitSubSystem(SDL_INIT_VIDEO);
SDL_SetHint(SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH, "1"); /* Is this actually doing anything...? */
@@ -788,6 +791,8 @@ static void opengl_main(void* param)
SDL_DestroyWindow(window);
window = NULL;
CoUninitialize();
}
static void opengl_blit(int x, int y, int y1, int y2, int w, int h)