Simulant  21.12-574
A portable game engine for Windows, OSX, Linux, Dreamcast, and PSP
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
smlt::Window Class Referenceabstract
Inheritance diagram for smlt::Window:
smlt::Loadable smlt::RenderTarget smlt::EventListenerManager smlt::AndroidWindow smlt::KOSWindow smlt::PSPWindow smlt::SDL2Window

Public Types

typedef std::shared_ptr< Windowptr

Public Member Functions

virtual bool create_window (uint16_t width, uint16_t height, uint8_t bpp, bool fullscreen, bool enable_vsync)
virtual void set_title (const std::string &title)=0
virtual void cursor_position (int32_t &mouse_x, int32_t &mouse_y)=0
virtual void show_cursor (bool cursor_shown=true)=0
virtual void lock_cursor (bool cursor_locked=true)=0
virtual void check_events ()=0
virtual void swap_buffers ()=0
uint16_t width () const override
uint16_t height () const override
bool is_fullscreen () const
bool vsync_enabled () const
float aspect_ratio () const
void set_logging_level (LogLevel level)
void reset ()
 Window::reset. More...
Vec2 coordinate_from_normalized (Ratio rx, Ratio ry)
void on_finger_down (TouchPointID touch_id, float normalized_x, float normalized_y, float pressure=1.0)
void on_finger_up (TouchPointID touch_id, float normalized_x, float normalized_y)
void on_finger_motion (TouchPointID touch_id, float normalized_x, float normalized_y, float dx, float dy)
void on_key_down (KeyboardCode code, ModifierKeyState modifiers)
void on_key_up (KeyboardCode code, ModifierKeyState modifiers)
void on_game_controller_button_down (GameControllerIndex index, JoystickButton button)
void on_game_controller_button_up (GameControllerIndex index, JoystickButton button)
std::size_t screen_count () const
Screenscreen (const std::string &name) const
void each_screen (std::function< void(std::string, Screen *)> callback)
Screen_create_screen (const std::string &name, uint16_t width, uint16_t height, ScreenFormat format, uint16_t refresh_rate)
void _destroy_screen (const std::string &name)
virtual bool _init_window ()=0
virtual bool _init_renderer (Renderer *renderer)=0
bool initialize_assets_and_devices ()
void _clean_up ()
StageNodeaudio_listener ()
void set_audio_listener (StageNode *node)
bool has_explicit_audio_listener () const
bool has_context () const
bool has_focus () const
void set_has_focus (bool v=true)
void create_panels ()
void destroy_panels ()
void set_escape_to_quit (bool value=true)
bool escape_to_quit_enabled () const
void register_panel (uint8_t function_key, std::shared_ptr< Panel > panel)
void unregister_panel (uint8_t function_key)
void toggle_panel (uint8_t id)
void activate_panel (uint8_t id)
void deactivate_panel (uint8_t id)
bool panel_is_active (uint8_t id)
 S_DEFINE_PROPERTY (application, &Window::application_)
 S_DEFINE_PROPERTY (renderer, &Window::renderer_)
 S_DEFINE_PROPERTY (data, &Window::data_carrier_)
 S_DEFINE_PROPERTY (input, &Window::input_manager_)
 S_DEFINE_PROPERTY (input_state, &Window::input_state_)
 S_DEFINE_PROPERTY (compositor, &Window::compositor_)
- Public Member Functions inherited from smlt::RenderTarget
virtual void set_clear_every_frame (uint32_t clear_flags=BUFFER_CLEAR_ALL, const smlt::Colour &colour=smlt::Colour::BLACK)
virtual uint32_t clear_every_frame_flags () const
virtual smlt::Colour clear_every_frame_colour () const
- Public Member Functions inherited from smlt::EventListenerManager
void register_event_listener (EventListener *listener)
void unregister_event_listener (EventListener *listener)
void each_event_listener (std::function< void(EventListener *)> callback)

Static Public Member Functions

template<typename T >
static std::shared_ptr< Windowcreate (Application *app)

Protected Member Functions

void set_vsync_enabled (bool vsync)
void set_width (uint16_t width)
void set_height (uint16_t height)
void set_bpp (uint16_t bpp)
void set_fullscreen (bool val)
virtual void destroy_window ()=0
void set_has_context (bool value=true)
thread::Mutexcontext_lock ()
void set_application (Application *app)
void update_screens (float dt)
InputStateget_input_state ()
InputState_input_state () const
virtual void game_controller_start_rumble (GameController *controller, RangeValue< 0, 1 > low_rumble, RangeValue< 0, 1 > high_rumble, const smlt::Seconds &duration)
virtual void game_controller_stop_rumble (GameController *controller)

Protected Attributes

std::shared_ptr< Rendererrenderer_
sig::Connection update_conn_


class Screen
class Application
class GameController

Member Function Documentation

◆ create_panels()

void smlt::Window::create_panels ( )

Recreates the debugging panels (e.g stats)

◆ destroy_panels()

void smlt::Window::destroy_panels ( )

Destroys the panels

◆ has_context()

bool smlt::Window::has_context ( ) const

Returns true if the renderer has a valid context

◆ has_focus()

bool smlt::Window::has_focus ( ) const

Returns true if the window currently has focus

◆ reset()

void smlt::Window::reset ( )


Destroys all everying and resets the window to its original state.

◆ set_has_focus()

void smlt::Window::set_has_focus ( bool  v = true)

Sets whether or not the window has focus, this should not be called by user code directly.

The documentation for this class was generated from the following files: