How is OpenGL related to SDL?

Started by
14 comments, last by badblood909 21 years, 11 months ago
I am sorry for this totally n00b question, but whenever I read something related to OpenGL around the net, SDL was sure to follow, even in the forum FAQ, and thats why I ask my sorry-arse question. Also, is GLUT OpenGL in the same line of say, ANSI C? Meaning that it would work under any platform? In OpenGL.org, I did not find what I should download to be able to run OpenGL programs on my Linux system, and OpenGL books that I saw all come with software for the MACos and Windows, no Linux, is there any book that I missed? All help apreciated, thank you for your time. -It''s all in the blood...
-It's all in the blood...
Advertisement
quote:Original post by badblood909
I am sorry for this totally n00b question, but whenever I read something related to OpenGL around the net, SDL was sure to follow, even in the forum FAQ, and thats why I ask my sorry-arse question.
There is no direct relationship. SDL is available on many different platforms, like OpenGL, and it can be used with OpenGL. That''s it.
quote:Original post by badblood909
Also, is GLUT OpenGL in the same line of say, ANSI C? Meaning that it would work under any platform?
GLUT''s available on most platforms... I believe every platform that OpenGL is available on. It''s primary purpose is to wrap OS-specific code, so that usually, code written using GLUT can be compiled on most platforms with no changes.
quote:Original post by badblood909
In OpenGL.org, I did not find what I should download to be able to run OpenGL programs on my Linux system, and OpenGL books that I saw all come with software for the MACos and Windows, no Linux, is there any book that I missed?
I don''t know what you need to download to use OpenGL on Linux, but I thought that OpenGL.org had some links.

As for books, I know that Linux Game Programming covers some OpenGL. There''s also OpenGL Programming for the X Window System.
To run and compile OpenGL programs under linux all you need is to download both GLX and Kernel drivers for 3D card, all GL-includes will be installed then.
if you have an NVidia chips have a look to :
http://www.nvidia.com/view.asp?PAGE=linux

you can use GLX as window manager, it has the same function than WGL under windows. But SDL or GLUT are more simple to use.

sorry for the double post...

[edited by - hanibal_smith on April 30, 2002 1:26:19 PM]
quote:
There is no direct relationship. SDL is available on many different platforms, like OpenGL, and it can be used with OpenGL. That''s it.


Well, not quite it. SDL has direct support for OpenGL. It''s an extremely easy way to build an OpenGL app.

Which actually raises a question for me about SDL. I like it, it does everything that I need it to do, with a fraction of the complexity of DirectX. The cross-platformness is a nice benefit.

What are the downsides of SDL? Why is it (along with ClanLib and Allegro, neither of which I''ve messed with) considered useful for "beginner" projects, but not for serious work?

Thanks!

Take care,
Bill
quote:
What are the downsides of SDL? Why is it (along with ClanLib and Allegro, neither of which I''ve messed with) considered useful for "beginner" projects, but not for serious work?


Well, for one, SDL wouldn''t be able to acess all the hardware specific, or feature specific, functions that DirectX might be able to handle. Since it is a cross-platform library, every function has to work on ALL platforms, and obviously, not all graphics features are available on all platforms.



"I am governed by none other than the Laws of the Universe."
"I am governed by none other than the Laws of the Universe."
Oh, and for OpenGL on Linux - Mesa3D.

[EDIT] Fixed the link

"I am governed by none other than the Laws of the Universe."

[edited by - i8degrees on April 30, 2002 3:39:56 PM]
"I am governed by none other than the Laws of the Universe."
also, an fyi. sdl uses dx on windows.
I use SDL for my projects for Windows and Linux currently. It simply has everything I need (hope Force Feedback support will come soon).
quote:Original post by badblood909
In OpenGL.org, I did not find what I should download to be able to run OpenGL programs on my Linux system, and OpenGL books that I saw all come with software for the MACos and Windows, no Linux, is there any book that I missed?

All help apreciated, thank you for your time.

-It''s all in the blood...


Even if you had a really old version of Linux, chances are, if you do a locate or find for GLU.h or GLUT.H, you should find them installed somewhere. At least, if you set up your distro for coding(ie: the best setup for any user even those who don''t plan on coding. )

As for books, get any book that talks about OGL and the code should(you might need to tweek it a bit but hey, that''s part of the programming fun... ) compile on Linux.


"And that''s the bottom line cause I said so!"

Cyberdrek
danielc@iquebec.com
Founder
Laval Linux

/(bb|[^b]{2})/ that is the Question -- ThinkGeek.com
Hash Bang Slash bin Slash Bash -- #!/bin/bash
[Cyberdrek | ]
quote:Original post by Hanibal_smith
To run and compile OpenGL programs under linux all you need is to download both GLX and Kernel drivers for 3D card, all GL-includes will be installed then.
if you have an NVidia chips have a look to :
http://www.nvidia.com/view.asp?PAGE=linux

you can use GLX as window manager, it has the same function than WGL under windows. But SDL or GLUT are more simple to use.

sorry for the double post...

[edited by - hanibal_smith on April 30, 2002 1:26:19 PM]


You don''t even need that, it''s mostly the drivers for your card which are incredible by the way, they work wonders. I have''em installed on my Linux box. As for what I was saying, most linux distros already have the libs and includes for OGL.



"And that''s the bottom line cause I said so!"

Cyberdrek
danielc@iquebec.com
Founder
Laval Linux

/(bb|[^b]{2})/ that is the Question -- ThinkGeek.com
Hash Bang Slash bin Slash Bash -- #!/bin/bash
[Cyberdrek | ]

This topic is closed to new replies.

Advertisement