sgPanel Class Reference

#include <sgPanel.h>

List of all members.

Public Member Functions

 sgPanel (sgPanel *p, sgPanel *n)
 ~sgPanel ()
sgPanelcreatePanel ()
void addImage (const char *imgtexfile, const sgVector2 &pos, const sgVector2 &size, const char *vs=NULL, const char *fs=NULL)
void addText (const char *str, const sgVector2 &charsize, const sgVector2 &pos, const sgVector2 &size, const char *fonttexfile, const char *vs=NULL, const char *fs=NULL)
void destroy ()
void destroyAll ()

Public Attributes

sgVector2 pos
std::vector< sgPanelElement * > elements
sgPanelprev
sgPanelnext

Detailed Description

Panel class. This class represents a panel which can contain any number of elements.


Constructor & Destructor Documentation

sgPanel::sgPanel ( sgPanel p,
sgPanel n 
)

Constructor. Initializes a panel instance.

Parameters:
p pointer to the previous panel in the list or NULL
n pointer to the next panel in the list or NULL
sgPanel::~sgPanel (  ) 

Deconstructor. The panels deconstructor.


Member Function Documentation

void sgPanel::addImage ( const char *  imgtexfile,
const sgVector2 pos,
const sgVector2 size,
const char *  vs = NULL,
const char *  fs = NULL 
)

Add image element. Adds a new image element to the panel.

Parameters:
imgtexfile file name of the image to display
pos position of the images bottom left corner in pixels, relative to the panel ones
size the size in pixels to display the image with
vs file name of the vertex shader of the type .vsh without the type specifier or NULL to use the default shader
fs file name of the fragment shader of the type .fsh without the type specifier or NULL to use the default shader
void sgPanel::addText ( const char *  str,
const sgVector2 charsize,
const sgVector2 pos,
const sgVector2 size,
const char *  fonttexfile,
const char *  vs = NULL,
const char *  fs = NULL 
)

Add text element. Adds a new text element to the panel.

Parameters:
str the string to display
charsize size in pixels of one character on the font texture
pos position of the texts bottom left corner in pixels, relative to the panel ones
size the size in pixels to display each character with
fonttexfile file name of the font texture to use
vs file name of the vertex shader of the type .vsh without the type specifier or NULL to use the default shader
fs file name of the fragment shader of the type .fsh without the type specifier or NULL to use the default shader
sgPanel * sgPanel::createPanel (  ) 

Create panel. Creates a new panel and puts it into the list of this one, directly behind this one.

Returns:
pointer to the new panel instance
void sgPanel::destroy (  ) 

Destroy. Destroys the panel and removes it from the list.

void sgPanel::destroyAll (  ) 

Destroy all. Destroys all panels in the list.


Member Data Documentation

Elements. An array storing the pointers to all panel elements.

Next. Pointer to the next panel in the list or NULL if this is the last one.

Position. Position of the panel in pixels relative to the screens bottom left corner.

Previous. Pointer to the previous panel in the list or NULL if this is the first one.


The documentation for this class was generated from the following files:
Generated on Thu Jun 3 13:31:04 2010 for iSDGE by  doxygen 1.6.3