GlWindow Class Reference

#include <GlWindow.h>

Inheritance diagram for GlWindow:

EventListener Object

List of all members.

Public Member Functions

 GlWindow (struct screenRes &res, GlRenderer *renderer, bool fullscreen, string titlebar)
 Constructor with fullscreen and titlebar support.
 GlWindow (enum resId newId, string resDisplayName, GlRenderer *renderer, bool fullscreen, string titlebar)
 Constructor with fullscreen and titlebar support.
bool isFullscreen ()
 Returns if application is in fullscreen mode.
bool wantsToQuit ()
 Indicates the state (running or ending).
void setFullscreen (bool fullscreen)
 Set fullscreen.
void addSupportedRes (struct screenRes &newRes)
 Adds a resolution to the list of supported resolutions.
void addSupportedRes (enum resId newId, string displayName)
 Adds a resolution to the list of supported resolutions.
void processEvent (SDL_Event &event)
 A method to deal with SDL_Event.
virtual string toString () const
 Returns a textual representation.
virtual string className () const
 Returns the class name of the object.
virtual enum classId classId () const
 Returns the class id of the object.

Private Member Functions

void init ()
 Performs first initializatoion.
void resize ()
 Performs resize operations.
struct screenRes roundResolution ()
 Finds the next best fullscreen resolution from the list of supported resolutions.
void checkStandardResolution (enum resId id, GLint &width, GLint &height)
 check for standard resolution (load standard dimensions)

Private Attributes

int width
 The width of the window.
int height
 The height of the window.
string titlebar
 The string for the window's titlebar.
bool fullscreen
 Indicates fullscreen mode.
list< struct screenRessupportedRes
 Supported fullscreen resolutions.
struct screenResfsResolution
 Fullscreen resolution.
bool quit
 Indicates end of program.
GlRendererrenderer
 A pointer to the displayed renderer.


Constructor & Destructor Documentation

GlWindow::GlWindow ( struct screenRes res,
GlRenderer renderer,
bool  fullscreen,
string  titlebar 
)

Constructor with fullscreen and titlebar support.

Creates a titled OpenGL window that may be set to fullscreen

Parameters:
res The width and height of the new window
renderer A pointer to the displayed renderer
titlebar The string to be displayed in the titlebar
fullscreen If the parameter is true, the application will be set to fullscreen mode and to windowed mode otherwise

GlWindow::GlWindow ( enum resId  newId,
string  resDisplayName,
GlRenderer renderer,
bool  fullscreen,
string  titlebar 
)

Constructor with fullscreen and titlebar support.

Creates a titled OpenGL window that may be set to fullscreen

Parameters:
res The width and height of the new window
renderer A pointer to the displayed renderer
titlebar The string to be displayed in the titlebar
fullscreen If the parameter is true, the application will be set to fullscreen mode and to windowed mode otherwise


Member Function Documentation

void GlWindow::init (  )  [private]

Performs first initializatoion.

void GlWindow::resize (  )  [private]

Performs resize operations.

struct screenRes GlWindow::roundResolution (  )  [read, private]

Finds the next best fullscreen resolution from the list of supported resolutions.

void GlWindow::checkStandardResolution ( enum resId  id,
GLint &  width,
GLint &  height 
) [private]

check for standard resolution (load standard dimensions)

bool GlWindow::isFullscreen (  ) 

Returns if application is in fullscreen mode.

Returns:
True if the application is in fullscreen mode and false otherwise.

bool GlWindow::wantsToQuit (  ) 

Indicates the state (running or ending).

Returns:
True if the application window is about to terminate and false otherwise

void GlWindow::setFullscreen ( bool  fullscreen  ) 

Set fullscreen.

Parameters:
If true the mode is set to fullscreen, if false the window mode is set

void GlWindow::addSupportedRes ( struct screenRes newRes  ) 

Adds a resolution to the list of supported resolutions.

void GlWindow::addSupportedRes ( enum resId  newId,
string  displayName 
)

Adds a resolution to the list of supported resolutions.

void GlWindow::processEvent ( SDL_Event &  event  )  [virtual]

A method to deal with SDL_Event.

Every EventListener must implement this method to receive and process events. Those will usually be sent by the EventManager which calls this method.

See also:
EventManager

Implements EventListener.

string GlWindow::toString (  )  const [virtual]

Returns a textual representation.

Returns:
a string descriping the run-time object

Implements EventListener.

string GlWindow::className (  )  const [virtual]

Returns the class name of the object.

Returns:
a string with the name of the object's class

Implements EventListener.

enum classId GlWindow::classId (  )  const [virtual]

Returns the class id of the object.

Returns:
an id of the object's class

Implements EventListener.


Member Data Documentation

int GlWindow::width [private]

The width of the window.

int GlWindow::height [private]

The height of the window.

string GlWindow::titlebar [private]

The string for the window's titlebar.

bool GlWindow::fullscreen [private]

Indicates fullscreen mode.

list<struct screenRes> GlWindow::supportedRes [private]

Supported fullscreen resolutions.

struct screenRes* GlWindow::fsResolution [read, private]

Fullscreen resolution.

bool GlWindow::quit [private]

Indicates end of program.

A pointer to the displayed renderer.


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

Generated on Mon Jul 7 13:30:34 2008 for Firefly by  doxygen 1.5.6