Turning on OpenGL later (SDL bug?)

Hi!

The game I’m working on features a set of intro/prefs screens that only
have 2D graphics for which I’ve already written a set of routines (text,
polygons, lines etc.). The in-game display can be rendered with OpenGL.

So, I would like to SDL_SetVideoMode() without SDL_OPENGL first, and then
re-set the mode (which may also have a higher resolution) with SDL_OPENGL
on when the game starts.

The switch itself seems to work (the 2D window is closed and another
window opens), but then the game crashes in the event loop in the call to
SDL_PollEvent(). The gdb stack trace:

#0 0x4037c92d in XPutImage () from /usr/X11R6/lib/libX11.so.6
#1 0x4006557a in X11_RefreshDisplay (this=0x81578b0) at SDL_x11image.c:391
#2 0x40063a28 in X11_DispatchEvent (this=0x81578b0) at SDL_x11events.c:329
#3 0x40063b6d in X11_PumpEvents (this=0x81578b0) at SDL_x11events.c:384
#4 0x4006d948 in SDL_PumpEvents () at SDL_events.c:350
#5 0x4006d990 in SDL_PollEvent (event=0xbffff8b8) at SDL_events.c:369
#6 0x80a5ec2 in main_event_loop () at shell_sdl.cpp:437
#7 0x80a54ac in main (argc=0, argv=0xbffff964) at shell_sdl.cpp:181
#8 0x40273a42 in __libc_start_main () from /lib/libc.so.6

System information: Debian Linux 2.2 on a 500MHz PIII, XFree 3.3.6 with
an ATI XPert at work, SDL 1.1.4.

Bye,
Christian–
/ Coding on PowerPC and proud of it
/ http://www.uni-mainz.de/~bauec002/

#0 0x4037c92d in XPutImage () from /usr/X11R6/lib/libX11.so.6
#1 0x4006557a in X11_RefreshDisplay (this=0x81578b0) at SDL_x11image.c:391
#2 0x40063a28 in X11_DispatchEvent (this=0x81578b0) at SDL_x11events.c:329
#3 0x40063b6d in X11_PumpEvents (this=0x81578b0) at SDL_x11events.c:384
#4 0x4006d948 in SDL_PumpEvents () at SDL_events.c:350
#5 0x4006d990 in SDL_PollEvent (event=0xbffff8b8) at SDL_events.c:369
#6 0x80a5ec2 in main_event_loop () at shell_sdl.cpp:437
#7 0x80a54ac in main (argc=0, argv=0xbffff964) at shell_sdl.cpp:181
#8 0x40273a42 in __libc_start_main () from /lib/libc.so.6

Why is XPutImage called instead of XShmPutImage? Are you running it on a
remote X server?

The game I’m working on features a set of intro/prefs screens that only
have 2D graphics for which I’ve already written a set of routines (text,
polygons, lines etc.). The in-game display can be rendered with OpenGL.

So, I would like to SDL_SetVideoMode() without SDL_OPENGL first, and then
re-set the mode (which may also have a higher resolution) with SDL_OPENGL
on when the game starts.

The switch itself seems to work (the 2D window is closed and another
window opens), but then the game crashes in the event loop in the call to
SDL_PollEvent(). The gdb stack trace:

Try the latest CVS snapshot. I fixed a bug related to this, but I don’t
remember if it made it into SDL 1.1.4.

http://www.libsdl.org/cvs.html

See ya!
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

The question rather is - why does it call XPutImage at all? Should it do
this if you specify SDL_OPENGL???On Wed, Aug 30, 2000 at 10:32:24PM +0200, Mattias Engdeg?rd wrote:

#0 0x4037c92d in XPutImage () from /usr/X11R6/lib/libX11.so.6
#1 0x4006557a in X11_RefreshDisplay (this=0x81578b0) at SDL_x11image.c:391
#2 0x40063a28 in X11_DispatchEvent (this=0x81578b0) at SDL_x11events.c:329
#3 0x40063b6d in X11_PumpEvents (this=0x81578b0) at SDL_x11events.c:384
#4 0x4006d948 in SDL_PumpEvents () at SDL_events.c:350
#5 0x4006d990 in SDL_PollEvent (event=0xbffff8b8) at SDL_events.c:369
#6 0x80a5ec2 in main_event_loop () at shell_sdl.cpp:437
#7 0x80a54ac in main (argc=0, argv=0xbffff964) at shell_sdl.cpp:181
#8 0x40273a42 in __libc_start_main () from /lib/libc.so.6

Why is XPutImage called instead of XShmPutImage? Are you running it on a
remote X server?


Daniel Vogel
Programmer
Loki Entertainment Software

The question rather is - why does it call XPutImage at all? Should it do
this if you specify SDL_OPENGL???

No, it shouldn’t. That was the bug that was fixed.

See ya,
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

Hi!On Wed, 30 Aug 2000, Mattias Engdegard wrote:

Why is XPutImage called instead of XShmPutImage? Are you running it on a
remote X server?

No, locally.

Bye,
Christian


/ Coding on PowerPC and proud of it
/ http://www.uni-mainz.de/~bauec002/