OpenGL in linux

I’m having a problem in using OpenGL with SDL in
linux. When I call SDL_SetVideoMode with the
SDL_OPENGL flag, SDL_GetError returns “Couldn’t find
matching GLX visual”.

This is probably a stupid error on my part, but I’m
new at this =)

SYSTEM:
I am running Mandrake 8.1 with SDL 1.2.4 on a GeForce
3 Ti 200 with the Nvidia driver.=====
Michael Cowart
Department of Computer Engineering, University of Arkansas
@Michael_Cowart

“Elen sila lumenn’ omentielvo” - a star shines on the hour of our meeting


Do You Yahoo!?
Yahoo! Health - Feel better, live better

I’m having a problem in using OpenGL with SDL in
linux. When I call SDL_SetVideoMode with the
SDL_OPENGL flag, SDL_GetError returns “Couldn’t find
matching GLX visual”.

This is probably a stupid error on my part, but I’m
new at this =)

SYSTEM:
I am running Mandrake 8.1 with SDL 1.2.4 on a GeForce
3 Ti 200 with the Nvidia driver.

if you haven’t already done so, try and download the newest NVidia drivers from their website.

http://www.nvidia.com/view.asp?IO=linux_display_1.0-2880

this is the current driver page and it contains detailed information on setting it up.

if you already have it all set up, though, try looking at appendix C of the README file that came with the NVidia-GLX package (for me it’s at /usr/share/doc/packages/NVIDIA-1.0/README). it might just be that you are missing a symbolic link or something.

hope this helps somewhat

bill

After you load the driver, if you haven’t already, you’ll probably still
get the error - it’s a little bug in the configuration file. Check the
XF86Config or XF86Config-4 (On my RH7.1). In the “Device” section, the
Driver is listed as “nv”. Change that to “nvidia”, restart X and you
should get all sorts of neat 3D stuff. :slight_smile:

Cheers,
Mike

William Robinson wrote:>>I’m having a problem in using OpenGL with SDL in

linux. When I call SDL_SetVideoMode with the
SDL_OPENGL flag, SDL_GetError returns “Couldn’t find
matching GLX visual”.

This is probably a stupid error on my part, but I’m
new at this =)

SYSTEM:
I am running Mandrake 8.1 with SDL 1.2.4 on a GeForce
3 Ti 200 with the Nvidia driver.

if you haven’t already done so, try and download the newest NVidia drivers from their website.

http://www.nvidia.com/view.asp?IO=linux_display_1.0-2880

this is the current driver page and it contains detailed information on setting it up.

if you already have it all set up, though, try looking at appendix C of the README file that came with the NVidia-GLX package (for me it’s at /usr/share/doc/packages/NVIDIA-1.0/README). it might just be that you are missing a symbolic link or something.

hope this helps somewhat

bill


http://dotfile.net/ - Dedicated to Open Source Software

I have the newest nvidia drivers installed, and have
3d hardware acceleration (I’ve tested it with tuxracer
and Jedi Knight II under WINE, it runs faster than it
does in windows =)

I don’t think it’s a symlink problem, because I took
the roaddemo demo off of the SDL demo page, compiled
it, and it started up just fine.

I’m trying to start up a 32 bit video mode, but when I
tried a 16 bit one, I got a segfault.

maybe it’ll help if you see my initialization code -

//heres the code
/gs_ScreenInfo is a structure containing video
information
that was previously set from a config file
/
//trying to set a 32 bit mode
//set opengl junk
if (gS_ScreenInfo.i_ScreenType & SDL_OPENGL)
{
printf (“OpenGL active\n”);
SDL_GL_SetAttribute( SDL_GL_RED_SIZE, 8 );
SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE, 8 );
SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE, 8 );
SDL_GL_SetAttribute (SDL_GL_ALPHA_SIZE, 8 );
SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 32 );
SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 0 );
}

//try to set video mode
if ((gS_ScreenInfo.surf_Screen = SDL_SetVideoMode

(gS_ScreenInfo.i_ScreenWidth,

gS_ScreenInfo.i_ScreenHeight,

gS_ScreenInfo.i_ScreenBPP,

gS_ScreenInfo.i_ScreenType)) == NULL)
{
printf (“Error setting video mode:
%s”,SDL_GetError ());
return FAILURE;
}

