We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,166 Members — Technology Publication meets Social Media

# Suggestion on Starting 2D game using C++, OpenGL

Hello,

I have chosen a project of developing a 2d action-adventure game with some rpg elements, in-game puzzles. I have considered developing with C++ and OpenGL. I do not have prior knowledge of these language but I had good grasp on C programming language. For C++ and OpenGL, I have bought books. I have estimated time of 7 months to learn these languages and develop a fully functional game.

Will I be able to complete my project on time or will I face any kind of difficulty. What other obstacles I may encounter that I can prevent.

P.S.- Any suggestion regarding the topic is welcomed.

4
Contributors
6
Replies
3 Days
Discussion Span
1 Year Ago
Last Updated
7
Views
Question
Raik.48
Newbie Poster
13 posts since Sep 2009
Reputation Points: 10
Skill Endorsements: 0

I don't understand how much time you have. Especially the platform you are going to build your game to run and ise the game will be 2D or 2.5D? If it'll be real 2D you need simple math coordinate logic with x and y axis else if it will be 2.5d you must hanle z axis too.

OpenGL and C++ is the best option for starting and it will be good to examine the sample triangle code tounderstand OpenGL.

If you are good at c/c++, you can handle possible diffuculties. I advice you to build simple samples about ai, data handling, sound playing and graphical animations before you start.

If you encounter any diffuculties I'll be here. Good luck!

cahitburak
Newbie Poster
24 posts since Oct 2008
Reputation Points: 10
Skill Endorsements: 0

I don't understand how much time you have. Especially the platform you are going to build your game to run and ise the game will be 2D or 2.5D? If it'll be real 2D you need simple math coordinate logic with x and y axis else if it will be 2.5d you must hanle z axis too.

OpenGL and C++ is the best option for starting and it will be good to examine the sample triangle code tounderstand OpenGL.

If you are good at c/c++, you can handle possible diffuculties. I advice you to build simple samples about ai, data handling, sound playing and graphical animations before you start.

If you encounter any diffuculties I'll be here. Good luck!

The game will be for windows. I don't know much about 2d and 2.5d. If you have played games like "Contra", it is what I am aiming for my graphics to look like and also gameplay.

I am currently reading books on C++.

Raik.48
Newbie Poster
13 posts since Sep 2009
Reputation Points: 10
Skill Endorsements: 0

Here's a quick reference on getting OpenGL to do 2D cleanly.

gusano79
Practically a Master Poster
671 posts since May 2004
Reputation Points: 193
Skill Endorsements: 6

Here's a quick reference on getting OpenGL to do 2D cleanly.

Thanks for the reference, I'll check it out.

Raik.48
Newbie Poster
13 posts since Sep 2009
Reputation Points: 10
Skill Endorsements: 0

Under a time constraint, working with OpenGL doesn't really make a lot of sense. For a 2D game, you are probably best served using a library such as SDL, SFML or Allegro, all of which use OpenGL behind the scenes. By working with such a library, not only are the OpenGL specifics handled, but so are the file loaders, music libraries, tertiary math libraries, etc... Keep in mind each of these libraries represents MAN YEARS of work, most of which you will have to replicate and debug yourself if you "roll your own".

If you decided to go the SFML route, with your baseline knowledge of C, this tutorial will get you up to speed fast with both C++ programming and using SFML. If you go the SDL route, which is a bit more C'ish in style, there are a literal ton of tutorials on their site. Allegro is in a bit of a transitional state at the moment, but has a fair wealth of tutorials available as well.

Serapth
Newbie Poster
16 posts since Aug 2011
Reputation Points: 10
Skill Endorsements: 0

I have looked ClanLib (http://clanlib.org/wiki/Main_Page) and it seems that it is good for 2D.

Is clanlib as powerful as SMFL, allegro?

Thanks

Raik.48
Newbie Poster
13 posts since Sep 2009
Reputation Points: 10