Help finding good tutorial or sample code....

Apprentice
Posts: 19
Joined: 2002.12
Post: #1
Everyone,

I'm looking at doing some Mac Game development in C/C++. In the past I have done all my programming on Windows (and DOS even further back).

So I want to try my hand at porting a Tetris game I wrote (seems like a good simple start). My original game uses DirectX for graphics and sound primitives.

Anyway, I was curious if there is any good online tutorial that shows how to handle initializing graphics mode, grabbing sprites from image files, blitting sprites? Additionally touching on Sound and Keyboard would be great also. I'm just hoping for something to touch on the basics.

I will probably use Carbon so it is playable on OS 9 also. Although if there is a good tutorial online that deals in the above with Cocoa, I would love to hear about it.

Lacking any good tutorials are there any recommendations on some source code to a game that deals in the above that is commented well enough?

I've looked here on iDevGames in the faq and other sections, but didn't see any tutorial that handles what I am talking about. I know there is alot of source here online, but if there is a tutorial or article dealing with this, it seems like the better choice.

Any thoughts?

belboz@cinci.rr.com
Quote this message in a reply
Member
Posts: 164
Joined: 2002.04
Post: #2
I would use OpenGL and just choose different sprites from an image file by changing the texture coordinates.
Quote this message in a reply
Apprentice
Posts: 19
Joined: 2002.12
Post: #3
Quote:Originally posted by David
I would use OpenGL and just choose different sprites from an image file by changing the texture coordinates.


I haven't looked at OpenGL before (I always assumed 3D when I thought about OpenGL). Hmmm..

Any thoughts on a good OpenGL tutorial for a beginner? Possibly even something geared towards 2D games.

Thanks for the quick response also!

belboz@cinci.rr.com
Quote this message in a reply
w_reade
Unregistered
 
Post: #4
a few thoughts, not necessarily comprehensive:

You'll probably want OpenGL for graphics, although if it's 2d only you might be interested in Quickdraw (OpenGL is better for almost everything, though). The OpenGL Redbook is very good; there's an out-of-date (but still largely relevant) copy in pdf format at the bottom of the page somewhere here.

Both are accessible from Carbon or Cocoa; search the source code for Carbon and OpenGL, for example.

Sound... I hear CoreAudio (Cocoa only???) has a lot of potential, but I can't find any good docs (are there some in the Dec. dev tools, anyone?). I personally used Sound Manager and kept the sounds in 'snd ' resources; the source code to my game MAFFia (in the downloads section) has uncommented but simple examples.

Keyboard... in Carbon, GetKeys() is good. Look in apple's documentation; you may have difficulty finding actual keycodes (and they are sometimes different on different keyboards), but I'm sure someone else will be able to point you in the right direction.

For more unified solutions, I've heard good things about SDL, to set up OpenGL and deal with input; also, OpenAL is a GL-like sound library. I haven't used the last two personally, but I'm pretty sure both were used among the uDevGame 2002 competition entries, which means there's source code here.
Quote this message in a reply
DoG
Moderator
Posts: 869
Joined: 2003.01
Post: #5
nehe.gamedev.net for OpenGL tutorials en masse, most are ported to Mac, too.
Quote this message in a reply
Apprentice
Posts: 19
Joined: 2002.12
Post: #6
Thanks to all you guys for the tips.

All of those links to the OpenGL stuff look to contain alot of good information.

Hopefully I will be able to post a link to my ported Tetris program when I get a handle on all this stuff.

Thanks again everyone.

belboz@cinci.rr.com
Quote this message in a reply
Founder
Posts: 1,139
Joined: 2002.04
Post: #7
Just a bit of news.... NeHe is coming to iDevGames......

Carlos A. Camacho,
Founder
iDevGames
Quote this message in a reply
Moderator
Posts: 916
Joined: 2002.10
Post: #8
Quote:Originally posted by Camacho
Just a bit of news.... NeHe is coming to iDevGames......

WOOHOO!!! wait... what do you mean? the whole nehe site is going to move here? or be mirrored here? tell us camacho!
Quote this message in a reply
Moderator
Posts: 608
Joined: 2002.04
Post: #9
I believe he means the Mac OS X ports, but I may be mistaken.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  finding a training center - Heeeelp Glauter 1 3,081 Dec 26, 2011 12:30 PM
Last Post: zenkimoto
  Finding an object by name markhula 2 4,687 Mar 29, 2011 08:08 AM
Last Post: markhula
  Kind of a noob question - finding artwork within my .app?? Nethfel 2 2,925 Mar 8, 2010 08:00 AM
Last Post: AndyKorth
  Finding the height of a point on a given list of vertexes? mikey 10 5,558 Jan 4, 2010 05:36 AM
Last Post: mikey
  Finding the closest point to (x1,y1) in array of [x1,y1,z1,x2... mikey 17 9,980 Aug 28, 2009 08:12 AM
Last Post: mikey