OpenEnroth 73e68f7
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
SdlPlatform Class Reference

#include <SdlPlatform.h>

Inheritance diagram for SdlPlatform:
Platform

Public Member Functions

 SdlPlatform ()
 
virtual ~SdlPlatform ()
 
virtual std::unique_ptr< PlatformWindowcreateWindow () override
 
virtual std::unique_ptr< PlatformEventLoopcreateEventLoop () override
 
virtual std::vector< PlatformGamepad * > gamepads () override
 
virtual void setCursorShown (bool cursorShown) override
 
virtual bool isCursorShown () const override
 
virtual std::vector< RectidisplayGeometries () const override
 
virtual void showMessageBox (const std::string &title, const std::string &message) const override
 
virtual int64_t tickCount () const override
 
- Public Member Functions inherited from Platform
virtual ~Platform ()=default
 
virtual std::unique_ptr< PlatformWindowcreateWindow ()=0
 
virtual std::unique_ptr< PlatformEventLoopcreateEventLoop ()=0
 
virtual std::vector< PlatformGamepad * > gamepads ()=0
 
virtual void setCursorShown (bool cursorShown)=0
 
virtual bool isCursorShown () const =0
 
virtual std::vector< RectidisplayGeometries () const =0
 
virtual void showMessageBox (const std::string &title, const std::string &message) const =0
 
virtual int64_t tickCount () const =0
 

Private Attributes

bool _initialized = false
 
std::unique_ptr< SdlPlatformSharedState_state
 

Additional Inherited Members

- Static Public Member Functions inherited from Platform
static std::unique_ptr< PlatformcreateStandardPlatform ()
 

Constructor & Destructor Documentation

◆ SdlPlatform()

SdlPlatform::SdlPlatform ( )

◆ ~SdlPlatform()

SdlPlatform::~SdlPlatform ( )
virtual

Member Function Documentation

◆ createEventLoop()

std::unique_ptr< PlatformEventLoop > SdlPlatform::createEventLoop ( )
overridevirtual

Creates a new event loop.

Returns
Newly created event loop, or nullptr on error.

Implements Platform.

◆ createWindow()

std::unique_ptr< PlatformWindow > SdlPlatform::createWindow ( )
overridevirtual

Creates a new platform window.

Returns
Newly created window, or nullptr on error.

Implements Platform.

◆ displayGeometries()

std::vector< Recti > SdlPlatform::displayGeometries ( ) const
overridevirtual
Returns
Geometries of all monitors on current system, or an empty vector in case of an error.

Implements Platform.

◆ gamepads()

std::vector< PlatformGamepad * > SdlPlatform::gamepads ( )
overridevirtual

This function lists the gamepads currently connected to the system. The gamepad objects themselves are owned by the platform and are destroyed automatically when disconnected. If you're caching them in your code, then make sure to subscribe to EVENT_GAMEPAD_DISCONNECTED, it is guaranteed to fire before the gamepad object is destroyed.

Returns
All gamepads connected to the system.

Implements Platform.

◆ isCursorShown()

bool SdlPlatform::isCursorShown ( ) const
overridevirtual

Getter for setCursorShown.

Returns
Whether the system cursor is currently shown on top of windows created by this platform.

Implements Platform.

◆ setCursorShown()

void SdlPlatform::setCursorShown ( bool  cursorShown)
overridevirtual

Shows / hides system cursor (on top of all windows created by this platform).

Parameters
cursorShownWhether to show the system cursor.

Implements Platform.

◆ showMessageBox()

void SdlPlatform::showMessageBox ( const std::string &  title,
const std::string &  message 
) const
overridevirtual

Shows a modal message box.

Parameters
titleTitle of the message box window.
messageMessage to display.

Implements Platform.

◆ tickCount()

int64_t SdlPlatform::tickCount ( ) const
overridevirtual
Returns
Current value of a monotonic clock in milliseconds.

Implements Platform.

Member Data Documentation

◆ _initialized

bool SdlPlatform::_initialized = false
private

◆ _state

std::unique_ptr<SdlPlatformSharedState> SdlPlatform::_state
private

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