Hi Jeremy,
On 1/25/07, Jeremy L. Moles <[EMAIL PROTECTED]> wrote:
> What would be less coding would be to implement a GraphicsWindowGTK
> with enough functionality that you could assign such a window to a
> osgViewer::Viewer are then stats and everything else will work
> straight off.
I looked into this a bit after reading your response. Where does an
osgViewer::Viewer object actually figure out what kind of
GraphicsWindow* it needs? Is this something determined at compile-time?
The GraphicsWindow implementations are registed via
WindowingSystemInterface object that is the window builder and this
interface is register via a proxy object. Have a search from the
GraphicsWindowX11.cpp.
The WindowSystemInterface is just there for automatically built
windows, you can pass prebuilt widows to osgViewer::Viewer and
osgViewer::CompostiteViewer. When you have prebuilt windows you just
need to overriden the main virtual functions defined in
GraphicsWindow. Start by just implementing things like realize(),
makeCurrent() and swapBuffers() and keep running the app - the
Viewer/GraphicsWindow will report methods it needs implementing that
arn't implemented yet.
> SimpleViewer is not really intended to be an all single all dancing
> viewer, its role is to make it quick to integrate with applications
> that already have graphics windows setup and need to embed OSG into
> it.
But it's so easy to use! :)
Cool, nice to hear that its intent has been fulfilled ;-)
Simplicity does lead to ease of use, until... you just hanker after
that last bit of functionality that just isn't inbuilt... and then its
no longer easy to use.
Its a bit of difficult balance to achieve, simply enough to be easy,
but functional enough for use.
osgViewer::Viewer and CompsiteViewer are a bit more complex, but not
hugely so, especially if you can reuse already built GraphicsWindow
implementations. Once you have the GraphicsWindow implementation
these more powerful viewer classes will scale much better as you
problems grow more complex, you won't end up trying to do unsupported
stuff.
Its still early days for osgViewer and GraphicsWindow implementation,
so those on the bleeding edge will need to push a bit harder to get
things mocked up, once they those who follow along behind us will
wonder what all the fuss was about...
Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/