SDL1.3, OpenGL /w multi-window & texture sharing problem

Hi, Yesterday I added support for blender3d to use SDL.
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38332

But I have run into a problem with multiple windows and multiple
OpenGL contexts.
There is no way to have multiple OpenGL windows share textures, this
is really important because in our case - text and icons wont show up
in the second window.

This is possible to do - see OpenGL FAQ and replies on stack-overflow.
http://www.opengl.org/resources/faq/technical/texture.htm
http://stackoverflow.com/questions/232271/opengl-textures-with-multiple-display-contexts

For X11, I compared our own code with SDL to check on how to fix,
With the latest checkout of SDL1.3 and currently there is no way to
set the 3rd argument to glXCreateContext.
m_context = glXCreateContext(m_display, m_visual, s_firstContext, True);

So I’d suggest an argument be added to SDL_GL_CreateContext, eg:
SDL_GL_CreateContext(window, gl_share_context)

From looking into osx, x11 and windows api’s it should be possible to
get this working on all of them.
If this is deemed acceptable I can look into writing this as a patch.

To give some background on the topic if other devs are interested.
So far blender uses its own library for handling windowing in each OS
called ‘GHOST’ which was originally written as a replacement for GLUT

  • X11/Windows/Cocoa/Carbon, this is not so bad because all it really
    needs to do is events and setup an OpenGL context.
    However it does make it harder to support other OS’s.–
  • Campbell

I would certainly find the ability to share textures between two different GL windows useful.? I vote yes.
Anyone else have any thoughts on this?________________________________
From: ideasman42@gmail.com (Campbell Barton)
Subject: [SDL] SDL1.3, OpenGL /w multi-window & texture sharing problem.

Hi, Yesterday I added support for blender3d to use SDL.
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38332

But I have run into a problem with multiple windows and multiple
OpenGL contexts.
There is no way to have multiple OpenGL windows share textures, this
is really important because in our case - text and icons wont show up
in the second window.

This is possible to do - see OpenGL FAQ and replies on stack-overflow.
? http://www.opengl.org/resources/faq/technical/texture.htm
? http://stackoverflow.com/questions/232271/opengl-textures-with-multiple-display-contexts

For X11, I compared our own code with SDL to check on how to fix,
With the latest checkout of SDL1.3 and currently there is no way to
set the 3rd argument to glXCreateContext.
m_context = glXCreateContext(m_display, m_visual, s_firstContext, True);

So I’d suggest an argument be added to SDL_GL_CreateContext, eg:
? SDL_GL_CreateContext(window, gl_share_context)

From looking into osx, x11 and windows api’s it should be possible to
get this working on all of them.
If this is deemed acceptable I can look into writing this as a patch.

To give some background on the topic if other devs are interested.
So far blender uses its own library for handling windowing in each OS
called ‘GHOST’ which was originally written as a replacement for GLUT

  • X11/Windows/Cocoa/Carbon, this is not so bad because all it really
    needs to do is events and setup an OpenGL context.
    However it does make it harder to support other OS’s.

  • Campbell

SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

where do i have to sign?
I remeber trying out the multiple windows multiple textures on
multiple displays in an older sdl revision and it was beautiful but
then was ultimately removed by a (then) recent commit.
I would love to be able to exploit that feature again!
VittorioOn Wed, Jul 13, 2011 at 3:27 AM, Mason Wheeler wrote:

I would certainly find the ability to share textures between two different
GL windows useful.? I vote yes.
Anyone else have any thoughts on this?


From: Campbell Barton
Subject: [SDL] SDL1.3, OpenGL /w multi-window & texture sharing problem.

Hi, Yesterday I added support for blender3d to use SDL.
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38332

But I have run into a problem with multiple windows and multiple
OpenGL contexts.
There is no way to have multiple OpenGL windows share textures, this
is really important because in our case - text and icons wont show up
in the second window.

This is possible to do - see OpenGL FAQ and replies on stack-overflow.
? http://www.opengl.org/resources/faq/technical/texture.htm

http://stackoverflow.com/questions/232271/opengl-textures-with-multiple-display-contexts

For X11, I compared our own code with SDL to check on how to fix,
With the latest checkout of SDL1.3 and currently there is no way to
set the 3rd argument to glXCreateContext.
m_context = glXCreateContext(m_display, m_visual, s_firstContext, True);

So I’d suggest an argument be added to SDL_GL_CreateContext, eg:
? SDL_GL_CreateContext(window, gl_share_context)

From looking into osx, x11 and windows api’s it should be possible to
get this working on all of them.
If this is deemed acceptable I can look into writing this as a patch.

To give some background on the topic if other devs are interested.
So far blender uses its own library for handling windowing in each OS
called ‘GHOST’ which was originally written as a replacement for GLUT

  • X11/Windows/Cocoa/Carbon, this is not so bad because all it really
    needs to do is events and setup an OpenGL context.
    However it does make it harder to support other OS’s.

  • Campbell

SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org