OpenGL book reccomendation

Started by
7 comments, last by FILO 16 years, 2 months ago
Hi All, I am considering getting OpenGL Programming for the X Window System but the reviews on amazon and the date it was published seem to indicate that this book is a little out of date. Is this the case and or does anyone have any more current suggestions for linux/OpenGL programming books? Thanks. -H
Advertisement
just try the current version of the Red Book.
"A human being is a part of a whole, called by us,universe, a part limited in time and space. He experiences himself, his thoughts and feelings as something separated from the rest... a kind of optical delusion of his consciousness. This delusion is a kind of prison for us, restricting us to our personal desires and to affection for a few persons nearest to us. Our task must be to free ourselves from this prison by widening our circle of compassion to embrace all living creatures and the whole of nature in its beauty."A. Einstein
Well OpenGL is cross platform, the only thing you might need to learn that is platform specific is the 'glx' family of functions, aside from them you can pick any OpenGL book, I recommend "OpenGL Game Programming" by Dave Astle, it's considered to be the gold standard around here.

I develop on linux actually, and I have NEVER touched glx myself(though I've looked it over), I just let SDL handle it for me, that's the method I personally endorse :-), but again, everything else will be cross platform (and the everything else part is far more important for creating fun and exciting games). Learn OpenGL, use either SDL (my vote), GLut, or glfw to handle initilialization, if you ever feel in the future that you (for whatever reason...) need to use glx directly (trust me, you don't need to, and you don't want to) you can just learn that family of functions.
When General Patton died after World War 2 he went to the gates of Heaven to talk to St. Peter. The first thing he asked is if there were any Marines in heaven. St. Peter told him no, Marines are too rowdy for heaven. He then asked why Patton wanted to know. Patton told him he was sick of the Marines overshadowing the Army because they did more with less and were all hard-core sons of bitches. St. Peter reassured him there were no Marines so Patton went into Heaven. As he was checking out his new home he rounded a corner and saw someone in Marine Dress Blues. He ran back to St. Peter and yelled "You lied to me! There are Marines in heaven!" St. Peter said "Who him? That's just God. He wishes he were a Marine."
Quote:Original post by Ademan555
Well OpenGL is cross platform, the only thing you might need to learn that is platform specific is the 'glx' family of functions, aside from them you can pick any OpenGL book, I recommend "OpenGL Game Programming" by Dave Astle, it's considered to be the gold standard around here.

I develop on linux actually, and I have NEVER touched glx myself(though I've looked it over), I just let SDL handle it for me, that's the method I personally endorse :-), but again, everything else will be cross platform (and the everything else part is far more important for creating fun and exciting games). Learn OpenGL, use either SDL (my vote), GLut, or glfw to handle initilialization, if you ever feel in the future that you (for whatever reason...) need to use glx directly (trust me, you don't need to, and you don't want to) you can just learn that family of functions.


Thanks for all the help guys. I currently own the red book and the blue book both of which are totally amazing books.

I was using SDL but unfortunately a feature I need (outputting opengl in full screen mode from a application across multiple monitors) is only tentatively supported in the very latest version which you need to grab/compile you're self from subversion (1.3).

At the moment I have managed to get dual head OpenGL going with xlib and glx. Xlib is pretty tricky and unintuitive to work with and trying to find out how to do something specific with the docs/examples is a bit of a nightmare. I eventually gave up reading articles and just looked at the source for xterm and pieced things together from that. Hence my feeling that I need a book on working with glx/xlib.

The main reason I don't want to play with sdl 1.3 is:

http://www.gamedev.net/community/forums/topic.asp?topic_id=380142


"SDL 1.3 is the experimental branch of SDL, where we will be breaking
binary compatibility and upgrading the API to fix a few shortcomings and
support new functionality. At one point SDL 1.3 had experimental render
to texture support, but it wasn't possible to maintain the same GL context
semantics on each platform, and it has been phased out in favor of the
OpenGL vertex buffer object extension. The original render to texture
code is in bugzilla as a patch relative to 1.3, for historical interest."

