mWindow.create(sf::VideoMode(640, 480), "SFML Application")
is effectively doing 2 things:
- creating the actual operating system window
- setting it to have a size of 640x480 and a title of "SFML Application"
If you just make a window and don't initialise it, like this:
sf::RenderWindow mWindow;
That makes the default sfml renderwindow object, but doesn't actually create the operating system window since not enough info is known yet. It needs the resolution to do the actual creation.
This lets you make the variable somewhere accessible, then delay making the OS window until later when the .create() function is called.
There are two alternatives:
One is to declare mWindow and give its constructor the resolution:
sf::RenderWindow mWindow(sf::VideoMode(640, 480), "SFML Application");
This is the same as calling .create() immediately after declaring the variable. Well, it's possibly more efficient, depending on how the code was written, since it's doing it all in one hit.
The downside is where ever you declare mWindow, that determines the lifetime of the window. If you make it in the Game() constructor, it only lives during that constructor.
The other way is what the book apparently had (I haven't read it). The initialiser list style lets you call the window constructor when the Game constructor is called.
Hopefully something in that made sense, usually when I'm teaching C++ it's in a classroom face to face, online is trickier.
I'd recommend having a go at some tutorials to refresh thing, C++ has changed a bit over the years.
For example:
https://www.cplusplus.com/doc/tutorialhttps://www.tutorialspoint.com/cplusplus/index.htm