Beginning 2D Graphics Programming

Nibbie
Posts: 1
Joined: 2009.01
Post: #1
Hi,

I'm hoping to learn how to use 2D graphics in my programs but so far, I've had no luck finding good information. All tutorials I've found seem to be for 3D graphics which I have no interest in.

If it matters, I'm using c++ for programming.

Thanks beforehand.
Quote this message in a reply
Member
Posts: 241
Joined: 2008.07
Post: #2
If you're making a game, I suggest using OpenGL. If your game is for the iPhone it's OpenGL ES, which is different. There's a lot to know and understand about graphics programming. It's impossible to give a simple answer but I can hopefully get you started in the right direction. Maybe you can find some sample code out there on the net.

Start your research by learning about the Projection matrix and for 2D, specifically, you'll want to use an Orthographic projection. glMatrixMode(GL_PROJECTION), glOrtho... there are a couple good keywords to get you started with Google.

gluOrtho2D, I think is the utility function call.

Other options include Quartz2D, which I know nothing about, QuickTime, and I'm sure there's more but those are the 2 I can think of off the top of my head.

Sorry if it isn't very helpful but it's a very broad question so I hope I helped to at least get you started.
Quote this message in a reply
Moderator
Posts: 1,562
Joined: 2003.10
Post: #3
bmantzey Wrote:gluOrtho2D, I think is the utility function call.

...which is part of glu, which doesn't exist in OpenGL ES. Just to avoid confusion for the original poster.
Quote this message in a reply
Moderator
Posts: 683
Joined: 2002.11
Post: #4
I would actually recommend learning SDL rather than OpenGL at first, as it's much easier to get interesting things on the screen.

Unfortunately, I don't know of any decent 2D OpenGL tutorials.

My web site - Games, music, Python stuff
Quote this message in a reply
Member
Posts: 67
Joined: 2006.07
Post: #5
diordna Wrote:I would actually recommend learning SDL rather than OpenGL at first, as it's much easier to get interesting things on the screen.

Unfortunately, I don't know of any decent 2D OpenGL tutorials.

I second that. OpenGL, especially for 2D game programming, is pretty tricky to learn if you're new to game development. SDL simplifies a lot of the icky low-level stuff.

As for 2D OpenGL tutorials, I don't know of any specific tutorials either. If it helps, though, I learned most of the techniques from NeHe, parts of the Red Book, parts of Apple's OpenGL documentation, and a lot of the posts here. Hopefully that can simplify the Googling a bit. Wink

Since when was "Fred" a placeholder variable?
Quote this message in a reply
Apprentice
Posts: 8
Joined: 2008.12
Post: #6
There's a really good 'Lander' sample program on the iPhone developer site, which shows how to do 2D stuff in eaGL (on iPhone).

neHe is a great site for learning openGL stuff too.

http://nehe.gamedev.net/
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Beginning ARB vertex programs dfmoore 1 2,927 Sep 24, 2005 02:45 PM
Last Post: lightbringer
  beginning opengl vbuser1338 23 8,873 Jan 16, 2005 12:11 PM
Last Post: SethWillits