Public Member Functions | Protected Member Functions | Protected Attributes

Gui Class Reference

GUI class. More...

#include <Gui.h>

List of all members.

Public Member Functions

 Gui (IRender &render, IPhysic &physic, pMouseDevice mouse, const MouseMap &mousemap)
 Contructor.
 ~Gui (void)
pIControl createLabel (float x, float y, float width, float height, int textureIndex)
 Creates a Label object and returns a reference to it.
pIControl createButton (float x, float y, float width, float height, void callback(pIControl), int textureIndex)
 Creates a Button object and returns a reference to it.
void setGuiTexture (wchar *textureColor)
 Sets the gui texture for all controls.
void addControl (pIControl)
 Adds the supplied control to the current GUI.
void update ()
void setUpStatusLabels ()
 Loads Status labels for wireframe, texture and camera modes.
void showStatusLabel (int index)
 Displays the specified status label.
void hideAllStatusLabels ()
 hides all status labels
void showFPS ()
 Show the current frames per second.
void hideFPS ()
 Hides frame rate count again.
void setFPSValue (int fps)
 Sets the current frame rate.
void showWinnerLabel ()
 Displays the Winner label.

Protected Member Functions

bool loadTextureData (const wchar *colorFilename, const wchar *normalFilename, const wchar *heightFilename, TextureData &out)
 loads texture data from files
bool loadUnknown (const wchar *filename, int &width, int &height, Pixel **outData)
 determines filetype and runs appropriate method
bool loadBMP (const wchar *filename, int &width, int &height, Pixel **outData)
 loads texture data from bitmap
bool loadTGA (const wchar *filename, int &width, int &height, Pixel **outData)
 load texture data from tga
uint ShiftRightByMask (uint Color, uint Mask, uint DistributeToBits=8)

Protected Attributes

pITexture m_guiTexture
int m_numControls
std::vector< pIControlm_controls
pMouseDevice m_mouse
MouseMap m_mouseMap
IPhysicm_physic
IRenderm_render
pIControl m_statusLabels [10]
pIControl m_fpsLabel [3]
pIControl m_winnerLabel

Detailed Description

GUI class.

Definition at line 18 of file Gui.h.


Constructor & Destructor Documentation

Gui::Gui ( IRender render,
IPhysic physic,
pMouseDevice  mouse,
const MouseMap mousemap 
)

Contructor.

Definition at line 4 of file Gui.cpp.

Gui::~Gui ( void   ) 

Definition at line 10 of file Gui.cpp.


Member Function Documentation

void Gui::addControl ( pIControl  control  ) 

Adds the supplied control to the current GUI.

Definition at line 27 of file Gui.cpp.

pIControl Gui::createButton ( float  x,
float  y,
float  width,
float  height,
void   callbackpIControl,
int  textureIndex 
)

Creates a Button object and returns a reference to it.

Definition at line 155 of file Gui.cpp.

pIControl Gui::createLabel ( float  x,
float  y,
float  width,
float  height,
int  textureIndex 
)

Creates a Label object and returns a reference to it.

Definition at line 47 of file Gui.cpp.

void Gui::hideAllStatusLabels (  ) 

hides all status labels

Definition at line 254 of file Gui.cpp.

void Gui::hideFPS (  ) 

Hides frame rate count again.

Definition at line 266 of file Gui.cpp.

bool Gui::loadBMP ( const wchar filename,
int &  width,
int &  height,
Pixel **  outData 
) [protected]

loads texture data from bitmap

Definition at line 523 of file Gui.cpp.

bool Gui::loadTextureData ( const wchar colorFilename,
const wchar normalFilename,
const wchar heightFilename,
TextureData out 
) [protected]

loads texture data from files

Definition at line 278 of file Gui.cpp.

bool Gui::loadTGA ( const wchar filename,
int &  width,
int &  height,
Pixel **  outData 
) [protected]

load texture data from tga

bool Gui::loadUnknown ( const wchar filename,
int &  width,
int &  height,
Pixel **  outData 
) [protected]

determines filetype and runs appropriate method

Definition at line 397 of file Gui.cpp.

void Gui::setFPSValue ( int  fps  ) 

Sets the current frame rate.

Definition at line 270 of file Gui.cpp.

void Gui::setGuiTexture ( wchar textureColor  ) 

Sets the gui texture for all controls.

Definition at line 35 of file Gui.cpp.

void Gui::setUpStatusLabels (  ) 

Loads Status labels for wireframe, texture and camera modes.

Definition at line 221 of file Gui.cpp.

uint Gui::ShiftRightByMask ( uint  Color,
uint  Mask,
uint  DistributeToBits = 8 
) [protected]

Definition at line 488 of file Gui.cpp.

void Gui::showFPS (  ) 

Show the current frames per second.

Definition at line 261 of file Gui.cpp.

void Gui::showStatusLabel ( int  index  ) 

Displays the specified status label.

Definition at line 246 of file Gui.cpp.

void Gui::showWinnerLabel (  )  [inline]

Displays the Winner label.

Definition at line 60 of file Gui.h.

void Gui::update ( void   ) 

Updates the GUI. Checks for clicks and executes callback functions accordingly.

Definition at line 14 of file Gui.cpp.


Member Data Documentation

std::vector<pIControl> Gui::m_controls [protected]

Definition at line 77 of file Gui.h.

pIControl Gui::m_fpsLabel[3] [protected]

Definition at line 85 of file Gui.h.

Definition at line 74 of file Gui.h.

Definition at line 78 of file Gui.h.

Definition at line 79 of file Gui.h.

int Gui::m_numControls [protected]

Definition at line 76 of file Gui.h.

IPhysic& Gui::m_physic [protected]

Definition at line 81 of file Gui.h.

IRender& Gui::m_render [protected]

Definition at line 82 of file Gui.h.

pIControl Gui::m_statusLabels[10] [protected]

Definition at line 84 of file Gui.h.

Definition at line 86 of file Gui.h.


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