Is there a way to share textures between several contexts? I want to load textures in the background with a “loader” thread while rendering continues in the main rendering thread (rendering without the textures that are not available yet, obviously). Since an OpenGL context cannot be shared by other threads, I tried to create a loader context using the “sharing” feature mentioned in the context creation documentation but this does not seem to work. It doesn’t even work in a single-thread design – textures loaded in one context are not available to the other context. Any working example using either glx or wxwidgets would be most appreciated!
AFAIK context sharing is the best/easiest/most portable way to acomplish this and textures should be shareable among contexts.
I used this in an applicaton several years ago, where a resource loading thread loaded (among other things) textures while the main rendering thread kept rendering, but unfortunately I no longer have access to that source code. However, I can confirm that this works (after a bit of tinkering, especially for shaders).
How do you diagnose that it does not work for you? Do you get a gl error or is the texture blank? Could you post a few source code snippets of how you try to do this?