Lums
Public Member Functions | List of all members
lm::Window Class Reference

This class defines a Window. More...

#include <Window.hpp>

Public Member Functions

LUMS_EXPORTED Window (int w, int h, const char *name="", bool fullscreen=false)
 
void pushEvent (Event &event)
 
void pollEvent (Event &event)
 
void waitEvent (Event &event)
 
LUMS_EXPORTED void resize (int w, int h, bool fullscreen=false)
 
LUMS_EXPORTED bool visible () const
 
LUMS_EXPORTED Vector2i maxSize () const
 
LUMS_EXPORTED void pumpEvent ()
 
LUMS_EXPORTED void swap ()
 
LUMS_EXPORTED ~Window ()
 

Detailed Description

This class defines a Window.

Constructor & Destructor Documentation

LUMS_EXPORTED lm::Window::Window ( int  w,
int  h,
const char *  name = "",
bool  fullscreen = false 
)

Create a new window.

Parameters
wThe width of the window.
hThe height of the window.
nameThe name of the window.
fullscreenTrue to create the window in fullscreen mode
LUMS_EXPORTED lm::Window::~Window ( )

Window dtor

Member Function Documentation

LUMS_EXPORTED Vector2i lm::Window::maxSize ( ) const

Get the maximal window size. This is usualy used to determine a resolution.

Returns
The maximum window size
void lm::Window::pollEvent ( Event event)
inline

Poll an event from the event stack. If the event stack is empty, the event type will be set to Event::Type::None

Parameters
eventA reference to an event, which will be filled with data.
LUMS_EXPORTED void lm::Window::pumpEvent ( )

Pump event from the underlying implementation to the event stack.

void lm::Window::pushEvent ( Event event)
inline

Push an event on the internal event stack.

Parameters
eventThe event to be pushed.
LUMS_EXPORTED void lm::Window::resize ( int  w,
int  h,
bool  fullscreen = false 
)

Resize the window

Parameters
wThe width
hThe height
fullscreenWhether to be in fullscreen mode or not
LUMS_EXPORTED void lm::Window::swap ( )

Swap the current buffer with the backbuffer.

LUMS_EXPORTED bool lm::Window::visible ( ) const

Check if the window is visible. This may be unreliable under some operating systems, like Windows.

Returns
True if the window is visible, false otherwise
void lm::Window::waitEvent ( Event event)
inline

Wait for an event from the event stack. If the event stack is empty, this method will block and wait.

Parameters
eventA reference to an event, which will be filled with data.

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