Here is a template you can use to start your game. Do not forget to choose a license and add the relevant text at the beginning of the file.
This template uses high level features (gf::ActionContainer, gf::ViewContainer, gf::EntityContainer) instead of low-level features presented in Gamedev 101. You may also need some other features, depending on your game (gf::MessageManager, gf::ResourceManager, gf::Random, etc).
#include <gf/Action.h>
#include <gf/Clock.h>
#include <gf/Color.h>
#include <gf/EntityContainer.h>
#include <gf/Event.h>
#include <gf/RenderWindow.h>
#include <gf/ViewContainer.h>
#include <gf/Views.h>
#include <gf/Window.h>
int main() {
closeWindowAction.addCloseControl();
leftAction.setContinuous();
rightAction.setContinuous();
upAction.setContinuous();
downAction.setContinuous();
while (window.isOpen()) {
while (window.pollEvent(event)) {
}
if (closeWindowAction.isActive()) {
window.close();
}
if (fullscreenAction.isActive()) {
window.toggleFullscreen();
}
if (rightAction.isActive()) {
} else if (leftAction.isActive()) {
} else if (upAction.isActive()) {
} else if (downAction.isActive()) {
} else {
}
renderer.clear();
renderer.setView(mainView);
mainEntities.
render(renderer);
renderer.setView(hudView);
renderer.display();
}
return 0;
}