Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm sure there are already a bunch of questions like this asked, but the constant updating of the OpenGL library throws them all away, and in a month or two, the answers here will be worthless again.

I am ready to start programming in OpenGL using C++. I've got a working compiler (DevCpp; do NOT ask me to switch to VC++, and don't ask me why). Now I'm just looking for a solid tutorial on how to program with OpenGL. My assistant found the tutorial provided by NeHe Productions, but as I've come to find out, it's WAY OUT OF DATE! (although I did pull together a basic window to support an OpenGL canvas)

Then I went online, and found the OpenGL SuperBible, which apparently uses freeglut? But what I'd like to know is whether or not SuperBible 5th edition is up to date any longer. The suggestion to freeglut I found said the latest version was 2.6.0 but now it's 2.8.0!

  • Is the OpenGL SuperBible still a good, and fairly up-to-date place to start?
  • Is there a better place to go to learn OpenGL?
  • Am I allowed to simply store freeglut in the DevCpp include directory (maybe in GL), or is there some important procedure?
  • Are there any comments or suggestions that I didn't think to ask since I'm only just beginning?

@dreta cleared some things up for me, so now I have a better idea of what to ask:

I think I'd like to start out with OpenGL using a wrapper library instead of directly accessing OpenGL.
I just think that, for a beginner, it would be easier for me to program and get good results, while I don't yet have to understand all the grimy details (as @stephelton mentioned).

The problem is, I can't find any library that doesn't have undefined references to no longer supported functions. Freeglut sounds operational, but it still uses GLU.
Does anyone know what I can do?
Also, I tried compiling the first SuperBible's source, but I got errors since GLAPI is not being defined as a type, the error originating in the GLU library.

I'd like to use the SuperBible, but I don't know how to fix this.

share|improve this question
    
You should switch to GCC. –  stephelton May 9 '12 at 0:38
    
DevCpp is just an IDE; which runs GCC (mingw to be specific). But since it was mentioned, Eclipse CDT would be preferable, as it hasn't been abandonware for the past 10 years. –  Casper Von B May 9 '12 at 1:03
4  
@Casper The inheritor of the DevCpp legacy was Code::Blocks and is still updated regularly. –  Alex Shepard May 9 '12 at 1:20
1  
If you want a wrapper library around OpenGL, I suggest you try SFML. SFML provides the usual stuff like window creation, timers, etc. while also allowing you to draw text and simple shapes. You can drop drown to using "raw" OpenGL whenever you want to, mixing SFML functions and raw API calls. –  Oskar N. May 9 '12 at 19:01
1  
You can't "close" a question by adding "{CLOSED}" to the title. Questions will be closed by moderators or if enough users voted to close the question. I'll rolled your edits back.. the "CLOSED" will automatically be appended to your title if moderators decide to close it.. –  bummzack May 12 '12 at 12:57
add comment

3 Answers

up vote 17 down vote accepted

Our resident Nicol Bolas maintains an on-line book about modern graphics programming. It uses modern OpenGL, everything is introduced at an easy to consume pace, it's a good place to start. I've been using it to learn modern OpenGL and it's been doing me wonders in the past 2 months.

Beside that there are bits of knowledge here and there. The OpenGL wiki is quite well maintained. The code isn't "best practices" and sometimes there's ambiguity when it comes to OpenGL version, but outside of those rare occasion, it's a great resource.

If you want to learn about GLSL, there's the GLSL Core Tutorial from lighthouse3D. Though this is the only core knowledge i'd "trust" on the site, rest tends to be outdated.

Once you start to understand how modern OpenGL is done, you'll have an easy time looking for specific information, filtering out outdated code and most importantly reading the specification. You just have to start somewhere.

Most, if not all actually, of the OpenGL books availible are outdated. The new SuperBible is a freak of some sort and i wouldn't recommend it to anybody. The OpenGL Programming Guide for OpenGL 4.1 comes out September 16th, unfortunetly the 7th edition uses deprecated code, so you just have to wait, i sure am.

And ofcourse, you can always ask questions here.

share|improve this answer
1  
Why would you not suggest the SuperBible? –  AUTO May 9 '12 at 13:12
2  
@AUTO The 5th edition of the SuperBible uses a custom wrapper around OpenGL to make it "accessible". Alot of the examples use the custom wrapper excessively. It doesn't teach you what it's suppoused to, which is the OpenGL core specification. The way i see it, if you don't explicitly have to learn deprecated OpenGL, then just forget it even exists. There's no point learning it. The core specification is much more clear and powerful. –  dreta May 9 '12 at 15:15
    
@AUTO The core specification is much more demanding at the beginning, that's a good thing. It'll force you to take care of most of the rendering process, giving you full understanding and control over it. It opens many, many more possibilities than the deprecated code. After that if you can learn your OS's API and lanuch OpenGL under it without things like glut then you're in wonderland. –  dreta May 9 '12 at 15:24
    
OK, so let me ask you an important question: the GLU library seems to be deprecated and completely unsupported; by using the specification, do I get direct access, bypassing the need for the GLU? Such that, I wouldn't get any more linker errors to non-existing functions referenced to by the GLU library? –  AUTO May 9 '12 at 16:04
    
@AUTO GLU is completely unnecessary, i only ever touched it with a 10 foot pole during graphics programming class (we had to use deprecated code, it was painful, the standards change faster than the lesson program, i guess). It's just a library that helps with the deprecated code. If you have your code set up with GLU then it probably stinks. –  dreta May 9 '12 at 16:42
show 2 more comments

These old tutorials are still very relevant to beginners. In fact, I would suggest starting there rather than with recent versions of OpenGL. More recent versions have discarded some of the easier methods of drawing geometry (namely immediate-mode drawing).

With recent versions, you have to prepare and send arrays of vertices and tell the video card how your vertices are arranged in the array you provide. These things are cumbersome to debug.

Some versions (namely OpenGL ES 2.x) require you to provide your own lighting equations (in the form of Fragment Shaders) and transform your own vertex data so that it ends up on the screen where you want it (Vertex Shaders). This is even harder to debug, and is no place for a beginner (in my opinion).

So I would actually suggest that you go back to those NeHe tutorials (etc) and start there. They may be "out of date" but they still work. When you start to understand what really happens in the rendering pipeline in OpenGL and get a feel for some of the mathematical concepts that make these things work, then you'll be ready to look into some of the more up-to-date methods of rendering in OpenGL.

share|improve this answer
    
Actually they DON'T work. That's why I posted this question. They're using the function gluPerspective which is deprecated, and there is no absolute substitute. –  AUTO May 9 '12 at 12:26
    
That is not an OpenGL function. It's a separate utility function provided by another library. You can find the code for it easily -- it's not very difficult. –  stephelton May 9 '12 at 14:19
    
Thanks, but I only found an imperfect substitute that I don't know how to use. It accepts an argument "float *matrix", whereas the old one uses some internal matrix. What do I put for it then? –  AUTO May 9 '12 at 14:39
    
First hit on google for "gluPerspective implementation" is exactly what you're looking for. it calls glFrustum, which is not available in some recent versions of OpenGL (ES 2.x does not include it). Even that is not too hard to find the impl for. –  stephelton May 9 '12 at 14:56
add comment

As others have said, most books are either deprecated or too advanced. Nonetheless, I would recommend the 5th edition of the SuperBible but only to get a quick overview of what can be done in OpenGL and to get familiar with things like the view/projection etc.

Diving immediately in to modern OpenGL could possibly get you overwhelmed at first, so do consider learning to do some basic things in the now deprecated versions.

I'd also like to add a site with good tutorials I've found lately http://ogldev.atspace.co.uk/

share|improve this answer
    
Thanks, I'll check that tutorial; but to use the OpenGL SuperBible, my question still remains: How do I fix GLU, since freeglut is based off it? –  AUTO May 10 '12 at 18:01
    
@AUTO: FreeGLUT is not "based off" GLU. Some FreeGLUT functions call GLU, but if you don't call those functions, then you won't have a problem. –  Nicol Bolas May 10 '12 at 19:17
    
But isn't it likely the SuperBible calls these functions? And if it does, I can't use it. –  AUTO May 11 '12 at 13:53
    
Really, my opinion is to not bother with the source code provided with the SuperBible. Read it but try to make everything from scratch. On your problems with GLU, my best guess is that you haven't configured/installed your libraries correctly. Download the latest version of MinGW. Also download the latest version of freeglut and compile it, or find a pre-compiled library. Anyways, you should start learning some stuff rather than spend so much time on planning how to start. –  Grieverheart May 12 '12 at 2:46
    
@AUTO: Why is it likely the SuperBible calls them? If it did call them, the SuperBible's code would not work. Which is why it doesn't call them. –  Nicol Bolas May 13 '12 at 0:23
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.