fluidvis
Public Member Functions | Static Public Member Functions | Friends | List of all members
sx::SXWindow Class Reference

#include <SX.h>

Inheritance diagram for sx::SXWindow:
sx::SXRenderArea

Public Member Functions

EX SXWindow (const string &name, unsigned int width, unsigned int height)
 
EX ~SXWindow ()
 
EX void removeWindow ()
 
EX void addRenderListener (SXRenderListener &l)
 
EX void deleteRenderListener (SXRenderListener &l)
 
EX void deleteRenderListeners ()
 
EX double getTime () const
 
EX double getDeltaTime () const
 
EX int getMouseX () const
 
EX int getMouseY () const
 
EX double getMouseDeltaX () const
 
EX double getMouseDeltaY () const
 
EX bool hasKey (int key) const
 
EX bool hasMouseKey (MouseButton key) const
 
EX int getWidth () const
 
EX int getHeight () const
 
EX void stopRendering ()
 
EX void setMousePointer (int x, int y)
 
EX void setShowCursor (bool showCursor)
 

Static Public Member Functions

static EX void run ()
 

Friends

void windowKeyUp (unsigned char key, int x, int y)
 
void windowKeyDown (unsigned char key, int x, int y)
 
void windowSpecialKeyUp (int key, int x, int y)
 
void windowSpecialKeyDown (int key, int x, int y)
 
void windowMouseKey (int button, int state, int x, int y)
 
void windowMouseMotion (int x, int y)
 
void windowPassiveMotion (int x, int y)
 
void reshapeAll (int width, int height)
 
void renderAll ()
 
void stopAll ()
 

Detailed Description

A window class temporarily used during building the ShadeX Engine. It's sole purpose serves for implementing and testing the engine's functionality. Future versions will be able to set ab an SX widget offering the functionality for gui frameworks such as Qt.

Constructor & Destructor Documentation

EX sx::SXWindow::SXWindow ( const string &  name,
unsigned int  width,
unsigned int  height 
)

Initializes the window with title name and a width and height. Throws an exception Exception, if the window can't be initialized.

EX sx::SXWindow::~SXWindow ( )

Deconstructor of window. Removes all listeners, and the window, if it removeWindow has not been called yet, and removedWindow is false.

Member Function Documentation

EX void sx::SXWindow::addRenderListener ( SXRenderListener l)

Adds a listener. If the window has been removed, the listener is not added, but deleted. The listener is removed, when the window is removed.

EX void sx::SXWindow::deleteRenderListener ( SXRenderListener l)

Removes a listener, if it's part of the window. Otherwise the listener is not removed.

EX void sx::SXWindow::deleteRenderListeners ( )

removes all listeners, if the window has not been removed yet

EX double sx::SXWindow::getDeltaTime ( ) const
virtual
EX int sx::SXWindow::getHeight ( ) const
virtual
EX double sx::SXWindow::getMouseDeltaX ( ) const
virtual
EX double sx::SXWindow::getMouseDeltaY ( ) const
virtual
EX int sx::SXWindow::getMouseX ( ) const
virtual
EX int sx::SXWindow::getMouseY ( ) const
virtual
EX double sx::SXWindow::getTime ( ) const
virtual
EX int sx::SXWindow::getWidth ( ) const
virtual
EX bool sx::SXWindow::hasKey ( int  key) const
virtual
See also
sx::SXRenderArea::hasKey(int)

Implements sx::SXRenderArea.

EX bool sx::SXWindow::hasMouseKey ( MouseButton  key) const
virtual
See also
sx::SXRenderArea::hasMouseKey(MouseButton)

Implements sx::SXRenderArea.

EX void sx::SXWindow::removeWindow ( )

removes the window, if it has not been removed yet

static EX void sx::SXWindow::run ( )
static

Keeps all open windows in idle mode. Only during the execution of run, the windows can feed their listeners with messages. After the execution of run, all windows are removed.

EX void sx::SXWindow::setMousePointer ( int  x,
int  y 
)
virtual
EX void sx::SXWindow::setShowCursor ( bool  showCursor)
virtual
EX void sx::SXWindow::stopRendering ( )
virtual

Friends And Related Function Documentation

void renderAll ( )
friend

calls listenersRender in all windows

void reshapeAll ( int  width,
int  height 
)
friend

calls listenersReshape in all windows

void stopAll ( )
friend

calls listenersStop in all windows


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