My ideal solution would be something that does dual screen and is cross platform has a decent timer and can handle very basic input.


My current bet is that writing my own wrapper for OSX/LINUX/Windows will probably be less work and easier to debug than dealing with the random stuff thats bound to come up with SDL 1.3. Any comments on this strategy? Anyone care to suggest another library?
Ah, I see, you already knew what you were talking about then :-D.

Anyways, I don't really know what the best way to go about things is. I think you're *probably* right that you've got the best way to go about things (unfortunately). I'm not entirely sure if it's possible to setup "true" dual head support with glx without Xinerama, but I'm not very well versed in Xlib so I'll shutup now :-p.

I didn't really provide any useful information, but I'm going to post anyways, just in case me tossing around the name Xinerama actually turns out to be relevant information lol.
When General Patton died after World War 2 he went to the gates of Heaven to talk to St. Peter. The first thing he asked is if there were any Marines in heaven. St. Peter told him no, Marines are too rowdy for heaven. He then asked why Patton wanted to know. Patton told him he was sick of the Marines overshadowing the Army because they did more with less and were all hard-core sons of bitches. St. Peter reassured him there were no Marines so Patton went into Heaven. As he was checking out his new home he rounded a corner and saw someone in Marine Dress Blues. He ran back to St. Peter and yelled "You lied to me! There are Marines in heaven!" St. Peter said "Who him? That's just God. He wishes he were a Marine."
I dont know about dual screen but GLFW has a very good timer(QueryPerfCounter) and handles input just fine.
The latest "OpenGL SuperBible" 3rd edition I think, is a great book, it covers Linux, Win32, OSX
Thanks guys, its great to get feedback and I really appreciate the sanity (or in the case of xlib insanity ;P ) check .

How I manged to get dual screen going with xlib/glx, was to use grandr under debian to create a 2048X768 virtual screen from my 2 1024x768 lcds. I then created two windows each with their own opengl context (dimensions of each being set to 1024 x 768). I then told x to move one window to 1024 using the xmove macro and then sent a full screen event/message to that window. I then created the other window at 0,0 and told it to fullscreen using the same technique. This seems to work and I can get opengl graphics going across both screns. I am not sure if this is the correct or even a nice way to do things but it's the only way I have found so far. Any suggestions or xlib code snippits would be most appreciated. I am planning on looking at how http://www.pyglet.org/ handles multiple screens cross platform to see if their is a better way to interface/do this with xlib.

Right now everything works fine provided I don't try to pole for events within my main loop. My problem is that trying to capture events using xlib and the next event function causes my application to only update when I move a mouse or press a key. Now I am guessing that this has something to do with the way the callback function for events works in xlib.

I have yet to figure out how glx informs x whenever it swap a buffer. One solution I am considering is creating an expose event (event triggered when one window moves over another in x) every time I need to swap a buffer. Now I don't think an event should be triggered every time a buffer is swapped and I don't think I need to add threads to my application just to pole for a few key presses. Hence I think I am doing something wrong and I should go read a good book or something.

So I guess a question would be, has anyone written any opengl applications which polled for events using glx/xlib. I am currently using the XNextEvent to check for key presses. Also could I use some other library/technique to check for inputs on linux?
Quote:Original post by MARS_999
The latest "OpenGL SuperBible" 3rd edition I think, is a great book, it covers Linux, Win32, OSX



Yeah I have that (the blue book), I started from the example in chapter 21 and modified it to work across 2 screens. Its a brilliant book but the chapter on linux is like 20 pages long and parts of that deal with glut. The main focus on the chapter is GLX; it gives you everything you need to setup a window that displays opengl which reacts to a mouse moving around. It doesn't really cover much of how xlib handles events (this is not really a flaw of the book just a reflection of how complicated xlib is). I am trying to have animated sprites moving on the screen and have xlib poll for events. The example in the book is a set of eyes that point where ever you move the mouse. The eyes only move when the mouse does.

This topic is closed to new replies.

Advertisement