Hello. For the past 6 months I've been creating a c++ game, but all I have ever learned in c++ is how to write c++ consel. (The DOS screen)

Its so ugly and I would really love to turn my game into a c++ API with some basic graphics instead of just ugly white text. The only problem is I'm not sure were to start, or what to ask for. Can someone point me in the right direction to a nice tutorial were I can begin learning to create some basic graphics in c++ and how to use c++ API?

Thanks so much in advance.

Dani AI

Generated

For (console-only C++ game), the shortest practical path is: pick a small cross-platform library for windowing/input/audio, learn the render loop pattern, then isolate rendering behind a simple interface so the game logic stays console-independent. Both and pointed toward libraries and APIs; the advice is sound but a modern, focused entry path helps avoid old tutorials and fixed-function-era traps.

A recommended, up-to-date stack to learn with:

  • A lightweight library that creates a window, handles input and presents textures (good for 2D starters).
  • A clear modern-OpenGL tutorial if moving toward 3D and shaders.
    Each choice has active docs and examples to follow while migrating a console project into a windowed game.

A minimal workflow to follow:

  • Create a new project that links the chosen library.
  • Implement a single-file game loop: event polling, fixed-timestep update, render, present.
  • Load one sprite, render it, handle keyboard input, then expand to animation and collision.
    Example skeleton (pseudocode):
int main() {
    init_library();
    create_window_and_renderer();
    while (running) {
        poll_events();        // input
        update(dt);           // game logic with fixed timestep
        clear_renderer();
        draw_scene();         // draw sprites/textures
        present_renderer();   // swap buffers
    }
    cleanup();
    return 0;
}

Practical tips and gotchas: keep platform code (window, file paths, resource loading) separated from game logic so an API layer can later swap renderers. Use RAII/smart pointers for textures/resources. Common build issues are mismatched architectures (x86 vs x64) and missing runtime DLLs when distributing; make sure dev and release builds use the same CRT and library versions. Start very small (one moving sprite) and iterate.

Useful, current references for beginners include the official SDL2 and SFML sites and the "Learn OpenGL" tutorials for shader-based rendering. These provide step-by-step examples that map directly to the workflow above and will make the switch from DOS-style console output to a windowed game straightforward.

Recommended Answers

All 3 Replies

Well have patience,a fruit tree needs years of care before it gives us tasty fruits.Same is with programming.
Well if you are just trying out to create some windowed interface for your game then IDE's like Dev-Cpp,CODE-Blocks etc directly make it for you on their own without much effort.But if you want to learn something then read about WIN-API.
And ya if you are just concerned about graphics for your game and not a windowed interface then you can start off with C-Graphics for learning, where you can do a lot of stuff then switch over to something like Open-GL or something which is completely graphics oriented.

Thanks for the advice. I'll look all that up.

commented: That's the spirit! +9

For all 2D games (e.g. platform) is the most likable I think :)

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.