Runtime opengl failure

Hi there,
I’m pretty sure it’s just a simple glitch, however I’ve been fighting
with it for a good couple hours and now giving up…

SDL_SetVideoMode() fails to open the window whenever I have
SDL_OPENGL as one of the flags. My program outputs some useful
debbuging information, then verifies it can open the window with
SDL_VideoModeOK(), and then tries to open it with SDL_SetVideoMode(),
and there it fails.

Code is irrelevant to this issue as no modification was done to the
code. Modification was made to the system: I recently reinstalled
slackware linux 11. All this said, I do have the gl libs/headers in
place and the program compiles fine. I have installed the latest nvidia
drivers as well (I even tried rolling back to previous drivers).

Btw, as per the doc, I put the SDL_GL_SetAttribute() before the call
to SDL_SetVideoMode()… but even then, it was working before I
reinstalled! =(

Thanks for any help!
Simon

Here’s what’s the debugging output:

Creating window using OpenGL
Starting SDL… Done!
Starting Graphic system using: x11
Hardware surfaces? No
Is there a window manager available? 1
Are hardware to hardware blits accelerated? 0
Are hardware to hardware colorkey blits accelerated? 0
Are hardware to hardware alpha blits accelerated? 0
Are software to hardware blits accelerated? 0
Are software to hardware colorkey blits accelerated? 0
Are software to hardware alpha blits accelerated? 0
Are color fills accelerated? 0
Total amount of video memory: 0 KB
Bits Per Pixels: 32

GL Vendor Name (null)
GL Version (null)
GL Shading Language Version n/a
GL Renderer Name (null)
OpenGL Extensions (null)–
Trying to open window at: 640x480 @ 32 bpp
Verifying video mode… 32 bits per pixels
Opening window… Could not open window with specified mode.

— Simon <simon.xhz at gmail.com> wrote:

Hardware surfaces? No

Switch on hardware surfaces.

“Duct tape is like the Force. It has a dark side, it has a
light side, and it holds the Universe together.”
-Carl Zwanig__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

Paul Duffy wrote:

— Simon <@Simon3> wrote:

Hardware surfaces? No

Switch on hardware surfaces.

My flag is now: SDL_HWSURFACE | SDL_OPENGL
Though I still get the exact same error. I played a bit with the flags
and either I get the window to open but completely black (without the
opengl content) or that I can’t open the window at all.

Weird!

Thanks for the help,
Simon

— Simon <simon.xhz at gmail.com> wrote:

Paul Duffy wrote:

— Simon <simon.xhz at gmail.com> wrote:

Hardware surfaces? No

Switch on hardware surfaces.

My flag is now: SDL_HWSURFACE | SDL_OPENGL
Though I still get the exact same error. I played a bit with the
flags
and either I get the window to open but completely black (without the

opengl content) or that I can’t open the window at all.

Well, you’re definitely setting the hardware surface and OpenGL flags
correctly because it’s looking for both. Looking at it again, it does
seem that the only thing wrong is the lack of an available SDL surface;
Are you definitely setting the surface pointer with

SDL_Surface *surfacename;

and setting the videomode with

surfacename=SDL_SetVideoMode(X, Y, BPP, flags);

?

“Duct tape is like the Force. It has a dark side, it has a
light side, and it holds the Universe together.”
-Carl Zwanig__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

It more likely has no OpenGL support build into the SDL or as a more
likely reason SDL can’t dynamically load the GL library, because it is
located in some odd place or the nvidia/ati driver can’t be loaded.On Monday 08 January 2007 02:53, Paul Duffy wrote:

— Simon <simon.xhz at gmail.com> wrote:

Paul Duffy wrote:

— Simon <simon.xhz at gmail.com> wrote:

Hardware surfaces? No

Switch on hardware surfaces.

My flag is now: SDL_HWSURFACE | SDL_OPENGL
Though I still get the exact same error. I played a bit with the
flags
and either I get the window to open but completely black (without
the

opengl content) or that I can’t open the window at all.

Well, you’re definitely setting the hardware surface and OpenGL flags
correctly because it’s looking for both. Looking at it again, it does
seem that the only thing wrong is the lack of an available SDL
surface; Are you definitely setting the surface pointer with

SDL_Surface *surfacename;

and setting the videomode with

surfacename=SDL_SetVideoMode(X, Y, BPP, flags);

[…With some code before like setenv, SDL_GL_SetAttributes…]

SDL_Surface *surfacename=SDL_SetVideoMode(X, Y, BPP, flags);

Exactly like that.
And may I stress the point I mentionned earlier, it worked just before I
reinstalled my system (loosing 3d drivers).

Anyway, I looked deeper and decided try and compile a game off SDL’s
list. The game would not compile in the end due to broken declaration,
but the configure gave me this:

checking GL/gl.h usability… no
checking GL/gl.h presence… yes
configure: WARNING: GL/gl.h: present but cannot be compiled
configure: WARNING: GL/gl.h: check for missing prerequisite headers?
configure: WARNING: GL/gl.h: proceeding with the preprocessor’s result
checking for GL/gl.h… yes
checking GL/glu.h usability… no
checking GL/glu.h presence… yes
configure: WARNING: GL/glu.h: present but cannot be compiled
configure: WARNING: GL/glu.h: check for missing prerequisite headers?
configure: WARNING: GL/glu.h: proceeding with the preprocessor’s result
checking for GL/glu.h… yes
checking GL/glut.h usability… no
checking GL/glut.h presence… yes
configure: WARNING: GL/glut.h: present but cannot be compiled
configure: WARNING: GL/glut.h: check for missing prerequisite headers?
configure: WARNING: GL/glut.h: proceeding with the preprocessor’s result
checking for GL/glut.h… yes
checking GL/glx.h usability… no
checking GL/glx.h presence… yes
configure: WARNING: GL/glx.h: present but cannot be compiled
configure: WARNING: GL/glx.h: check for missing prerequisite headers?
configure: WARNING: GL/glx.h: proceeding with the preprocessor’s result
checking for GL/glx.h… yes

It more likely has no OpenGL support build into the SDL or as a more
likely reason SDL can’t dynamically load the GL library, because it is
located in some odd place or the nvidia/ati driver can’t be loaded.

Yup, that’s what I feel too. Looking at some other problems here, I
have a feel it might just be the headers & libs, will try reinstalling
them as well…

Thanks,
Simon

Hardware surfaces? No

Switch on hardware surfaces.

Not needed with SDL_OPENGL. SDL_HWSURFACE is for 2D video modes.

–ryan.

Yup, that’s what I feel too. Looking at some other problems here, I
have a feel it might just be the headers & libs, will try reinstalling
them as well…

config.log will tell you exactly what failed, if it thinks your headers
are broken.

–ryan.

config.log will tell you exactly what failed, if it thinks your headers
are broken.

config.log was very difficult to parse and didn’t seem to provide more
info than the output I gave.

I agree with your idea, now I wonder how I can reinstall my OpenGL
files… I looked at opengl.org and they only have mesagl (which is
nice for software rendering, which is not what I’m looking for). I
looked into my linux distribution and couldn’t find any package… so
I’m left with one choice: drivers for video card. Unfortunately, I
don’t think that’s it as I reinstalled the drivers 10 times now and even
rolled back to previous drivers, etc… all giving the exact same trouble.

So, anybody know where I can go about repairing my headers?

Thanks,
Simon

So, anybody know where I can go about repairing my headers?

What Linux distribution was this? There’s probably a package for it.
Don’t get them from opengl.org.

–ryan.

What Linux distribution was this? There’s probably a package for it.
Don’t get them from opengl.org.

Slackware, just installed v11. Looking in there I can only find a
package for glut… =/

Simon