This code works without a hitch in windows. Am I
missing something? Do I need to link with anything
other than libGL? I’ve never really messed with
OpenGl, so I don’t know.

Oh well, it’s not critical. I’m writing a general
purpose emulator front end, (it supplies the gui, you
supply the emulator =), and I guess I should get 2d
support working before even considering 3d.

Thanks,=====
Michael Cowart
Department of Computer Engineering, University of Arkansas
@Michael_Cowart

“Elen sila lumenn’ omentielvo” - a star shines on the hour of our meeting


Do You Yahoo!?
Yahoo! Health - Feel better, live better

Hmm…

You sure you want to require 32bpp framebuffer and depth buffer? You sure
you’re running at the right depth? XF86Config file should have
DefaultDepth 24 under Section “Screen” or the above will not work.
Something to check, anyway.

Note, you can probably set all of those to 1 except for SDL_GL_ALPHA_SIZE
(which should be 0) for maximum compatibility. No promise it will not
look like crap if someone tries to use it on crappy hardware, but at least
it’ll run…On Sat, Jul 20, 2002 at 03:36:17PM -0700, Michael Cowart wrote:

    printf ("OpenGL active\n");
    SDL_GL_SetAttribute( SDL_GL_RED_SIZE, 8 );
    SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE, 8 );
    SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE, 8 );
    SDL_GL_SetAttribute (SDL_GL_ALPHA_SIZE, 8 );
    SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 32 );
    SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 0 );


Joseph Carter What’re you looking at?

Ben: Do you solumly swear to read you debian email once a day and
do not permit people to think you are MIA?
Culus: i do so swear

-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 273 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20020720/5f458cd0/attachment.pgp

Ok, I tried setting all of those attributes to 1
(except GL_ALPHA), but now it segfaults every time, no
matter the resolution.

I’ll play with it some more later, I’m going to start
work on the 2d stuff right now.

— Joseph Carter wrote:> On Sat, Jul 20, 2002 at 03:36:17PM -0700, Michael Cowart wrote:

    printf ("OpenGL active\n");
    SDL_GL_SetAttribute( SDL_GL_RED_SIZE, 8 );
    SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE, 8

);

    SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE, 8

);

    SDL_GL_SetAttribute (SDL_GL_ALPHA_SIZE, 8

);

    SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 32

);

    SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER,

0 );

Hmm…

You sure you want to require 32bpp framebuffer and
depth buffer? You sure
you’re running at the right depth? XF86Config file
should have
DefaultDepth 24 under Section “Screen” or the above
will not work.
Something to check, anyway.

Note, you can probably set all of those to 1 except
for SDL_GL_ALPHA_SIZE
(which should be 0) for maximum compatibility. No
promise it will not
look like crap if someone tries to use it on crappy
hardware, but at least
it’ll run…


Joseph Carter
What’re you looking at?

Ben: Do you solumly swear to read you debian
email once a day and
do not permit people to think you are MIA?
Culus: i do so swear

ATTACHMENT part 2 application/pgp-signature

=====
Michael Cowart
Department of Computer Engineering, University of Arkansas
@Michael_Cowart

“Elen sila lumenn’ omentielvo” - a star shines on the hour of our meeting


Do You Yahoo!?
Yahoo! Health - Feel better, live better

How about just not setting them. Always works for me.

Just out of curiosity, why would then need to be set on *nix? I can
understand how they would fit in to the pixleformat process under widows.
But the depth can’t be changed on *nix, so it’s it best just to take
what’s there?

try running glxinfo to have the system clue you into
what gl video modes it will support. in the color bits-
per-pixel options if you specify something higher than your
system supports you will get the “Could’t initialize GLX
visual” error (or whatever the text for it is). something
else to keep in mind is that gl depth is something
very different from X depth (X depth equates to GL buffer
size).On Sun, 2002-07-21 at 00:06, Michael Cowart wrote:

Ok, I tried setting all of those attributes to 1
(except GL_ALPHA), but now it segfaults every time, no
matter the resolution.


Jacob L E Blain Christen
Entheal LLC
443.255.9975