Segment Fault while using OPENGL_BLIT with SDL 1.1.16

Hello.

First of all… SDL is great and I love the idea of it.

Next of it, my little problem. While trying to setup my videomode (Windowed
800x600) on my Windoze mixing it with the OPENGL_BLIT flag; my application
just crashes with a page fault.

Did I missunderstood the idea of the OPENGL_BLIT flag? I wanted to mix my
normal blitt’ed effects with a little OpenGL cube rotating in the
background.

The protection fault:

WARP verursachte einen Fehler durch eine ung?ltige Seite
in Modul SDL.DLL bei 016f:10015e14.
Register:
EAX=0078fcdc CS=016f EIP=10015e14 EFLGS=00010246
EBX=008b0c60 SS=0177 ESP=0078fc18 EBP=0078fcdc
ECX=00000000 DS=0177 ESI=008a0c94 FS=1a1f
EDX=00000000 ES=0177 EDI=008a0c94 GS=0000
Bytes bei CS:EIP:
8b 71 04 66 8b 50 06 0f bf 48 02 03 d1 89 4c 24
Stapelwerte:
008a0c94 8175de4c bff741f7 bffc9490 bff7b84e 00000001 00000001 c1786000
00000000 bff92c68 0078fd2c 79ad3370 10022042 00000058 100179da 008b0ae0

Any ideas how to avoid this problem?

Cheers

Volker

First of all… SDL is great and I love the idea of it.

Next of it, my little problem. While trying to setup my videomode (Windowed
800x600) on my Windoze mixing it with the OPENGL_BLIT flag; my application
just crashes with a page fault.

Did I missunderstood the idea of the OPENGL_BLIT flag? I wanted to mix my
normal blitt’ed effects with a little OpenGL cube rotating in the
background.
Hellllooo!!!
Even while this thing was treated with some kind of ignorance, but I have reported
such error a few days ago for the windows port, too! Maybe it is necessary to take
a look at this, more than making thoughts about how to bend the system for DMA
blits? :wink:
Sorry to be a bit rude, but this bug (I am shure, that IS one) breaks my work heavily…

Thanks in advance,
Andreas Podgurski

Cheers to Bochum from Gelsenkirchen :wink: The Internet makes the world a really
smaller place to be :wink:

However you are absoultly right. This bug should be killed.

Btw. today it also killed my entire OS, with other words the computer
crashed without any real reason. And from what I saw on the newsgroup here,
OpenGL fails complettly on Win2k.

Cheers

Volker> ----- Original Message -----

From: andreas.podgurski@ruhr-uni-bochum.de (Andreas Podgurski)
Newsgroups: loki.open-source.sdl
Sent: Thursday, November 09, 2000 8:15 AM
Subject: Re: Segment Fault while using OPENGL_BLIT with SDL 1.1.16

First of all… SDL is great and I love the idea of it.

Next of it, my little problem. While trying to setup my videomode
(Windowed

800x600) on my Windoze mixing it with the OPENGL_BLIT flag; my
application

just crashes with a page fault.

Did I missunderstood the idea of the OPENGL_BLIT flag? I wanted to mix my
normal blitt’ed effects with a little OpenGL cube rotating in the
background.
Hellllooo!!!
Even while this thing was treated with some kind of ignorance, but I have
reported
such error a few days ago for the windows port, too! Maybe it is necessary
to take
a look at this, more than making thoughts about how to bend the system for
DMA
blits? :wink:
Sorry to be a bit rude, but this bug (I am shure, that IS one) breaks my
work heavily…

Thanks in advance,
Andreas Podgurski

OpenGL with SDL on Win2K under MSVC++ 6 on my 2xCeleron 366+ w/ TNT2ultra
works sweet, you just can’t use the OPENGLBLIT flag, apparently (I haven’t
tried that one yet; does it simply allow you to blit sprites to an OpenGL
surface?).

