Graphic programming

Pages: 1234
Hello all, I’ve been learning c++ and how to use it, I downloaded the visual studio compiler and I wanted to make a game. It’ll just be a dinosaur game like the google one. I was wondering where to start from so I thought maybe the background and pics and effects etc would be a place to start. This was one concept I struggled with so could I please grab some assistance!!
Thanks in advance
Last edited on
To use graphics on C++ you need to use a n external library.
Popular ones are SDL, SFML or Allegro. There are plenty of tutorials on YouTube.
Standard C++ doesn't have any graphics capabilities. As stated above, you'll need to use a 3rd party library. IMO, you'd be better off getting to grips with C++ (using the console) before also having to learn the chosen graphics library - which is likely to be heavy on classes.
Okay I’ll give that a shot, when I created a project, I chose the wizard project, I used static library and chose empty project. Would that be correct?
I downloaded the visual studio compiler

You used the "Windows Desktop Wizard" to create your project. For core C++ you should choose the "Console App" option, not the "Static Library."

Choosing "Empty Project" in the wizard was a good choice. :) No source/header files created, you add them when you need them.

I'd suggest for learning C++ you NOT use the Wizard. There is an option for "Empty Project" that sets all the options for a console app.
https://www.learncpp.com/images/CppTutorial/Chapter0/VS2019-CreateNewProject-min.png
Okay, I’ll use console App but the link you posted isn’t working for me?
I get a 403 error as well.
Link works for me OK. Maybe a temp site issue.

How do I change a library using visual studios
Well if you want an opinion, I like using SFML (Thomas also mentioned it). It's a multimedia library that you could use for something like the obstacle jumping game.

SFML and Visual Studio:
https://www.sfml-dev.org/tutorials/2.5/start-vc.php

Downloads:
https://www.sfml-dev.org/download/sfml/2.5.1/
Last edited on
Unfortunately for one of the download link you gave me, There isn’t any 2019 version for it, Also I was wondering that why is the version I have different to the ones I see I turtorials?
Is it ok if you could send me or tell me a version which is suitable for what i’m currently doing?
VS 2017 and VS 2019 should be binary compatible.

But if you really want to learn about building libraries (a good skill), you could build SFML yourself from source. But it shouldn't be necessary for VS.
https://www.sfml-dev.org/tutorials/2.5/compile-with-cmake.php
Bjarne Stroustrup ('Inventor' of C++) in his book 'Programming: Principles and Practice Using C++' uses FLTK for graphics/GUI, and provides examples and exercises using it.

https://www.amazon.co.uk/Programming-Principles-Practice-Using-C/dp/0321992784/ref=sr_1_2?dchild=1&keywords=Bjarne+Stroustrup&qid=1603377730&s=books&sr=1-2

[just covers up to C++14, not C++17/20]

VS 2017 and VS 2019 should be binary compatible.

But if you really want to learn about building libraries (a good skill), you could build SFML yourself from source. But it shouldn't be necessary for VS.
https://www.sfml-dev.org/tutorials/2.5/compile-with-cmake.php


I already have the VS 2019, but it’s really different to the turtorials I’m watching so sometimes it becomes difficult to understand. I’ll try the VS 2017.
Bjarne Stroustrup ('Inventor' of C++) in his book 'Programming: Principles and Practice Using C++' uses FLTK for graphics/GUI, and provides examples and exercises using it.

https://www.amazon.co.uk/Programming-Principles-Practice-Using-C/dp/0321992784/ref=sr_1_2?dchild=1&keywords=Bjarne+Stroustrup&qid=1603377730&s=books&sr=1-2

[just covers up to C++14, not C++17/20]

Alr I’ll give that a shot and try understand it
Games can be created using Window's GDI and multimedia system, no 3rd party libraries needed.

Beginning Game Programming - https://www.amazon.com/gp/product/0672326590/

The above book's code will require some tweaking, the newer Win32 API has some changes from what is used by the book's sources.

A minimal game engine is created step by step during the course of the book, it is a decent framework to make other games.
Is GDI a library which needs to be downloaded?
Or is it included with visual studio’s
Also, I want to try make a moving background which changes colour, should I use XAML?
Last edited on
Pages: 1234