After writing the first tutorial i have realized that the post got too big, so in that tutorial i will split it into smaller posts, making it easier to follow.
I'm going to start modifying the functions "SetVga" and "LoadTileset", the objectives are simples:
- We want the "SetVga" function to set any graphic mode and Full Screen/windowed mode.
- The function "LoadTileset" should get the path to the file we want to load instead of having it "Hard Coded" inside the Engine class.
Now we have to open engine.h and change:
SetVga now accepts 4 parameters:
- Width of the desired video mode
- Height of the desired video mode
- BPP:Color depth 8bits, 16bits, 32bits...
- FullScreen: true to make it fullscreen, false to start a windowed mode
Notice that we only add the parameter "File".
Save the file and open engine.cpp
Now we have to replace
Before, the engine used the default parameters initialized when we create the Engine class, after we can set any video mode.
We can now load any file.
Enough for now, in the next post I'll talk more about tilesets and multi-layered maps..