Hi J-A,

If the viewport is smaller than the window and there is nothing else
clearing the window then you will see a left over contents of the
window.

To handle cases like this there is a clear in GraphicsContext that you
can enable via the GraphicsContext::setClear*() methods. The
GraphicsContext clear is off by default as the cameras normally cover
all the window making it not necessary to have this extra clear in
most cases.

Robert.

On Thu, Mar 13, 2008 at 7:08 PM,  <[EMAIL PROTECTED]> wrote:
> Hi,
>
>  A simple problem:
>
>  When I try to modify the viewport zone during execution: the new
>  viewport content is displayed on top of the old one. Do you know why
>  the old one is not cleared?
>
>  I guess I should use a specific "clearing" function, but can't find
>  the right one.
>
>  Not my real application (I don't do this every frame), but the same
>  problem happens for this situation:
>
>  ...
>  // In a previous function
>  viewer_.getCamera()->setViewport(0,0,1280,1024);  // initial size
>  ...
>  while (!viewer_.done())
>  {
>      viewer_.getCamera()->setViewport(100,100,300,300);
>
>      // Draw the next frame.
>      viewer_.frame();
>  }
>
>  Thanks in advance!
>  J-A
>
>  _______________________________________________
>  osg-users mailing list
>  osg-users@lists.openscenegraph.org
>  http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to