diff --git a/tools/emulator/opengl/tests/emulator_test_renderer/main.cpp b/tools/emulator/opengl/tests/emulator_test_renderer/main.cpp index 525c5eb7e..06abce776 100644 --- a/tools/emulator/opengl/tests/emulator_test_renderer/main.cpp +++ b/tools/emulator/opengl/tests/emulator_test_renderer/main.cpp @@ -23,7 +23,11 @@ static int convert_keysym(int sym); // forward +#ifdef __linux__ +#include +#endif #ifdef _WIN32 + #include int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) #else @@ -45,6 +49,14 @@ int main(int argc, char *argv[]) winHeight = height; } +#ifdef __linux__ + // some OpenGL implementations may call X functions + // it is safer to synchronize all X calls made by all the + // rendering threads. (although the calls we do are locked + // in the FrameBuffer singleton object). + XInitThreads(); +#endif + // // Inialize SDL window //