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::ImageRenderer::createContext ()
void nrt::graphics::ImageRenderer::activateContext ()
 Optional, activate the context (after it is created by createContext()); initFrame() does this too.
void nrt::graphics::ImageRenderer::initFrame ()
 Reset our display buffer to blank.
void nrt::graphics::ImageRenderer::setImage (GenericImage const &image)
 Sets the image to use.
void nrt::graphics::ImageRenderer::setImage (Image< PixRGBA< float >> const image)
 Sets the image to use.
void nrt::graphics::ImageRenderer::renderFrame ()
 Render the display buffer to screen.
void nrt::graphics::ImageRenderer::destroyContext ()
 Destroy our drawing context.

Function Documentation

void nrt::graphics::ImageRenderer::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:
// Main loop:
while (running())
// Reset our frame to blank:
// Now set the image to render (needs not be done in the loop)
itsRenderer->setImage( GenericImage(myImage) );
// Finalize rendering of the frame:
// Maybe sleep a bit, or compute FPS, etc
// Time to cleanup and close down:

Create a drawing context