Before we draw anything, the first thing we need is a window so that we can display something on the screen. Let's create a window:
- At the top of the source.cpp file, include the Graphics.hpp file to gain access to the SFML graphics library:
#include "SFML-2.5.1\include\SFML\Graphics.hpp"
- Next, add the main function, which will be the application's main entry point:
int main(){ return 0; }
- To create the window, we have to specify the size of the window that we want to create. SFML has a Vector2f data type, which takes an x and a y value and uses them to define the size of the window that we will be using.
Between include and main, add the following line of code. Create a variable called viewSize and set the x and y values to 1024 and 768, respectively:
sf::Vector2f viewSize(1024, 768);
The assets for the game are created for...