29#ifndef NOMLIB_SYSTEM_SDLAPP_HPP
30#define NOMLIB_SYSTEM_SDLAPP_HPP
35#include "nomlib/config.hpp"
36#include "nomlib/system/Timer.hpp"
56 typedef self_type* raw_ptr;
57 typedef std::shared_ptr<self_type> shared_ptr;
81 bool app_state(
void )
const;
83 virtual bool on_init(
void );
86 virtual sint
Run(
void );
121 void set_app_state(
bool state );
123 bool show_fps (
void )
const;
124 void set_show_fps (
bool toggle );
157 virtual void on_window_shown(
const Event& ev);
159 virtual void on_window_hidden(
const Event& ev);
161 virtual void on_window_exposed(
const Event& ev);
163 virtual void on_window_moved(
const Event& ev);
165 virtual void on_window_resized(
const Event& ev);
167 virtual void on_window_size_changed(
const Event& ev);
169 virtual void on_window_minimized(
const Event& ev);
171 virtual void on_window_maximized(
const Event& ev);
173 virtual void on_window_restored(
const Event& ev);
175 virtual void on_window_mouse_focus(
const Event& ev);
177 virtual void on_window_mouse_focus_lost(
const Event& ev);
179 virtual void on_window_keyboard_focus(
const Event& ev);
181 virtual void on_window_keyboard_focus_lost(
const Event& ev);
218 virtual void on_render_device_reset(
const Event& ev);
233 bool initialize( uint32 flags );
235 void on_app_event(
const Event& ev);
237 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_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.