tags:

views:

344

answers:

6

Can anyone tell me how to start learning OpenGL? I have small knowledge of C++. Can I write OpenGL programs in C++? If yes, what are the required things to do? Please tell the steps to follow, as if you are saying to a kid. I'm very new to this concept :(

+12  A: 

I'd start with Nehe's tutorials. They cover the basics and are all in C++.

http://nehe.gamedev.net/

If you want something slightly more high level you could look at the Ogre Rendering engine

http://www.ogre3d.org

jonnii
+1, nehe.gamedev.net is very good.
Julio
Beware of the outdated OpenGL version most NeHe tutorials cover. OpenGL 3 (especially 3.2 Core) has quite a few features removed.
Malte Clasen
NeHe teaches a lot of OpenGL basics, but it doesn't reflect modern OpenGL usage and it doesn't reflect OpenGL 3.
Eric
+7  A: 

To learn more about OpenGL itself, have a look at the OpenGL redbook.

And GLUT provides some useful methods to make the usage of OpenGL easier.

Felix Kling
GLUT is old and unmaintained and has a bunch of long-standing bugs. FreeGLUT and OpenGLUT are better alternatives. http://freeglut.sf.net http://openglut.sf.net
greyfade
Good to know, thank you. I just checked witch GLUT version is provided by Mac OS X and realized that it is the original GLUT library. Shocking... :-/
Felix Kling
+2  A: 

I also suggest the OpenGL redbook: link, it's the main reference document.

About the language OpenGL works with every language, the only thing that differs is how you create an OpenGL context and put it fullscreen or in a window.. for this I would suggest an API capable of wrapping these functionalities (and also other ones, like mouse handling)..

  1. SDL
  2. GLFW

They are not mandatory to program in opengl but they help a lot..

Jack
A: 

Have a look at the official OpenGL website. It provides a wiki including a getting started section, and a link list to third party material.

In any case you should think about which OpenGL version you want to target. If you start with the famous NeHe tutorials, you will most probably end up with OpenGL 2.1 and its fixed function pipeline or hard-wired shader variables, display lists and similar concepts that are not available in the OpenGL 3.2 core profile. On the other hand, no OpenGL 3.2 tutorials have gained this level of reputation, so I can't recommend a specific tutorial.

Malte Clasen
+1  A: 

I'd recommend using QtOpenGL http://qt.nokia.com/doc/4.5/qtopengl.html or SDL http://www.libsdl.org/.

<rant>

For the love God, please make it portable, it's pointless to code using OpenGL yet make a program that only runs on windows.

</rant>

OneOfOne
A: 

Just start from 2D then shift to 3d. its very easy. In openGL i think we have to remember somany functions especially, GLUT commands.

guru