[osg-users] Custom Graphics Context not applied?

Robert Osfield robert.osfield at gmail.com
Tue Aug 30 05:26:55 PDT 2016


Hi Philipp

On 30 August 2016 at 13:20, Philipp Meyer <philipp.meyer at fh-bielefeld.de> wrote:
> How do I provide a graphics context for a viewer? I see there is a method returning all graphics contexts, but I cant find any methods to set the context, and the constructor of osgViewer doesnt take a graphics context either.

You assign the GraphicsContext to the viewer Camera(s).  The
osgViewer:realize() method will create and assign a GraphicsContext if
one is not already assigned, this exists just as a fallback, ideally
the viewer and associated Camera(s) should be set up prior to the
realize() call.

An example of manually creating and assigning GraphicsContext/Window
can be found in the osgwindows examples.


> Maybe there is an easier way to accomplish what I need? I want to store a timestamp BEFORE the call to swapBuffers, but after rendering traversal.

You are creating a custom GraphicsContext just to get a timestamp?

When you say before swap buffers, do you mean just before the call to
swap buffers or do you mean any time in the frame before swap buffers.

What do you need to the timestamp for?

Robert.



More information about the osg-users mailing list