Graphic programming

Pages: 1234
Oct 20, 2020 at 7:42am
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 Oct 20, 2020 at 7:44am
Oct 20, 2020 at 8:58am
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.
Oct 20, 2020 at 11:27am
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.
Oct 20, 2020 at 9:52pm
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?
Oct 21, 2020 at 12:20am
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
Oct 21, 2020 at 3:13am
Okay, I’ll use console App but the link you posted isn’t working for me?
Oct 21, 2020 at 7:08am
I get a 403 error as well.
Oct 21, 2020 at 8:23am
Link works for me OK. Maybe a temp site issue.

Oct 22, 2020 at 2:28am
How do I change a library using visual studios
Oct 22, 2020 at 4:48am
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 Oct 22, 2020 at 4:49am
Oct 22, 2020 at 7:48am
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?
Oct 22, 2020 at 7:49am
Is it ok if you could send me or tell me a version which is suitable for what i’m currently doing?
Oct 22, 2020 at 1:57pm
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
Oct 22, 2020 at 2:43pm
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]

Oct 22, 2020 at 10:59pm
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.
Oct 22, 2020 at 11:00pm
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
Oct 23, 2020 at 4:21am
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.
Oct 23, 2020 at 7:05am
Is GDI a library which needs to be downloaded?
Oct 23, 2020 at 7:05am
Or is it included with visual studio’s
Oct 23, 2020 at 7:55am
Also, I want to try make a moving background which changes colour, should I use XAML?
Last edited on Oct 23, 2020 at 7:56am
Pages: 1234