Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

vrj::GlProcAppWrapper Class Reference

Class to wrap a bunch of callback method for a GL app. More...

#include <GlProcApp.h>

Inheritance diagram for vrj::GlProcAppWrapper:

Inheritance graph
[legend]
Collaboration diagram for vrj::GlProcAppWrapper:

Collaboration graph
[legend]
List of all members.

Public Types

typedef boost::function0<
void > 
callback_t

Public Methods

 GlProcAppWrapper ()
 Type for callbacks. More...

virtual ~GlProcAppWrapper ()
void setDrawMethod (callback_t f)
void setContextInitMethod (callback_t f)
void setBufferPredrawMethod (callback_t f)
void setPreFrameMethod (callback_t f)
void setPostFrameMethod (callback_t f)
void setIntraFrameMethod (callback_t f)
virtual void draw ()
 Function to draw the scene. More...

virtual void contextInit ()
 Function that is called immediately after a new context is created. More...

virtual void bufferPreDraw ()
 Function that is called once for each frame buffer of a gl context. More...

virtual void preFrame ()
 Function called before the Juggler frame starts. More...

virtual void intraFrame ()
 Function called during the application's drawing time. More...

virtual void postFrame ()
 Function called before updating trackers but after the frame is complete. More...


Protected Attributes

callback_t mDrawMethod
callback_t mContextInit
callback_t mPreframeMethod
callback_t mPostframeMethod
callback_t mIntraframeMethod
callback_t mBufferPredrawMethod

Detailed Description

Class to wrap a bunch of callback method for a GL app.

Definition at line 45 of file GlProcApp.h.


Member Typedef Documentation

typedef boost::function0<void> vrj::GlProcAppWrapper::callback_t
 

Definition at line 48 of file GlProcApp.h.

Referenced by setBufferPredrawMethod, setContextInitMethod, setDrawMethod, setIntraFrameMethod, setPostFrameMethod, and setPreFrameMethod.


Constructor & Destructor Documentation

vrj::GlProcAppWrapper::GlProcAppWrapper   [inline]
 

Type for callbacks.

Definition at line 51 of file GlProcApp.h.

00052    {;}

virtual vrj::GlProcAppWrapper::~GlProcAppWrapper   [inline, virtual]
 

Definition at line 53 of file GlProcApp.h.

00054    {;}


Member Function Documentation

void vrj::GlProcAppWrapper::setDrawMethod callback_t    f [inline]
 

Definition at line 57 of file GlProcApp.h.

References callback_t, and mDrawMethod.

00058    { mDrawMethod = f; }

void vrj::GlProcAppWrapper::setContextInitMethod callback_t    f [inline]
 

Definition at line 59 of file GlProcApp.h.

References callback_t, and mContextInit.

00060    { mContextInit = f; }

void vrj::GlProcAppWrapper::setBufferPredrawMethod callback_t    f [inline]
 

Definition at line 61 of file GlProcApp.h.

References callback_t, and mBufferPredrawMethod.

00062    { mBufferPredrawMethod = f; }

void vrj::GlProcAppWrapper::setPreFrameMethod callback_t    f [inline]
 

Definition at line 63 of file GlProcApp.h.

References callback_t, and mPreframeMethod.

00064    { mPreframeMethod = f; }

void vrj::GlProcAppWrapper::setPostFrameMethod callback_t    f [inline]
 

Definition at line 65 of file GlProcApp.h.

References callback_t, and mPostframeMethod.

00066    { mPostframeMethod = f; }

void vrj::GlProcAppWrapper::setIntraFrameMethod callback_t    f [inline]
 

Definition at line 67 of file GlProcApp.h.

References callback_t, and mIntraframeMethod.

00068    { mIntraframeMethod = f; }

virtual void vrj::GlProcAppWrapper::draw   [inline, virtual]
 

Function to draw the scene.

Override this function with the user draw routine.

Precondition:
OpenGL state has correct transformation and buffer selected.
Postcondition:
The current scene has been drawn.

