GLFW: allow multiple instantiation

For now, use reference counting without any synchronization -
glfwInit/Terminate should be called only from main thread, anyway.
This commit is contained in:
Martin Pulec
2022-05-31 15:18:22 +02:00
parent 9ecb13dfb4
commit 03c024309f
4 changed files with 31 additions and 8 deletions

View File

@@ -110,6 +110,9 @@ volatile bool should_exit = false;
volatile int audio_offset; ///< added audio delay in ms (non-negative), can be used to tune AV sync
volatile int video_offset; ///< added video delay in ms (non-negative), can be used to tune AV sync
/// 0->1 - call glfwInit, 1->0 call glfwTerminate; fncs shouls be called from main thr, no need to synchronize
int glfw_init_count;
std::unordered_map<std::string, std::string> commandline_params;
mainloop_t mainloop;