Sign in to follow this  
Bbalstrzmj90

Help with Starting OpenGL

Recommended Posts

Bbalstrzmj90    124
I was planning on buying Beginning OpenGl Game Programming but as I was reading about the book I learned that it taught only 3D OpenGL (i think). I want to work on 2D graphics and games before I move onto 3D things. My Original Programming Plan was: -Learn C++ -Write a text-based game -Study the basics of programming on Windows (i.e. creating a Window) -Study OpenGL with Beginning OpenGL Game Programming and learn things such as DirectInput, Sound, Music, etc. along with game logic to create my own game - create a simple game (i.e. a pong or tetris clone) - move on to advanced OpenGl programming along with more on the DirectX features needed to make a game functional. That was my original plan, but now I'm not sure if I should go into OpenGL because it seems to be for 3D games and I don't think I'm there yet. I have a book that teaches DirectDraw, along with the other components of DirectX but I heard OpenGL is more beginner friendly and easier to start off with. Is there a way to do 2D with OpenGL and any book that teaches that or any other book you guys would recommend. Or should I stick with DirectDraw even though it has a steeper learning curve.

Share this post


Link to post
Share on other sites
JDev    100
Every primative line based drawing can be drawn as 3d or 2d. For instance to draw a line in 2d.

glBegin(GL_LINE);
glVertex2f(0.0f,0.0f);
glVertex2f(1.0f,1.0f);
glEnd();

the same line in 3D

glBegin(GL_LINE);
glVertex3f(0.0f,0.0f,0.0f);
glVertex3f(1.0f,1.0f,0.0f);
glEnd();


In case you havn't seen this site http://nehe.gamedev.net/ , this site will teach you basics of opengl for free. I would start with c++ first and try to really master the data structures, object oriented programming techniques like inheritance, and polymorphism, and templates. Then moving on to opengl will not be as overwhelming as it may seem at first. You can always experiment with it while your learning to program, but OO fundamentals are good tools to have when creating robust games 2D or 3D.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this