Trouble with OpenGL & SDL on Linux

I’ve been trying to demonstrate some cross platform programming with a
vertex shader demo thing using SDL and OpenGL. It works fine on Windows,
but has only a blank window on Linux. The same happens with the OpenGL
demo in the SDL docs. I’ve tried on two Linux systems, Redhat 8 and 9.
Both can run Tux Racer and BZFlag, so it seems OpenGL works.

I’d appreciate any hints that anyone might have to help send me in the
right direction to fix the problem.

BTW: I had to modify the SDL 1.2.7 source to get it to link with anything
on Windows using MS VC++ v7. Some wackyness with main() resulted in
undefined symbols. I did not use the modified SDL source on Linux.

Have fun!–
Jeff Jackowski
http://ro.com/~jeffj/

hi!

Jeff Jackowski wrote:

I’ve been trying to demonstrate some cross platform programming with a
vertex shader demo thing using SDL and OpenGL. It works fine on Windows,
but has only a blank window on Linux.

i had the same problem, i coulnd’t post to newsgroups, but i managed to
solve it myself - i was using sample code from documentation (sdl and
openg chapter) and under linux (slack9.1) it was working fine but on
solaris i saw only a black window.
the best solution for this is to look at http://nehe.gamedev.net and
load “linux+sdl” sample code for some lesson (5 for example) - this
works fine for me on solaris and linux. you have to catch the difference
in intialisation i suppose…
also you must watch for “if(isActive)” statement at the end of main loop

  • this will force you to drag cursor on the window to make program
    working. with this statement you wont get your program working via “ssh
    -X” console…

i think that in official documenation there should be clear examples,
with no errors, working on every sdl-friendly-platform, on how to
initialise the library, compile sdl program and make it working.

greetz!
CeDeROM

I had this happen to me and the problem was really
weird.

It ended up that I had some old mesa symlinks which
didn’t get removed when mesa did, and didn’t get
updated when I installed the nvidia DRI drivers. The
GLX demos worked fine (such as glxgear) but none of my
SDL+GL programs did. I fixed the problem by updating
the old symlinks to the new nvidia path.

Oddly, even though the symlinks were to nonexistant
libraries, the program still ran, just with a black
screen.

They were in some weird directory too… a few weird
directories no less.

My suggestion: as root:
updatedb (may take awhile)
locate libgl.so (possibly write to a file)

This occured on RH9, FYI.

And the whole thing on the MS VC++ 7… ew… yeah,
their compiler is whacky like that.

Hope this is the same problem you experienced and that
it fixes the problem for you :-).

-Mike

— Jeff Jackowski wrote:> I’ve been trying to demonstrate some cross platform

programming with a
vertex shader demo thing using SDL and OpenGL. It
works fine on Windows,
but has only a blank window on Linux. The same
happens with the OpenGL
demo in the SDL docs. I’ve tried on two Linux
systems, Redhat 8 and 9.
Both can run Tux Racer and BZFlag, so it seems
OpenGL works.

I’d appreciate any hints that anyone might have to
help send me in the
right direction to fix the problem.

BTW: I had to modify the SDL 1.2.7 source to get it
to link with anything
on Windows using MS VC++ v7. Some wackyness with
main() resulted in
undefined symbols. I did not use the modified SDL
source on Linux.

Have fun!


Jeff Jackowski
http://ro.com/~jeffj/


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway
http://promotions.yahoo.com/design_giveaway/

hi!

Jeff Jackowski wrote:

I’ve been trying to demonstrate some cross platform programming with a
vertex shader demo thing using SDL and OpenGL. It works fine on Windows,
but has only a blank window on Linux.

i had the same problem, i coulnd’t post to newsgroups, but i managed to
solve it myself - i was using sample code from documentation (sdl and
openg chapter) and under linux (slack9.1) it was working fine but on
solaris i saw only a black window.
the best solution for this is to look at http://nehe.gamedev.net and
load “linux+sdl” sample code for some lesson (5 for example) - this
works fine for me on solaris and linux. you have to catch the difference
in intialisation i suppose…

Thanks for the help! It took me a while to track down the problem, mostly
because of a lack of time. I wasn’t linking in the GL and GLU libraries.
It didn’t occur to me that the program might compile and run without the
OpenGL functionality being included. Yet with a blank window it did
consume a good amount of CPU time.

Now I’ve got an image. Next I’ll have to get textures working.

i think that in official documenation there should be clear examples,
with no errors, working on every sdl-friendly-platform, on how to
initialise the library, compile sdl program and make it working.

The example I tried didn’t come with a makefile. That would have helped.

Have fun!On Sun, 4 Apr 2004, CeDeROM wrote:


Jeff Jackowski
http://ro.com/~jeffj/