Working with C and Win32, I would like to know how to implement a secondary OpenGL thread for loading resources(textures and VBOs).
From what I found, this should be
It works!, only if wglShareLists is done by the main thread for all the worker thread. Using message map, pass the reference of rendering context and make the main thread create the rendering context, use wglShareLists by main thread alone. Then call wglMakeCurrent on the worker thread with the rendering context created by main thread. It is imperative that wglShareLists is called before any gl operation is done on the rendering context. This is due to the requirement on parameter hglrc2(the OpenGL rendering context to share display lists with hglrc1), that it should not contain any existing display lists when wglShareLists is called.