[SDL] [SDL1.3 hg] Sharing a SDL_GLContext between two SDL_Windows
interim.descriptor at gmail.com
Sat Dec 18 23:31:02 PST 2010
I'm currently sharing a single SDL_GLContext between two SDL_Windows (one on
each display, the 2nd of which has vsync enabled).
I create a 3rd invisible window, which has dimensions equal to the greater
dimensions of either window, and then call SDL_GL_CreateContext() on its
Each frame, I:
1. Render the 1st window
2. Call SDL_GL_SetSwapInterval(false) disabling vsync
3. Call SDL_GL_SwapWindow()
4. Call SDL_GL_MakeCurrent() for the 2nd window
5. Render the 2nd window
6. Call SDL_GL_SetSwapInterval(true), enabling
7. Call SDL_GL_SwapWindow()
This seems to work pretty well, but I'm wondering if there's a better way to
do what I want to do, or if there are any performance implications I should
be aware of...
The reason I'm sharing a glContext is because I'm writing VJ software the
plays back multiple video simultaneously, so I'd like to only update one set
Has anybody else solved this sort of problem in a way they believe to be
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SDL