I just thought I’d share my success story. ( :

Brent

Btw. today it also killed my entire OS, with other words the computer
crashed without any real reason. And from what I saw on the newsgroup
here,> OpenGL fails complettly on Win2k.

OpenGL with SDL on Win2K under MSVC++ 6 on my 2xCeleron 366+ w/ TNT2ultra
works sweet, you just can’t use the OPENGLBLIT flag, apparently (I haven’t
tried that one yet; does it simply allow you to blit sprites to an OpenGL
surface?).

I just thought I’d share my success story. ( :

Great, can you try the SDL_OPENGLBLIT flag? You can test it with testgl
by passing in -logo on the command line.

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

Cheers to Bochum from Gelsenkirchen :wink: The Internet makes the world a really
smaller place to be :wink:

However you are absoultly right. This bug should be killed.

Btw. today it also killed my entire OS, with other words the computer
crashed without any real reason. And from what I saw on the newsgroup here,
OpenGL fails complettly on Win2k.

Wierd, I’ll take a look at it next week.

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

Great, can you try the SDL_OPENGLBLIT flag? You can test it with testgl
by passing in -logo on the command line.

testgl.c with Windows 2000, VisualC++ 6, 2xCeleron at 366+, TNT2Ultra:

Here’s what happens. Without -logo, I can start up f.s. with
the -fullscreen arg, but alt-enter (in other words,
SDL_WM_ToggleFullScreen(screen)) never worked.

I use -logo on the c.l., and I get a logo bouncing around (after I found and
relocated logo.bmp =). However, the combination of fullscreen and logo will
only produce windowed output.

No crashes though!

Anything else you would like me to try? ( :

Brent

PS Is there a fully-working SDL TCP library available? I never got SDL_Net
to work, but it’s been a while since I’ve tried it. And I find Winsock
documentation very, very cryptic…

Another update:

-fullscreen -logo works, but
-logo -fullscreen does not.

Reason: in line 234 of testgl.c, there’s a strcmp(argv[1], “-fullscreen”),
where the 1 should probably be an i, since it’s a for loop on i, and there’s
not a single i in the loop.

I still can’t get alt-enter to work; it’s receiving the message, but I get
"Unable to toggle fullscreen mode" in the output.

  • Brent

Another update:

-fullscreen -logo works, but
-logo -fullscreen does not.

Reason: in line 234 of testgl.c, there’s a strcmp(argv[1], “-fullscreen”),
where the 1 should probably be an i, since it’s a for loop on i, and there’s
not a single i in the loop.

Thanks, I’ll fix that.
It’s good to know that the GL problem isn’t Windows 2000 specific.

For folks who have been having problems, can you give more information
about the version of SDL you are using and your video configuration?

I still can’t get alt-enter to work; it’s receiving the message, but I get
"Unable to toggle fullscreen mode" in the output.

This is expected. The Win32 DirectX driver can’t switch between fullscreen
and windowed mode without changing the surface pointer. The semantics of
the toggle call ensure that the surface pixel data is untouched, and if the
surface doesn’t require locking, that the pixel address doesn’t change.

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

Hi!

Cheers to Bochum from Gelsenkirchen :wink: The Internet makes the world a really
smaller place to be :wink:
A big Cheers back to GE! Yeah, it’s really like travelling the world to gelsenkirchen
(especially, when you’re living at the A43), but the internet makes it so close ;-).

However you are absoultly right. This bug should be killed.
Thanks! :slight_smile:

Btw. today it also killed my entire OS, with other words the computer
crashed without any real reason. And from what I saw on the newsgroup here,
OpenGL fails complettly on Win2k.
Yep, it does. I had the chance to test my application on my parents high end CAD
workstation, running with Win2K and (first) DX7, it had the same effect, it was
impossible to start a application with SDL_OPENGLBLIT set. Strange effect, after
I had installed DX8, my custom MJPEG player displayed every second frame like
flowing away, just like the monitor flow in early times, when it was not configured
correct… Anyone else experienced such? This was only when in fullscreen, windowed
mode worked correct…

Wierd, I’ll take a look at it next week.
Let me know, if I can be any help, because I really need a fix ;-).

Thanks in advance,
Andreas Podgurski

Andreas Podgurski wrote:

Hi!

Cheers to Bochum from Gelsenkirchen :wink: The Internet makes the
world a really
smaller place to be :wink:
A big Cheers back to GE! Yeah, it’s really like travelling the world
to gelsenkirchen
(especially, when you’re living at the A43), but the internet makes
it so close ;-).

Time to found a Ruhrgebiet SDL User Club (The Ruhrgebiet is an area
in the middle of Germany).
Living in Herne.

Sorry being OT,
Georg

Btw. today it also killed my entire OS, with other words the computer
crashed without any real reason. And from what I saw on the newsgroup here,
OpenGL fails complettly on Win2k.
Yep, it does. I had the chance to test my application on my parents high end CAD
workstation, running with Win2K and (first) DX7, it had the same effect, it was
impossible to start a application with SDL_OPENGLBLIT set.

