954,535 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Adding Graphics to a C++ game

I have a c++ game that i made and i was wondering how i would make it so that i could add graphics, or just use the same basic concept of the game and just put those into a fresh game that i make with graphics. well my question is what is the best program, or way to do this for someone that's never made one with graphics before.

skorm909
Junior Poster
111 posts since Feb 2010
Reputation Points: 10
Solved Threads: 3
 

Your probably best of leaving your project for a bit. If you haven't done graphics before, go here:
http://www.cppgameprogramming.com/cgi/nav.cgi?page=index
(double-click anywhere to bring up the site menu)
and learn allegro. Make pong or space invaders or something first, then go back to do your project. Basically just keep your existing logic, but get rid of all the printing to the console and replace it with graphics. It will be fairly hard to do. Depending on the size of your game, you may want to consider re-writing it around allegro.

SgtMe
Nearly a Posting Virtuoso
1,205 posts since Oct 2009
Reputation Points: 68
Solved Threads: 85
 

ok thanks ill look into this.

skorm909
Junior Poster
111 posts since Feb 2010
Reputation Points: 10
Solved Threads: 3
 

Please upvote my post seeing as it was helpful :)

SgtMe
Nearly a Posting Virtuoso
1,205 posts since Oct 2009
Reputation Points: 68
Solved Threads: 85
 

i did you one better and up repped you =)

skorm909
Junior Poster
111 posts since Feb 2010
Reputation Points: 10
Solved Threads: 3
 

Cheers :)

SgtMe
Nearly a Posting Virtuoso
1,205 posts since Oct 2009
Reputation Points: 68
Solved Threads: 85
 

i cant figure out how to add allegro to my compiler... i use dev c++ but if i cant get it to work in there then i can move to code blocks...

skorm909
Junior Poster
111 posts since Feb 2010
Reputation Points: 10
Solved Threads: 3
 

Sweet I have Dev-C++!
It's really simple.

Step 1: Tools -> Check for updates/packages...

Step 2: Select devpak server from dropdown box. You need "devpaks.org Community Devpaks". Then press the "check for updates" button in the bottom left.

Step 3: On the "groups" dropdown menu, select "Allegro". Then select one of the allegro packages (note: I tried version 4.4.0.1 but it didn't install properly. Try 4.2.2)

Step 4: Click the checkbox next to it and press the "download selected" button in the bottom left. Then follow the installation instructions. Just keep pressing next, next, install or whatever, then finish.

Step 5: Close the download manager, and open a new C++ project. Select the multimedia tab, and choose "Allegro application". It will load some demo code, but you can delete that and put your own code in.

SgtMe
Nearly a Posting Virtuoso
1,205 posts since Oct 2009
Reputation Points: 68
Solved Threads: 85
 

@skorm did you have any luck with allegro? i've got a similar text rpg that i was considering porting to allegro for sounds and some graphics but didn't try it out yet. seems to me like a daunting task especially since im new to the scene.

crimes
Newbie Poster
13 posts since Dec 2010
Reputation Points: 10
Solved Threads: 1
 

@skorm: Please upvote my post on how to install the package seeing as it helped. Thanks :)

SgtMe
Nearly a Posting Virtuoso
1,205 posts since Oct 2009
Reputation Points: 68
Solved Threads: 85
 

Hey SgtMe;

If you know how to install allegro to use with VS2010 can you please explain. I downloaded allegro and looked everywhere in it to read a document about how to install for VS2010 but found nothing.

Tellalca
Posting Whiz in Training
209 posts since Mar 2010
Reputation Points: 29
Solved Threads: 24
 

You looked everywhere? I looked for 5 seconds, no joke :D
http://www.youtube.com/watch?v=B44tSBJCcfU

I'll take my one-up and thread solved now I think :D

@Offtopic: Is skorm still around? He hasn't signed in for 9 days.

SgtMe
Nearly a Posting Virtuoso
1,205 posts since Oct 2009
Reputation Points: 68
Solved Threads: 85
 

I would try using SDL. I use it and, it has many functions including detecting mouse and keyboard activity, multithreading, alpha blending, .ttf text, and audio.

For simple but excellent tutorials on how to get it, use it and, make games with it check http://www.lazyfoo.net/SDL_tutorials/ .

These tutorials show you all of the important parts of SDL and many cool tricks you can do with it. With simple lessons and example programs.

Have fun! :)

Sudo Bash
Light Poster
33 posts since Dec 2010
Reputation Points: 10
Solved Threads: 2
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: