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

#include <NullPlatform.h>

Inheritance diagram for NullPlatform:
Platform

Public Member Functions

 NullPlatform (NullPlatformOptions options)
 
virtual ~NullPlatform ()
 
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

std::unique_ptr< NullPlatformSharedState_state
 
bool _cursorShown = true
 

Additional Inherited Members

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

Constructor & Destructor Documentation

◆ NullPlatform()

NullPlatform::NullPlatform ( NullPlatformOptions  options)
explicit

◆ ~NullPlatform()

NullPlatform::~NullPlatform ( )
virtualdefault

Member Function Documentation

◆ createEventLoop()

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

Creates a new event loop.

Returns
Newly created event loop, or nullptr on error.

Implements Platform.

◆ createWindow()

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

Creates a new platform window.

Returns
Newly created window, or nullptr on error.

Implements Platform.

◆ displayGeometries()

std::vector< Recti > NullPlatform::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 * > NullPlatform::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 NullPlatform::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 NullPlatform::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 NullPlatform::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 NullPlatform::tickCount ( ) const
overridevirtual
Returns
Current value of a monotonic clock in milliseconds.

Implements Platform.

Member Data Documentation

◆ _cursorShown

bool NullPlatform::_cursorShown = true
private

◆ _state

std::unique_ptr<NullPlatformSharedState> NullPlatform::_state
private

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