We just had a report of SDL_OPENGLBLIT working on win2k. Can you give more
information about your video card? Does testgl -logo work on that system?

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

Thanks, I’ll fix that.
It’s good to know that the GL problem isn’t Windows 2000 specific.
For folks who have been having problems, can you give more information
about the version of SDL you are using and your video configuration?
I had the following systems to test:
Dual PPro, 200Mhz, FireGL 1000, Windows NT4SP6a and Win2K with DX7
Single CPU 700Mhz Athlon, GeForce256 and Win2K with DX7 and DX8
In all cases SDL 1.1.6 was used as provided on the homepage, on the
second system I had compiled it myself, too. Havn’t had the time to do
debugging so far, I am going to do that this weekend.

Regards,
Andreas Podgurski

Btw. today it also killed my entire OS, with other words the computer
crashed without any real reason. And from what I saw on the newsgroup here,
OpenGL fails complettly on Win2k.
Yep, it does. I had the chance to test my application on my parents high end CAD
workstation, running with Win2K and (first) DX7, it had the same effect, it was
impossible to start a application with SDL_OPENGLBLIT set.
We just had a report of SDL_OPENGLBLIT working on win2k. Can you give more
information about your video card? Does testgl -logo work on that system?
As you said, I have tried the testgl sample and, like a miracle, the system worked after
that. Are there any registry entries you are setting in the SDL code or something else
that could have caused a hang? Its not that cool to command the user of a game to
start the testgl sample first ;-).
So, I had the chance to work around with it a bit, but I did’t liked what I saw. I thought
that I have no hardware accel on my GDI system under NT, but after doing some changes
to the code, it worked with a heavily droped frame rate and an awful color adaption on
my 16Bit screen. I then had a look into the code of SDL and I don’t understand, why you
are treating OpenGL so special. Correct me, if I am wrong, but the MSDN tells me, that you
can render OpenGL directly to any GDI context, so switching off any hardware accel is
not necessary. Shure, there is a limit with doublebuffering, but using you’re own double
buffer and display a single buffered OpenGL to that shouldn’t be a problem. Using DX,
you can gain a DC on every surface, so this shouldn’t be a
problem, too. So, please, tell me why the frame rate drops that hard? Why havn’t you
implemented the SDL_GL_SwapBuffers within SDL_Flip? Why isn’t it possible to render
OpenGL to ANY surface? As far as I am familar with Win32 and OpenGL, this isn’t a
problem, you can even use it easily in the MFC… Why don’t you let the screen surface
configure the OpenGL pixel format description, why do I have to set them manualy?

Thanks in advance for answers,
Andreas Podgurski

As you said, I have tried the testgl sample and, like a miracle, the system worked after
that. Are there any registry entries you are setting in the SDL code or something else
that could have caused a hang? Its not that cool to command the user of a game to
start the testgl sample first ;-).

Very strange. No, SDL isn’t doing any registry work at all.

So, I had the chance to work around with it a bit, but I did’t liked what I saw. I thought
that I have no hardware accel on my GDI system under NT, but after doing some changes
to the code, it worked with a heavily droped frame rate and an awful color adaption on
my 16Bit screen. I then had a look into the code of SDL and I don’t understand, why you
are treating OpenGL so special. Correct me, if I am wrong, but the MSDN tells me, that you
can render OpenGL directly to any GDI context, so switching off any hardware accel is
not necessary. Shure, there is a limit with doublebuffering, but using you’re own double
buffer and display a single buffered OpenGL to that shouldn’t be a problem. Using DX,
you can gain a DC on every surface, so this shouldn’t be a
problem, too. So, please, tell me why the frame rate drops that hard? Why havn’t you
implemented the SDL_GL_SwapBuffers within SDL_Flip? Why isn’t it possible to render
OpenGL to ANY surface? As far as I am familar with Win32 and OpenGL, this isn’t a
problem, you can even use it easily in the MFC… Why don’t you let the screen surface
configure the OpenGL pixel format description, why do I have to set them manualy?

In general answer to your question “why not OpenGL to any surface”, just
because it works on Windows doesn’t mean it will work on any other platform.
In addition, rendering to software surfaces tends to be very slow, as you
have found. You are more likely to want to use a separate tool to generate
3D looking sprites and then loading them in SDL for 2D graphics, than to
really want offscreen OpenGL, for speed reasons.

As you’ve shown, you can always add OpenGL rendering to your app independently
of SDL if you really want that functionality. :slight_smile:

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