29#ifndef NOMLIB_SYSTEM_SDLAPP_HPP
30#define NOMLIB_SYSTEM_SDLAPP_HPP
36#include "nomlib/config.hpp"
37#include "nomlib/system/Timer.hpp"
57 typedef self_type* raw_ptr;
58 typedef std::shared_ptr<self_type> shared_ptr;
82 bool app_state(
void )
const;
84 virtual bool on_init(
void );
87 virtual sint
Run(
void );
122 void set_app_state(
bool state );
124 bool show_fps (
void )
const;
125 void set_show_fps (
bool toggle );
158 virtual void on_window_shown(
const Event& ev);
160 virtual void on_window_hidden(
const Event& ev);
162 virtual void on_window_exposed(
const Event& ev);
164 virtual void on_window_moved(
const Event& ev);
166 virtual void on_window_resized(
const Event& ev);
168 virtual void on_window_size_changed(
const Event& ev);
170 virtual void on_window_minimized(
const Event& ev);
172 virtual void on_window_maximized(
const Event& ev);
174 virtual void on_window_restored(
const Event& ev);
176 virtual void on_window_mouse_focus(
const Event& ev);
178 virtual void on_window_mouse_focus_lost(
const Event& ev);
180 virtual void on_window_keyboard_focus(
const Event& ev);
182 virtual void on_window_keyboard_focus_lost(
const Event& ev);
231 bool initialize( uint32 flags );
233 void on_app_event(
const Event& ev);
235 void process_event(
const Event& ev);
Event handling abstraction.
Abstract interface for game states.
Timer app_timer_
Global application timer.
bool show_fps_
FPS counter.
virtual void on_window_close(const Event &ev)
The event handler for when a request for closing a window occurs.
virtual void on_update(float)
The application-level handler for logic.
virtual void on_draw(RenderWindow &)
The application-level handler for rendering.
virtual void on_input_event(const Event &ev)
Default event handler for input events.
virtual void on_render_device_reset(const Event &ev)
virtual void on_app_quit(const Event &ev)
The event handler for when a request for halting program execution occurs.
uint32 ticks(void)
Obtain the current timestamp.
bool app_state_
Global application state.
virtual void on_drag_drop(const Event &ev)
Hints
An enumeration of platform or application scope features available for explicit request of enabling o...
@ OSX_DISABLE_FULLSCREEN_SPACES
SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES.
@ OSX_DISABLE_MINIMIZE_ON_LOSS_FOCUS
SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS.
virtual void on_render_targets_reset(const Event &ev)
void set_event_handler(EventHandler &evt_handler)
Install the event handler used by the interface.
std::unique_ptr< StateMachine > state_
State machine manager.
virtual void quit(void)
End program execution.
SDLApp(void)
Default constructor; initialize with the default set of hints.
virtual void on_user_event(const Event &ev)
The default event handler for user-defined events.
virtual bool running(void)
Query status of the application state.
Finite State Machine manager class.