Re: [osg-users] Using OSG in an Java window

2010-04-22 Thread Jordi Torres
Hi Paul,

As Robert said some time ago, you have, at least two different methods to
achieve your goals:


> > you could use the osgViewer::GraphicsWindowEmbedded functionality that
enables the
> > standard osgViewer::Viewer/CompositeViewer to handle a single window
> > without doing any of its own windows/wgl/glx calls - leaving these
> > entirely up to the calling application.  For examples of this in
> > action have a look at the osgviewerSDL and osgviewerGLUT examples that
> > come as part of the OSG's example set.  Such a embedded window is fine
> > for most apps that just require a single window and single threading
> > of the viewer, but isn't a scalable as the native OSG windowing
> > implementations.
> >
> > Another route might be to try and get the underlying window handle of
> > a window created by java and then pass this to
> > osgViewer::GraphicsWindowWin32/X11 using it's support for inheriting
> > windows and adding it's own graphics context.  This approach is the
> > most flexible w.r.t the OSG as it enables the OSG to handle threading
> > and multiple graphics contexts directly.

In our projetct OSG Virtual Planets [1] we use JAVA/JOGL/JNI interface. You
can take a look to the svn repository, the main code to create Java Windows
is in the library wrappers/java/libjni-osgvpviewer(in trunk). The library
libjni-osgvpcore  wraps the most important classes of OSG to Java. It may be
useful for you.
We are under a refactor process, so don't hesitate to ask if you have doubts
or you see something weird.


Hope this helps.
Cheers.

[1]http://forge.osor.eu/projects/osgvp/

2010/4/21 Paul Gotzel 

>  Hello,
>
> Does anyone have a good example of rendering with the osgViewer in an
> java.awt.Canvas or something similar?  I've found
> http://www.noodleheaven.net/JavaOSG/javaosg.html but this seems about 5
> years out of date so I'm not sure if I should go near it.  I'm not actually
> interested in wrapping the OSG api in Java.  I want a way to use the Java
> Canvas as the source for the OGL context.
> --
> *Paul Gotzel*
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>


-- 
Jordi Torres Fabra

gvSIG 3D blog
http://gvsig3d.blogspot.com
Instituto de Automática e Informática Industrial
http://www.ai2.upv.es
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Using OSG in an Java window

2010-04-21 Thread Paul Gotzel




Hello,

Does anyone have a good example of rendering with the osgViewer in an
java.awt.Canvas or something similar?  I've found  http://www.noodleheaven.net/JavaOSG/javaosg.html
but this seems about 5 years out of date so I'm not sure if I should go
near it.  I'm not actually interested in wrapping the OSG api in Java. 
I want a way to use the Java Canvas as the source for the OGL context.
-- 
Paul Gotzel




___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org