iLab Neuromorphic Robotics Toolkit  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Interface functions that should all be called from a same thread


void nrt::graphics::ShapeRendererBasic::createContext ()
void nrt::graphics::ShapeRendererBasic::activateContext ()
 Optional, activate the context (after it is created by createContext()); initFrame() does this too.
void nrt::graphics::ShapeRendererBasic::initFrame ()
 Reset our display buffer to blank.
void nrt::graphics::ShapeRendererBasic::renderFrame ()
 Render the display buffer to screen.
void nrt::graphics::ShapeRendererBasic::destroyContext ()
 Destroy our drawing context.

Function Documentation

void nrt::graphics::ShapeRendererBasic::createContext ( )
        An OpenGL context is attached to a given thread, hence all of the renderer's display functions should be
        called from the same thread. Typically, that would teh the run() thread of an nrt::Component, as follows:
// Get our renderer going:
itsRenderer->lookAt(Eigen::Vector3d(0, -100, 100), Eigen::Vector3d(0, 0, 0), Eigen::Vector3d::UnitZ());
// Main loop:
while (running())
// Reset our frame to blank:
// Now render all our shapes:
for (auto const & s : my_shapes) s.render(*itsRenderer);
// Finalize rendering of the frame:
// Maybe sleep a bit, or compute FPS, etc
// Time to cleanup and close down:

Create a drawing context