View Full Version : Where to start with OpenGL

Jul 18, 2009, 04:49 PM
I know virtually nothing about programming with OpenGL, and I'd quite like to learn it. I write business software by day, and this is just an itch-scratching exercise more than anything.

Can anybody recommend any starting places? I know the blue and red books are talked about a lot -- are they good learning tools, or more of a reference? I've bought reference books before for other topics, and in my experience they lay untouched. I'm really looking for something a bit like the Programming Cocoa book by the guy with the big hat.

Also, can anybody suggest places to get models and textures form while I learn? I'd love to get Modo or Lightwave or Maya and create my own art, but that's a whole other thing to learn and I'm better at programming than graphics...

I've had a play with DirectX in the past, so I know the basics of 3D programming, I just want to learn OpenGL.

Actually, it just occurred to me that OpenGL doesn't include any input or network or audio stuff like DirectX -- any recommendations there? Especially input.

Final thing; if it's Mac based that would be really great (but not essential)!

Jul 18, 2009, 05:40 PM
I went through the tutorials on http://nehe.gamedev.net/ when I started learning OpenGL. It starts out assuming you know nothing about OpenGL.

edit: In regards to your question about input, network, audio, etc, yes, opengl provides none of that. You will have to pick a toolkit that provides all of that stuff. I almost always use the Qt Toolkit (http://www.qtsoftware.com/) when writing applications, so that's what I use for OpenGL as well. I like Qt because not only is it a really good all around toolkit but it is platform independent and makes it very easy to write applications that will run on windows/linux/osx/etc and will feel like native applications.

SDL (http://www.libsdl.org/) is another option that is sometimes used for games. It provides you with audio, networking, etc.

I'm sure you could also OSX's native toolkits (e.g. Cocoa) but I know nothing about them as I prefer to keep things platform independent.

Jul 19, 2009, 04:03 PM
I went through the tutorials on http://nehe.gamedev.net/ when I started learning OpenGL. It starts out assuming you know nothing about OpenGL.

Those NeHe articles looks useful, thanks for the link. I've started going over the basics and I have a working teapot sample :)

I think I'll have a look at SDL once I reach the limits of GLUT. I quite like the idea of being cross platform compatible if I ever manage to write anything worthwhile.

Jul 19, 2009, 05:48 PM
If you want to use a toolkit like QT (do not confuse with QuickTime) for the rest of the stuff around (sound, window decorum...), I would suggest you give a look at WxWidgets http://www.wxwidgets.org/ and pick the one you like the most.

If you plan on making OS X only applications, you may want to use Obj-C with OpenGL. Use Obj-C for the user interface link, use C++ for the engine, use OpenGL for rendering and Python for scripting purpose.

As for OpenGL, there's a good tutorial guide in NeHe like said above, it's THE starter tutorial. You may also give a look at http://www.idevgames.com/ if you plan on developing for OS X.

As a side note, if you plan on using C++, try Boost library, it make your life so much easier and you're code much more stable. http://www.boost.org/
The Doc isn't that great, but a few Google search for example should be enough, the source is also available to peak a look.

Jul 20, 2009, 04:39 AM
Thanks for the iDevGames link -- that site looks pretty useful.

I'm coding in C at the moment, because that's a language I'm used to. I can happily find my way around C++ if I have to, but I'm a little bit slower. I've looked at Boost in the past for other projects (my day job is programming business stuff) and I'd definitely use it for any serious C++. I guess the big advantage of C++ over C is that game worlds lend themselves so perfectly to object oriented programming -- maybe I'll switch over right away to C++.

Any thoughts on using Lua as a scripting language?