#include <vrj/Draw/OGL/GlApp.h>
Inheritance diagram for vrj::GlApp:


Public Member Functions | |
| GlApp (Kernel *kern=NULL) | |
| virtual | ~GlApp () |
| virtual void | draw ()=0 |
| Function that renders the scene. | |
| virtual void | contextInit () |
| Function that is called immediately after a new context is created. | |
| virtual void | contextClose () |
| Function that is called immediately before a context is closed. | |
| virtual void | contextPreDraw () |
| Function that is called upon entry into the context before rendering. | |
| virtual void | contextPostDraw () |
| Function that is called upon exit of the context after rendering. | |
| virtual void | bufferPreDraw () |
| Function that is called once for each frame buffer of an OpenGL context. | |
| virtual void | pipePreDraw () |
| Function that is called at the beginning of the drawing of each pipe. | |
Factory functions | |
| virtual DrawManager * | getDrawManager () |
| Get the DrawManager to use. | |
This defines the base class from which OpenGL-based application classes should be derived. The interface given is what the kernel and the OpenGL Draw Manager expect in order to interact with the application.
The control loop will look similar to this:
glapp_obj->contextInit(); // called for each context while (drawing) { glapp_obj->preFrame(); glapp_obj->latePreFrame(); glapp_obj->bufferPreDraw(); // called for each draw buffer glapp_obj->contextPreDraw(); // called for each context glapp_obj->draw(); // called for each viewport glapp_obj->contextPostDraw(); // called for each context glapp_obj->intraFrame(); // called in parallel to the draw functions sync(); glapp_obj->postFrame(); updateAllDevices(); } glapp_obj->contextClose(); // called for each context
Definition at line 80 of file GlApp.h.
| vrj::GlApp::GlApp | ( | Kernel * | kern = NULL |
) |
| vrj::GlApp::~GlApp | ( | ) | [virtual] |
| virtual void vrj::GlApp::draw | ( | ) | [pure virtual] |
Function that renders the scene.
Override this function with the user rendering routine.
Implemented in vrj::GlProcAppWrapper, vrj::OpenSGApp, and vrj::OsgApp.
| virtual void vrj::GlApp::contextInit | ( | ) | [inline, virtual] |
Function that is called immediately after a new context is created.
Use this function to create context-specific data structures such as display lists and texture objects that are known to be required when the context is created.
Reimplemented in vrj::GlProcAppWrapper, vrj::OpenSGApp, and vrj::OsgApp.
Definition at line 105 of file GlApp.h.
| virtual void vrj::GlApp::contextClose | ( | ) | [inline, virtual] |
Function that is called immediately before a context is closed.
Use this function to clean up any context-specific data structures.
Reimplemented in vrj::OsgApp.
Definition at line 112 of file GlApp.h.
| virtual void vrj::GlApp::contextPreDraw | ( | ) | [inline, virtual] |
Function that is called upon entry into the context before rendering.
This can be used to allocate context-specific data dynamically.
Reimplemented in vrj::OpenSGApp, and vrj::OsgApp.
Definition at line 126 of file GlApp.h.
| virtual void vrj::GlApp::contextPostDraw | ( | ) | [inline, virtual] |
Function that is called upon exit of the context after rendering.
Reimplemented in vrj::OpenSGApp.
Definition at line 134 of file GlApp.h.
| virtual void vrj::GlApp::bufferPreDraw | ( | ) | [inline, virtual] |
Function that is called once for each frame buffer of an OpenGL context.
This function is executed after contextInit() (if needed) but before contextPreDraw(). It is called once per frame buffer (see note).
Reimplemented in vrj::GlProcAppWrapper, vrj::OpenSGApp, and vrj::OsgApp.
Definition at line 152 of file GlApp.h.
| virtual void vrj::GlApp::pipePreDraw | ( | ) | [inline, virtual] |
Function that is called at the beginning of the drawing of each pipe.
Reimplemented in vrj::OsgApp.
Definition at line 164 of file GlApp.h.
Referenced by vrj::GlPipe::controlLoop().
| DrawManager * vrj::GlApp::getDrawManager | ( | ) | [virtual] |
Get the DrawManager to use.
Returns the OpenGL Draw Manager.
Implements vrj::App.
Definition at line 58 of file GlApp.cpp.
Referenced by vrj::OsgApp::draw(), and vrj::OpenSGApp::draw().
1.5.1