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.

Dani AI

Generated

was spot on: pause the console version, learn a 2D framework, then rebuild your game’s presentation. For 2025, the friendliest options are SDL3 (modern, cross‑platform), SFML (idiomatic C++ with clear tutorials), or Allegro 5 (simple 2D/audio/input with current docs). Any of these will let you keep your rules and data, and swap out all the console I/O for drawing, textures, and events. (wiki.libsdl.org)

A practical porting path that works well for text RPGs (hi and ):

  • Wrap your existing printing and input behind tiny interfaces like IRenderer and IInput. The rest of your game should only talk to those.
  • Add a real game loop with events and a fixed update step; keep drawing separate from updates.
  • Replace console text with bitmap fonts or a sprite sheet; start with a single "room" or screen first.

Here is a minimal loop you can adapt to SDL/SFML/Allegro without changing your game rules:

bool running = true;
const float dt = 1.0f / 60.0f;
float lag = 0.0f;
auto prev = Clock::now();

while (running) {
  running &= pollEvents();                  // from your library
  auto now = Clock::now();
  lag += seconds(now - prev);
  prev = now;

  while (lag >= dt) { game.update(dt); lag -= dt; }  // deterministic
  renderer.clear();
  game.render(renderer);                    // draw sprites/text
  renderer.present();
}

Setup tip for Windows/macOS/Linux: instead of hunting old IDE packages, use a package manager. With vcpkg you can do:

vcpkg install sdl3
vcpkg install sfml

Then open your CMake/Visual Studio project and link the provided targets; it saves a ton of linker pain and works the same across IDEs. (learn.microsoft.com)

Recommended Answers

All 16 Replies

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.

commented: Helped me out. +1

ok thanks ill look into this.

Please upvote my post seeing as it was helpful :)

i did you one better and up repped you =)

Cheers :)

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...

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 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.

@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.

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

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.

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.

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! :)

I don't get it.

hmm you can try to learn C#, is like C++, but more effective

Considering that the last person involved in this thread hasn't been around for half a year, I think you may be a bit late to the party.

In other words, don't resurrect lond-dead threads. We have enough zombies on Daniweb already :)

ok, man
sorry

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.