[osg-users] osgWidget now checked into OSG SVN trunk

Jeremy Moles jeremy at emperorlinux.com
Tue Jul 15 12:14:53 PDT 2008

On Tue, 2008-07-15 at 15:04 -0400, Jean-Sébastien Guay wrote:
> Hi Jeremy,
> > Ah, interesting. I always figured I was doing folks a favor by
> > hard-coding a small size, but code can certainly be added to have it
> > behave as you suggest.
> Well, I (and most people with 19 inch monitors) have 1280x1024 native 
> resolution, so your window should fill the whole screen, but it's the 
> 0,0 that actually causes problems. On Windows, if you give (x,y) = 
> (0,0), then the top of the window frame is outside the screen so you 
> can't drag it to move it! I always found that weird.
> In any case, an OSG example should just use the default viewer.run() and 
> let the environment variables / command-line args determine how the 
> window should look.
> And it will actually be less code... Remove that setUpViewInWindow line :-)
> > The key is to make sure that the orthographic
> > camera is properly resized properly, which should be done by the
> > ResizeHandler object.
> The ortho camera should be sized appropriately for the screen anyways, 
> shouldn't it? I thought that was default OSG behavior...

I do not believe so; or at least, it's behavior is consistent with what
we're each talking about, which man not be the same thing.

>From my experience, if you have a 1024x768 orthographic
"camera-in-camera" setup for your HUD, and then you make the window
fullscreen, the orthographic camera still has a resolution of 1024x768,
even though your new "dimensions" are 1280x1024. With a UI, you really
need to have constnt awareness of your absolute pixel width and height,
even if your code doesn't directly use it.

It's all up to the ResizeHandler though; if you wanted to ALWAYS work in
some coordinate space like 1024x768, it should be possible just by using
(or perhaps not even using) a different ResizeHandler. The one I created
in ViewerEventHandler, however, tries to make sure the WindowManager
object always knows the exact pixel dimensions of the View.

> J-S

More information about the osg-users mailing list