<div dir="ltr"><div><div><div><div>Hi Sebastian,<br><br></div>The osg::GraphicsContext has a list of Operations that it runs on each frame, so just add your Operation to the GraphicsContext via from (include/osg/GraphicsContext header):<br><br> /** Add operation to end of OperationQueue.*/<br> void add(Operation* operation);<br><br></div>This list is run after the Camera's assigned to the GraphicsContext. See the GraphicsContext::runOperations() method in src/osg/GraphicsContext.cpp.<br><br></div>The other approach is to assign a Camera to the GraphicsContext that has a subgraph that contains the operations you want to call. The advantage with this approach is that the Camera's are all sorted according to their RenderOrder and RenderNumber, so you can control render order.<br><br></div>Robert<br><div><div><br><div><div><br></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 18 February 2016 at 11:53, Sebastian Messerschmidt <span dir="ltr"><<a href="mailto:sebastian.messerschmidt@gmx.de" target="_blank">sebastian.messerschmidt@gmx.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
I'm using osg::Operation to perform async tasks and osg::GraphicsOperations added via setRealizeOperation to perform on-realize per context tasks.<br>
What is the correct usage of osg::GraphicsOperations if I want it to be performed once per frame and context? Let's say at the end of the draw.<br>
My intention is to use the NVX_gpu_memory_info[1] to keep track of memory use and eviction, and since it needs a valid context to operate correctly I thought the graphicsOperation would be the way to go.<br>
<br>
[1] <a href="https://www.opengl.org/discussion_boards/showthread.php/170429-NVX_gpu_memory_info" rel="noreferrer" target="_blank">https://www.opengl.org/discussion_boards/showthread.php/170429-NVX_gpu_memory_info</a><br>
<br>
Cheers<br>
Sebastian<br>
_______________________________________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org" target="_blank">osg-users@lists.openscenegraph.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a><br>
</blockquote></div><br></div>