OpenGL fubar

Hmm, if you modify testgl.c to run its OpenGL subsystem twice, I get a
lock in XSync(). This is the strack trace:

Program received signal SIGINT, Interrupt.
0x405bac98 in _XFlushInt ()
(gdb) where
#0 0x405bac98 in _XFlushInt ()
#1 0x405bac4b in _XFlush ()
#2 0x405b7d5a in XSync ()
#3 0x401a89aa in XMesaGarbageCollect () at xmesa1.c:2442
#4 0x4026b699 in X11_CreateWindow (this=0x804a6f0, screen=0x804ce90,
w=640,
h=480, flags=2) at SDL_x11video.c:536
#5 0x4026bb03 in X11_SetVideoMode (this=0x804a6f0, current=0x804ce90,
width=640, height=480, bpp=16, flags=2) at SDL_x11video.c:689
#6 0x40267793 in SDL_SetVideoMode (width=640, height=480, bpp=16,
flags=2)
at SDL_video.c:492
#7 0x8048df7 in RunOpenGL (argc=1, argv=0xbffffa74) at testgl2.c:85
#8 0x8049209 in main (argc=1, argv=0xbffffa74) at testgl2.c:209
#9 0x402efcb3 in __libc_start_main (main=0x80491dc , argc=1,
argv=0xbffffa74, init=0x804896c <_init>, fini=0x804923c <_fini>,
rtld_fini=0x4000a350 <_dl_fini>, stack_end=0xbffffa6c)
at …/sysdeps/generic/libc-start.c:78
(gdb)

It’s actually locking in the call to glXCreateContext().

The important thing to note is that between #3 and #4 there is no
X11_GL_CreateWindow() and no glXCreateContext( ), as there should
be. Furthermore, there should also be a Fake_glXCreateContext() call,
because that’s where XMesaGarbageCollect() is called from. Hmm…

I’ve added a call to glXMakeCurrent( GFX_Display, NULL, NULL ) in
X11_VideoQuit(), but that was wishful thinking on my part.

Any thoughts from gurus out there? It looks like we clean up state
pretty well… although I notice we never do anything with the
XVisualInfo* returned from glXChooseVisual(). Are we responsible for
releasing that somehow?

m.–
Programmer "I wrote a song about dental floss,
Loki Entertainment Software but did anyone’s teeth get cleaner?"
http://lokigames.com/~briareos/ - Frank Zappa, re: the PMRC

The important thing to note is that between #3 and #4 there is no
X11_GL_CreateWindow() and no glXCreateContext( ), as there should
be. Furthermore, there should also be a Fake_glXCreateContext() call,
because that’s where XMesaGarbageCollect() is called from. Hmm…

Oh, duh, -fomit-frame-pointer. I just built a debug version we’ll see
what it says…

m.On Thu, Jan 27, 2000 at 09:06:47AM -0800, Michael Vance wrote:


Programmer "I wrote a song about dental floss,
Loki Entertainment Software but did anyone’s teeth get cleaner?"
http://lokigames.com/~briareos/ - Frank Zappa, re: the PMRC

Hmm, if you modify testgl.c to run its OpenGL subsystem twice, I get a
lock in XSync(). This is the strack trace:

Hoo-boy! Sounds like we’re not cleaning up, and this will be something that
hits me. You need to use something like glxReleaseContext() or something, I
don’t remember what it’s called, but there’s a context destroy function. So,
check if you’re in GL mode, kill it, and start again.

Any thoughts from gurus out there? It looks like we clean up state
pretty well… although I notice we never do anything with the
XVisualInfo* returned from glXChooseVisual(). Are we responsible for
releasing that somehow?

I can hack this sometime, or you can if you want to.

m.

Nicholas

Nicholas Vining “While you’re out there struggling
vining at pacificcoast.net with your computer, I’m naked,
icq: 20872003 clueless, and feeling good!”
- Ratbert

----- Original Message -----
From: briareos@lokigames.com (Michael Vance)
To: sdl at lokigames.com
Date: Thursday, January 27, 2000 9:36 AM
Subject: [SDL] OpenGL fubar