We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 4168

Summary: Sharing resources via wglShareLists (i.e. SDL_GL_ShareLists)
Product: SDL Reporter: Charles Van Noland <radioteeth>
Component: videoAssignee: Sam Lantinga <slouken>
Status: NEW --- QA Contact: Sam Lantinga <slouken>
Severity: enhancement    
Priority: P2 CC: amaranth72
Version: 2.0.8   
Hardware: All   
OS: Windows (All)   

Description Charles Van Noland 2018-05-13 17:23:14 UTC
With the existing functionality added that separated out the window handling from the GL rendering contexts it would be nice to be able to apply that to multithreaded resource generation (i.e. generating mesh vertex buffers, textures, etc) but this requires that a 2ndary rendering context interacted with by worker threads be able to generate resources and upload them to the GPU for the rendering context on the main thread to use for rendering. By default OpenGL does not share resources across rendering contexts within a program, this must be accomplished via wglShareLists (on Windoze systems) and there's nothing in SDL currently wrapping it, so users are forced to include OS-specific code in their SDL program in order to share GL resources between contexts.
Comment 1 Alex Szpakowski 2018-11-11 01:27:23 UTC
Does SDL_GL_SetAttribute(SDL_GL_SHARE_WITH_CURRENT_CONTEXT, 1) work for you when creating the second context?