2d game with opengl tutorials

roka-tarat
Unregistered
 
Post: #1
Hello,

I want to port a win32 2d game made with directx. To take full hardware acceleration advantages, I want to use opengl. Anyone know a good tutorial about creating 2d games with opengl?

Thanks a lot,

Marc Casas
Quote this message in a reply
jefftkd
Unregistered
 
Post: #2
It really isn't that difficult. I don't know of any tutorials, but you will probably want to get the "Red Book" and look up the following things:

+ glOrtho() (to do 2D instead of 3D)
+ glBegin() / glEnd() (for rendering quads/sprites)
+ glBlendFunc() (to add transparencies to your sprites)
+ glRotatef() / glTranslatef() (to rotate and move sprites)

Also, http://www.opengl.org has lots of code examples for many things -- it would blow my mind if they didn't have a tutorial there somewhere.

HTH, Jeff Cool
Quote this message in a reply
Mars_999
Unregistered
 
Post: #3
Quote:Originally posted by jefftkd
It really isn't that difficult. I don't know of any tutorials, but you will probably want to get the "Red Book" and look up the following things:

+ glOrtho() (to do 2D instead of 3D)
+ glBegin() / glEnd() (for rendering quads/sprites)
+ glBlendFunc() (to add transparencies to your sprites)
+ glRotatef() / glTranslatef() (to rotate and move sprites)

Also, http://www.opengl.org has lots of code examples for many things -- it would blow my mind if they didn't have a tutorial there somewhere.

HTH, Jeff Cool

You can use glOrtho() to do 3D. You just don't get perspective correction like gluPerspective(). I am planning on using glOrtho() for my top down games since you dont' need to worry so much about Perspective correction. If you want to you could have your models drawn to scale before you use them and then you shouldn't have to worry about perspective correction? Hope I am right?
Quote this message in a reply
Jeff Binder
Unregistered
 
Post: #4
Don't forget to read about textures, that's how you'll be rendering your graphics. You also might want to check out vertex arrays and gluOrtho2D().

If you're on OS X, you can get documentation on a specific GL function by typing
man functionname
at the terminal. This information is basically the same as the contents of the OpenGL Reference Manual (the Blue Book), so there's no great rush to buy that book (although it's still handy to have around).

EDIT: I forgot to mention, also check out this web site:
http://nehe.gamedev.net/
It has a lot of good GL tutorials.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  OpenGL Tutorials with video Taxxodium 14 5,846 May 15, 2008 07:00 PM
Last Post: FlamingHairball
  Beginner-Intermediate level OpenGL tutorials Jones 7 4,516 Jan 9, 2006 12:40 AM
Last Post: AnotherJake
  tutorials for setting up a window in opengl cocoa vbuser1338 6 4,570 Mar 14, 2005 02:16 PM
Last Post: maaaaark
  OpenGL mechanics tutorials? kelvin 4 3,645 Nov 24, 2004 10:10 PM
Last Post: OneSadCookie
  Game Tutorials Nick 16 7,440 Aug 8, 2004 06:31 AM
Last Post: Josh