Skip to content

t/sdl_test: Adapt to Windows

The SDL documentation states that the SDL event pump "should only be run in the thread that initialized the video subsystem" (https://wiki.libsdl.org/SDL2/SDL_PumpEvents). On Windows it is even mandatory, due to the use of GetMessage() which only retrieves messages from the window belonging to the current thread.

Currently, in sdl_test, the SDL window is opened by a first thread during the creation of the XRT instance, and SDL_PollEvents() is called in the thread running the compositor.

This patch defers the creation of the SDL window, of the OpenGL context, and of the OpenGL textures, and call them during the execution of the compositor.

Merge request reports