Simple base class to support demos and test programs. More...
Classes | |
class | glut::DisplayLine |
represents a single (small) status line to overlay in the demo More... | |
class | glut::DemoHost |
You'll need to provide a class that inherits from DemoHost. More... | |
Typedefs | |
typedef std::vector< smart_ptr < DisplayLine > > | glut::vec_display_lines_t |
Functions | |
virtual | glut::DisplayLine::~DisplayLine (void) throw () |
virtual ePosition | glut::DisplayLine::getPosition (void)=0 |
virtual const char * | glut::DisplayLine::getText (void)=0 |
virtual | glut::DemoHost::~DemoHost (void) throw () |
virtual int | glut::DemoHost::getWidth (void) |
virtual int | glut::DemoHost::getHeight (void) |
virtual float | glut::DemoHost::getDelta (void) |
virtual void | glut::DemoHost::onInit (void) |
host can perform any pre-rendering work here | |
virtual bool | glut::DemoHost::displayAxes (void) |
want to display the tricolor xyz axes? | |
virtual bool | glut::DemoHost::displayQueuedPolys (void) |
want to draw queued (transparent) polygons? | |
virtual void | glut::DemoHost::getDisplayLines (OUT vec_display_lines_t &lines) |
host can provide additional display lines | |
virtual void | glut::DemoHost::onShutdown (void) |
host is notified just before shutdown | |
virtual void | glut::DemoHost::onCursor (IN int x, IN int y) |
host is notified that mouse has moved | |
virtual void | glut::DemoHost::onButton (IN int button, IN int state, IN int x, IN int y) |
host is notified that mouse button has been pressed/released | |
virtual void | glut::DemoHost::onKey (IN int key, IN int mods) |
host is notified that a key has been pressed | |
virtual void | glut::DemoHost::onIdle (IN float dt) |
host is notified per frame, and is told the time delta in seconds | |
virtual void | glut::DemoHost::display3D (IN const render_context_t &rc, IN RenderQueue *rq) |
host is notified that GL is set up for 3D drawing (called per frame) | |
virtual void | glut::DemoHost::display2D (IN int width, IN int height) |
host is notified that GL is set up for 2D drawing (called per frame) | |
void | glut::startDemo (IN int argc, IN const char *argv[], IN const char *title, IN DemoHost *host) |
use this method to kick off a quick demo (provide an instance of your own host, inherited from glut::DemoHost ). |
Simple base class to support demos and test programs.
typedef std::vector<smart_ptr<DisplayLine> > glut::vec_display_lines_t |
Definition at line 75 of file glut-demo.h.
glut::DisplayLine::~DisplayLine | ( | void | ) | throw () [virtual, inherited] |
Definition at line 38 of file glut-demo.cpp.
virtual ePosition glut::DisplayLine::getPosition | ( | void | ) | [pure virtual, inherited] |
virtual const char* glut::DisplayLine::getText | ( | void | ) | [pure virtual, inherited] |
glut::DemoHost::~DemoHost | ( | void | ) | throw () [virtual, inherited] |
Definition at line 710 of file glut-demo.cpp.
virtual int glut::DemoHost::getWidth | ( | void | ) | [inline, virtual, inherited] |
Definition at line 97 of file glut-demo.h.
virtual int glut::DemoHost::getHeight | ( | void | ) | [inline, virtual, inherited] |
Definition at line 98 of file glut-demo.h.
virtual float glut::DemoHost::getDelta | ( | void | ) | [inline, virtual, inherited] |
Definition at line 99 of file glut-demo.h.
virtual void glut::DemoHost::onInit | ( | void | ) | [inline, virtual, inherited] |
host can perform any pre-rendering work here
Definition at line 102 of file glut-demo.h.
virtual bool glut::DemoHost::displayAxes | ( | void | ) | [inline, virtual, inherited] |
want to display the tricolor xyz axes?
Definition at line 105 of file glut-demo.h.
virtual bool glut::DemoHost::displayQueuedPolys | ( | void | ) | [inline, virtual, inherited] |
want to draw queued (transparent) polygons?
Definition at line 108 of file glut-demo.h.
virtual void glut::DemoHost::getDisplayLines | ( | OUT vec_display_lines_t & | lines | ) | [inline, virtual, inherited] |
host can provide additional display lines
Definition at line 111 of file glut-demo.h.
virtual void glut::DemoHost::onShutdown | ( | void | ) | [inline, virtual, inherited] |
host is notified just before shutdown
Definition at line 115 of file glut-demo.h.
virtual void glut::DemoHost::onCursor | ( | IN int | x, | |
IN int | y | |||
) | [inline, virtual, inherited] |
host is notified that mouse has moved
Definition at line 118 of file glut-demo.h.
virtual void glut::DemoHost::onButton | ( | IN int | button, | |
IN int | state, | |||
IN int | x, | |||
IN int | y | |||
) | [inline, virtual, inherited] |
host is notified that mouse button has been pressed/released
Definition at line 121 of file glut-demo.h.
virtual void glut::DemoHost::onKey | ( | IN int | key, | |
IN int | mods | |||
) | [inline, virtual, inherited] |
host is notified that a key has been pressed
Definition at line 124 of file glut-demo.h.
virtual void glut::DemoHost::onIdle | ( | IN float | dt | ) | [inline, virtual, inherited] |
host is notified per frame, and is told the time delta in seconds
Definition at line 127 of file glut-demo.h.
virtual void glut::DemoHost::display3D | ( | IN const render_context_t & | rc, | |
IN RenderQueue * | rq | |||
) | [inline, virtual, inherited] |
host is notified that GL is set up for 3D drawing (called per frame)
Definition at line 130 of file glut-demo.h.
virtual void glut::DemoHost::display2D | ( | IN int | width, | |
IN int | height | |||
) | [inline, virtual, inherited] |
host is notified that GL is set up for 2D drawing (called per frame)
Definition at line 134 of file glut-demo.h.
void glut::startDemo | ( | IN int | argc, | |
IN const char * | argv[], | |||
IN const char * | title, | |||
IN DemoHost * | host | |||
) |
use this method to kick off a quick demo (provide an instance of your own host, inherited from glut::DemoHost ).
this routine does not return. It is fine to leak your DemoHost object, although better to wrap it with a smart_ptr<T>.