ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
nehe.gamedev.net, although his code is for windows there are linux/sdl linux/glx and glut ports that will be of use and all the actual opengl stuff is the same
the opengl api does not provide any windowing or input functions. it relies on functions in the operating system to create a window, set it up and handle input. so there are different api's for this 'house keeping' code. eg the windows platform supplies the wgl functions, the equivelent on X is the glx functions. but these are not easy for the beginner trying to concentrate on the concepts of 3d programming. sdl is an api to handle this sort of thing and comes with both windows & linux versions but ive never got it to work quite right. glut is a simple api that lets you get on with opengl without worrying about windowing and such but doesnt provide a great deal of flexibility.
glu is a library that is built on top of opengl to allow the easy drawing of quadrics and setting up of various matrices. mesa is a software implementation of the opengl api for ppl who dont have supported graphics cards.
so you need to choose an api to use with opengl that will take care of the basic stuff you need to do. for the beginner i suggest glut as it lets you concentrate on the 3d side of stuff while your learning. but by all means try sdl, most people say its great but i cant get it to handle events properly. i wouldnt bother with glx because it will just overcomplicate things while your learning.
if you google for glut tutorial im sure you'll find something about how to set it up, then you can read the nehe tutorials.
The "Red" book, a how to use Opengl book. Not bad at all.
The "Blue" book, details Opengl functions and data structures. Includes Openglu, "graphics library utilities". Really, this is the book.
Both of these can be found as online downloads in a number of formats, but if you want the latest editions, you'll need to buy them. I believe the downloadable versions are for Opengl 1.1 and current Opengl version is 1.3, unless 1.4 has been released. Ha ! A likely scenario. Both of these books have real names too. I'll leave those out though, to create suspense. They are always called the "Red" and "Blue" books so you won't need to know the real names.
I recommend using SDL. The documentation is good, the api is easy to use ... event handling always works for me *shrug* no dramas.
The book "Programming Linux Games" is also a damn good read, written by ex-Loki developers, big on SDL. It is availible for download free as well, if you need it. The official SDL documentation is extremely good too. SDL forums are thin, but I've rarely had need to post problems.
I've had pleasing results using SDL, Opengl (glu - don't need really, but some functions handy) and Openal (for sound).
So anyway, google up those books and download them, then look into SDL if you want to.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.