View Full Version : Beginner OpenGL: Looking for source code
CarbonX
2003.12.11, 11:57 PM
I am just starting to get into OpenGL programming and I want to see how the inner workings of a real OpenGL game. Does anybody know of a good OS X / Carbon game that is free to download the source code for?
Thanks.
kelvin
2003.12.12, 06:27 AM
In my opinion, you should take a two step approach to learning OpenGL on the mac. 1) Learn OpenGL. 2) Pick a framework and learn it.
For OpenGL, start with The Redbook (http://www.opengl.org/documentation/red_book_1.0/) and go through the first few chapters of examples. You'll need to download a Sample Code (http://developer.apple.com/samplecode/Sample_Code/Graphics_3D.htm) that has a minimum of Context setup to drop your code into. I recommend glut, Cocoa OpenGL, or Carbon OpenGL. Cocoa OpenGL will probably be the most approachable if you haven't used any of the 3 already.
Once you've got a good grasp of OpenGL, then learn how to do the application basics. Look to the CoreGraphics headers in the Application Services framework for Fullscreen capturing and switching.
As always, bring us your questions on the boards and we'll do our best to answer. :)
MattDiamond
2003.12.12, 01:17 PM
Quite a few OpenGL games in uDevGame 2003, and the source code for all of them will be posted eventually. The source for the 2002 entries is already available in the iDevGames file library.
CarbonX
2003.12.12, 10:54 PM
Thanks for the input. I have already downloaded The Red Book and am reading the chapters. I also have downloaded the NeHe Cocoa tutorials. I'm not a big fan of Objective-C because you have to forget parts of C++ to use it and it just gets too confusing. I will probably learn it eventually.
P.S. Matt, When do you think the source code for all of the games in uDevGame2003 wil be posted for download.
Sohta
2003.12.13, 08:01 PM
When it comes to objective-C. You don't need a lot. You just need a couple of very simple objective-C++ classes to interface with cocoa, and the rest of your game can still be written in good old C++.
You can find a (very simple) example of this on nehe's homepage. It's called the NeHe cocoa basecode.
vBulletin® v3.6.8, Copyright ©2000-2008, Jelsoft Enterprises Ltd.