Implements vrj::GlApp.

Definition at line 71 of file GlProcApp.h.

References mDrawMethod.

00072    {
00073       if (!mDrawMethod.empty())
00074       {  mDrawMethod(); }
00075    }

virtual void vrj::GlProcAppWrapper::contextInit   [inline, virtual]
 

Function that is called immediately after a new context is created.

Use this function to create context specific data structures. i.e. Display lists, Texture objects, etc.

Precondition:
The OpenGL context has been set to the new context.
Postcondition:
Application has completed in initialization the user wishes.

Reimplemented from vrj::GlApp.

Definition at line 77 of file GlProcApp.h.

References mContextInit.

00078    {
00079       if (!mContextInit.empty())
00080       {  mContextInit(); }
00081    }

virtual void vrj::GlProcAppWrapper::bufferPreDraw   [inline, virtual]
 

Function that is called once for each frame buffer of a gl context.

This function is executed after contextInit() (if needed) but before contextPreDraw(). It is called once per framebuffer (see note).

Precondition:
The OpenGL context has been set to the context for drawing
Postcondition:
User application has executed any commands that need to only be executed once per context, per buffer, per frame
Note:
This function is designed to be used when you want to do something only once per frame buffer (i.e. once for left buffer, once for right buffer)
Ex: glClear's need to be done in this method

Reimplemented from vrj::GlApp.

Definition at line 83 of file GlProcApp.h.

References mBufferPredrawMethod.

00084    {
00085       if (!mBufferPredrawMethod.empty())
00086       {  mBufferPredrawMethod(); }
00087    }

virtual void vrj::GlProcAppWrapper::preFrame   [inline, virtual]
 

Function called before the Juggler frame starts.

Called after tracker update but before start of a new frame.

Reimplemented from vrj::App.

Definition at line 89 of file GlProcApp.h.

References mPreframeMethod.

00090    {
00091       if (!mPreframeMethod.empty())
00092       {  mPreframeMethod(); }
00093    }

virtual void vrj::GlProcAppWrapper::intraFrame   [inline, virtual]
 

Function called during the application's drawing time.

Reimplemented from vrj::App.

Definition at line 95 of file GlProcApp.h.

References mIntraframeMethod.

00096    {
00097       if (!mIntraframeMethod.empty())
00098       {  mIntraframeMethod(); }
00099    }

virtual void vrj::GlProcAppWrapper::postFrame   [inline, virtual]
 

Function called before updating trackers but after the frame is complete.

Reimplemented from vrj::App.

Definition at line 101 of file GlProcApp.h.

References mPostframeMethod.

00102    {
00103       if (!mPostframeMethod.empty())
00104       {  mPostframeMethod(); }
00105    }


Member Data Documentation

callback_t vrj::GlProcAppWrapper::mDrawMethod [protected]
 

Definition at line 108 of file GlProcApp.h.

Referenced by draw, and setDrawMethod.

callback_t vrj::GlProcAppWrapper::mContextInit [protected]
 

Definition at line 109 of file GlProcApp.h.

Referenced by contextInit, and setContextInitMethod.

callback_t vrj::GlProcAppWrapper::mPreframeMethod [protected]
 

Definition at line 110 of file GlProcApp.h.

Referenced by preFrame, and setPreFrameMethod.

callback_t vrj::GlProcAppWrapper::mPostframeMethod [protected]
 

Definition at line 111 of file GlProcApp.h.

Referenced by postFrame, and setPostFrameMethod.

callback_t vrj::GlProcAppWrapper::mIntraframeMethod [protected]
 

Definition at line 112 of file GlProcApp.h.

Referenced by intraFrame, and setIntraFrameMethod.

callback_t vrj::GlProcAppWrapper::mBufferPredrawMethod [protected]
 

Definition at line 113 of file GlProcApp.h.

Referenced by bufferPreDraw, and setBufferPredrawMethod.


The documentation for this class was generated from the following file:
Generated on Sun May 2 15:11:11 2004 for VR Juggler by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002