version 3.3

VRS::GlutCanvas Class Reference

#include <vrs/glut/glutcanvas.h>

Inheritance diagram for VRS::GlutCanvas:

VRS::GLCanvas VRS::Canvas VRS::Manager VRS::SharedObj VRS::Visitable

List of all members.

Public Member Functions

 GlutCanvas (const std::string &name, unsigned int width, unsigned int height, int properties=GLCanvas::RGBDD, TechniqueProcessor *techniqueprocessor=NULL, bool createNow=true)
 < VRS canvas based on GLUT
virtual ~GlutCanvas ()
virtual void setSize (unsigned int width, unsigned int height)
virtual unsigned int getWidth () const
virtual unsigned int getHeight () const
virtual int getProperties () const
virtual void makeContextCurrent ()
 Hook for subclasses, should make the correct rendering context current.
virtual void create ()
virtual void destroy ()
int windowId () const
 Returns the internal GLUT window identifier.
virtual void setCursor (Cursor::Shape cursor)
 Sets the cursor displayed over the canvas immediately to one of the predefined cursor shapes.
 VRS_TYPEINFO (GlutCanvas, GLCanvas)

Protected Member Functions

virtual void finishRedisplay ()
 called after OpenGL redisplay


Constructor & Destructor Documentation

VRS::GlutCanvas::GlutCanvas ( const std::string &  name,
unsigned int  width,
unsigned int  height,
int  properties = GLCanvas::RGBDD,
TechniqueProcessor techniqueprocessor = NULL,
bool  createNow = true 
)

< VRS canvas based on GLUT

virtual VRS::GlutCanvas::~GlutCanvas (  )  [virtual]

The name is used as window title for the GLUT window. The properties specify the capabilities of the OpenGL framebuffer, for example, RGBD means color + double buffer, RGBDD means color + double + depth buffer, RGBDDS means color+double+depth+stencil buffer. RGBAD means color + alpha + double buffer, RGBADD means color + alpha + double + depth buffer, RGBADDS means color+alpha+double+depth+stencil buffer. If no rendering technique is specified, an OpenGL technique processor will be used. The construction of the actual GLUT canvas can be delayed if the createNow flag is set to false. In this case, the create method must be called some time later, whereby GLUT defaults and display mode may be setup inbetween.


Member Function Documentation

virtual void VRS::GlutCanvas::setSize ( unsigned int  width,
unsigned int  height 
) [virtual]

sets the size of the GlutCanvas

Implements VRS::Canvas.

virtual unsigned int VRS::GlutCanvas::getWidth (  )  const [virtual]

gets the width of the GlutCanvas

Implements VRS::Canvas.

virtual unsigned int VRS::GlutCanvas::getHeight (  )  const [virtual]

gets the height of the GlutCanvas

Implements VRS::Canvas.

virtual int VRS::GlutCanvas::getProperties (  )  const [virtual]

returns the capabilities of the OpenGL framebuffer.

Implements VRS::GLCanvas.

virtual void VRS::GlutCanvas::makeContextCurrent (  )  [virtual]

Hook for subclasses, should make the correct rendering context current.

Since makeContextCurrent should be the first action in order to prepare a redisplay, it should use as least ressources as possible (e.g. the engine). The creation of the engine (and other ressources) can not be forced by this abstract base class, so there may be no engine when makeContextCurrent is called.

Reimplemented from VRS::Canvas.

virtual void VRS::GlutCanvas::create (  )  [virtual]

Initializes the GLCanvas, so that the scene graph can be evaluated. An EngineGL is created and initialized. Also, a viewport attribute and a Processor are inserted at the beginning of the scene root node. create will also call shareContext (if there is a canvas to share the context with), which should take care of the necessary steps in order to actually share the openGL context. Note that there is standard implementation for shareContext which involves only the EngineGL setSharedContext-method. If the create method is overwritten, create should be called in the overriding create-method.

Reimplemented from VRS::GLCanvas.

virtual void VRS::GlutCanvas::destroy (  )  [virtual]

Explicitly creates (and destroys) the GLUT window attached to this canvas object. The create-method can be called only if the window has not been immediatly created by the constructor.

Reimplemented from VRS::GLCanvas.

int VRS::GlutCanvas::windowId (  )  const

Returns the internal GLUT window identifier.

virtual void VRS::GlutCanvas::setCursor ( Cursor::Shape  cursor  )  [virtual]

Sets the cursor displayed over the canvas immediately to one of the predefined cursor shapes.

This should be overriden in a subclass for the specific GUI toolkit.

Reimplemented from VRS::Canvas.

VRS::GlutCanvas::VRS_TYPEINFO ( GlutCanvas  ,
GLCanvas   
)

virtual void VRS::GlutCanvas::finishRedisplay (  )  [protected, virtual]

called after OpenGL redisplay

invokes Canvas::finishRedisplay and deactivates standard attributes for OpenGL rendering.

Reimplemented from VRS::GLCanvas.


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

Generated on Mon May 21 06:00:17 2012 by Doxygen 1.5.6
© 2001-2010 Hasso-Plattner-Institut | Impressum | Contact