Special context for switching between multiple contexts. Each context tied to a keyboard shortcut.
More...
#include <ContextSwitcher.h>
|
void | uiSetup (int vWidth, int vHeight) |
| UI setup - handles the configuration of the opengl context for orthographic rendering. More...
|
|
void | uiShutdown () |
| Cleans up the OpenGL state after having drawn the UI elements of the context.
|
|
virtual void | drawUIGL (int vWidth, int vHeight, bool select=false) |
| Draw UI elements into the context. More...
|
|
virtual void | draw3DGL (bool select=false) |
| Draw context elements into the 3D world. More...
|
|
void | getOpenGLView () |
| Updates the various view matrices: modelview, projection, and view.
|
|
void | writeText (const std::string &txt, const Vector2 &pos, bool currColor=false) const |
| Writes the given text at the given location. More...
|
|
void | writeText (const std::string &txt, const Vector3 &pos, bool currColor=false) const |
| Writes the given text at the given 3D location. More...
|
|
void | writeTextRadially (const std::string &txt, const Vector2 &pos, const Vector2 &dir, bool currColor=false) const |
| Writes the given text at the given location, but anchored based on the radial direction given. More...
|
|
void | writeAlignedText (const std::string &txt, const Vector2 &pos, TextWriter::Alignment align, bool currColor=false) const |
| Writes the given text aligned to the given location. More...
|
|
void | writeToScreen (const std::string &txt, TextWriter::Alignment align, int fontSize, float hPad=0.f, float vPad=0.f, bool currColor=false, bool trans=true) const |
| Writes the given text to the screen based on the given alignment. More...
|
|
Special context for switching between multiple contexts. Each context tied to a keyboard shortcut.
void Menge::SceneGraph::ContextSwitcher::addContext |
( |
Context * |
context, |
|
|
SDLKey |
key |
|
) |
| |
Add a context and it's "hotkey".
- Parameters
-
context | The context to add. |
key | The key which activates the context. |
void Menge::SceneGraph::ContextSwitcher::drawGL |
( |
int |
vWidth, |
|
|
int |
vHeight |
|
) |
| |
|
virtual |
The draw function for the context.
- Parameters
-
vWidth | The width of the viewport (in pixels). |
vHeight | The height of the viewport (in pixels). |
Reimplemented from Menge::SceneGraph::Context.
Give the context the opportunity to respond to a keyboard event.
- Parameters
-
e | The SDL event with the keyboard event data. |
- Returns
- A ContextResult instance reporting if the event was handled and if redrawing is necessary.
Reimplemented from Menge::SceneGraph::Context.
Give the context the opportunity to respond to a mouse event.
- Parameters
-
e | The SDL event with the mouse event data. |
- Returns
- A ContextResult instance reporting if the event was handled and if redrawing is necessary.
Reimplemented from Menge::SceneGraph::Context.
bool Menge::SceneGraph::ContextSwitcher::selectGL |
( |
const GLScene * |
scene, |
|
|
const GLCamera & |
camera, |
|
|
int |
vWidth, |
|
|
int |
vHeight, |
|
|
int * |
selectPoint |
|
) |
| |
|
virtual |
Performs selection based on a click on screen space. Uses the OpenGL selection mechanism.
- Parameters
-
scene | The scene to select in. |
camera | The camera. |
vWidth | The width of the viewport. |
vHeight | The height of the viewport. |
selectPoint | The point (in screen space) at which object selection should take place. |
- Returns
- A boolean indicating whether a redraw needs to take place.
Reimplemented from Menge::SceneGraph::Context.
bool Menge::SceneGraph::ContextSwitcher::switchContexts |
( |
Context * |
context | ) |
|
Switch to the indicated context.
- Parameters
-
context | The newly active context. |
- Returns
- A boolean reporting if a change is actually made (true) or not (false).
The documentation for this class was generated from the following files:
- src/menge/MengeCore/SceneGraph/ContextSwitcher.h
- src/menge/MengeCore/SceneGraph/ContextSwitcher.cpp