On Mon, May 4, 2009 at 3:08 PM, Cory Riddell <[email protected]> wrote:
> Thanks Robert and Paul. I just assumed that a direct GDI call would be
> faster, but when I think about it, that can't be true (assuming a decent
> OpenGL driver).
>
> I did as you suggested and it works very well. Mostly.
>
> If I resize the window and make it wide and short, my background gradient
> maintains it's aspect ratio and blue bars on the sides are soon revealed. Do
> I need to add code to my event handler to recompute the background scene
> during resize events?

You attach Camera's directly to the GraphicsWindow, and if you do this
then the GraphicsWindow will do the resize of the viewport and
(optionally) the projection matrix as well.  The on screen stats uses
a Camera in this fashion so have a look at the implementation in
src/osgViewer/StatsHandler.cpp.

If the GraphicsWindow doesn't know about your Camera they you'll need
to manage the resize yourself.

Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to