CSD462 Library Documentation
1.0
15-462/15-662: Computer Graphics (Fall 2015)
|
Provides OpenGL context, window display, and event handling routines. More...
#include <viewer.h>
Public Member Functions | |
Viewer (void) | |
Constructor. More... | |
Viewer (const char *title) | |
Constructor. More... | |
~Viewer (void) | |
Destructor. More... | |
void | init (void) |
Initialize the viewer. More... | |
void | start (void) |
Start the drawing loop of the viewer. More... | |
void | set_renderer (Renderer *renderer) |
Set a user space renderer. More... | |
Provides OpenGL context, window display, and event handling routines.
A user application may draw to the window's context by providing a user renderer. The viewer manages other display components such as the zoom views, text OSD, etc. It also takes care of window event handling and event passing, through which the renderer may interact with user inputs.
CSD462::Viewer::Viewer | ( | void | ) |
Constructor.
Creates a new viewer with the default title (CSD462).
CSD462::Viewer::Viewer | ( | const char * | title | ) |
Constructor.
Creates a new viweer with the given title.
CSD462::Viewer::~Viewer | ( | void | ) |
Destructor.
Destroys the viewer instance and frees memory. Note that this does not change the user space renderer.
void CSD462::Viewer::init | ( | void | ) |
Initialize the viewer.
This will open up a window and install all the event handlers and make the viewer ready for drawing.
void CSD462::Viewer::start | ( | void | ) |
Start the drawing loop of the viewer.
Once called this will block until the viewer is close.
void CSD462::Viewer::set_renderer | ( | Renderer * | renderer | ) |
Set a user space renderer.
The viewer will use the given user space renderer in drawing.
renderer | The user space renderer to use in the viewer. |