#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() {
window.setVerticalSyncEnabled(true);
window.setFramerateLimit(60);
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;
}
A set of actions.
Definition: Action.h:240
void processEvent(const Event &event)
Update all the actions.
void addAction(Action &action)
Add an action.
void reset()
Reset all the actions.
An action that can be triggered by different controls.
Definition: Action.h:53
Utility class that measures the elapsed time.
Definition: Clock.h:61
Time restart()
Restart the clock.
A collection of entities.
Definition: EntityContainer.h:60
void render(RenderTarget &target, const RenderStates &states=RenderStates())
Render the entities on the target.
void update(Time time)
Update the entities.
Extend view.
Definition: Views.h:220
A window that can serve as a target for 2D drawing.
Definition: RenderWindow.h:80
Screen view.
Definition: Views.h:354
Represents a time value.
Definition: Time.h:65
A container of views.
Definition: ViewContainer.h:52
void setInitialFramebufferSize(Vector2i framebufferSize)
Set the initial framebuffer size.
void processEvent(const Event &event)
Update the views thanks to the event.
void addView(AdaptativeView &view)
Add a view to the container.
An OS window.
Definition: Window.h:97
static constexpr Color4< T > White
White predefined color.
Definition: Color.h:168
Defines a system event and its parameters.
Definition: Event.h:224