MVE - Multi-View Environment mve-devel
|
Abstraction of a rendering context/viewport that displays renderings. More...
#include <context.h>
Public Member Functions | |
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. | |
virtual bool | keyboard_event (KeyboardEvent const &event) |
Injects a keyboard event to the context. | |
virtual bool | mouse_event (MouseEvent const &event) |
Injects a mouse event to the context. | |
void | paint (void) |
Paints the frame. | |
void | resize (int new_width, int new_height) |
Resizes the context. | |
Protected Member Functions | |
virtual void | init_impl (void)=0 |
Overwrite to define actions on init. | |
virtual void | paint_impl (void)=0 |
Overwrite to define actions on paint. | |
virtual void | resize_impl (int old_width, int old_height)=0 |
Overwrite to define actions on resize. | |
Protected Attributes | |
int | height |
int | width |
Abstraction of a rendering context/viewport that displays renderings.
This class is to abstract from the actual system that creates the OpenGL context and delivers the events, for example GLX/X11, QT, GTK, etc. Creating the OpenGL rendering context is out of scope of this class. Also, creating the event loop / main loop is task of the controlling system.
The context can be init'ed, resized and repeatedly painted. Mouse and keyboard events can be injected for the implementation to react on.
|
inline |
|
inline |
|
inline |
|
protectedpure virtual |
Overwrite to define actions on init.
|
inlinevirtual |
Injects a keyboard event to the context.
Default implementation prints debug information only.
Reimplemented in ogl::CameraContext< CTRL >.
|
inlinevirtual |
Injects a mouse event to the context.
Default implementation prints debug information only.
Reimplemented in ogl::CameraContext< CTRL >.
|
inline |
|
protectedpure virtual |
Overwrite to define actions on paint.
|
inline |
|
protectedpure virtual |
Overwrite to define actions on resize.
Implemented in ogl::CameraContext< CTRL >.