MVE - Multi-View Environment mve-devel
|
A simple context that does some of the common annoying work. More...
#include <context.h>
Public Member Functions | |
CameraContext (void) | |
~CameraContext (void) | |
bool | keyboard_event (KeyboardEvent const &event) |
Injects a keyboard event to the context. | |
bool | mouse_event (MouseEvent const &event) |
Injects a mouse event to the context. | |
![]() | |
virtual | ~Context (void) |
int | get_height (void) const |
Returns the height of the viewport. | |
int | get_width (void) const |
Returns the width of the viewport. | |
void | init (void) |
Initializes the context. | |
void | paint (void) |
Paints the frame. | |
void | resize (int new_width, int new_height) |
Resizes the context. | |
Protected Member Functions | |
void | resize_impl (int old_width, int old_height) |
Overwrite to define actions on resize. | |
void | update_camera (void) |
![]() | |
virtual void | init_impl (void)=0 |
Overwrite to define actions on init. | |
virtual void | paint_impl (void)=0 |
Overwrite to define actions on paint. | |
Protected Attributes | |
Camera | camera |
CTRL | controller |
![]() | |
int | height |
int | width |
A simple context that does some of the common annoying work.
This context handles OpenGL resize events and calls OpenGL viewport commands and updates the projection matrix.
This context gets a controller as template parameter. The controller receives events and provides viewport parameters to update the camera. The controller is required to support the following operations:
TODO: Update camera in controller?
|
inline |
|
inline |
|
virtual |
Injects a keyboard event to the context.
Default implementation prints debug information only.
Reimplemented from ogl::Context.
|
virtual |
Injects a mouse event to the context.
Default implementation prints debug information only.
Reimplemented from ogl::Context.
|
protectedvirtual |
Overwrite to define actions on resize.
Implements ogl::Context.
|
protected |
|
protected |
|
protected |