Hi Kevin,

I know nothing about Java/JNI so can't comment on the specifics, but
in general I'd suggest that 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.

Robert.

On Wed, Jan 6, 2010 at 5:05 PM, Kevin Tacke <kta...@gmail.com> wrote:
> We currently have an application that is built around the OSG Viewer using a 
> glut window.  We are interesting in adding a considerable GUI interface to 
> the application and we would prefer to use JAVA to implement the GUI.  So 
> basically I am trying to find a way, probably using JOGL, to create the GUI 
> and graphics window on the JAVA side and perform all of the drawing on the 
> C++/OSG side.
>
> I think I should be able to create a glContext on the JAVA size, with JOGL, 
> and when making a call to C++ with JNI have access to the same context as 
> long as it is done within the same thread.  Unfortunately, I have not figured 
> out how to assign the JAVA created glContex, retrieved with a call to 
> wglGetCurrentContext, to the OSG Viewer/Camera.
>
> I know that osgvp has created a JAVA/JOGL/JNI interface to OSG but it looks 
> like a lot of effort went into creating the JNI interface and making calls 
> into OSG.  I would really like to reduce the JNI to little more than init, 
> display, keyboard, and mouse functions.
>
> Any help is appreciated.
>
> Thanks,
> Kevin
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=22166#22166
>
>
>
>
>
> _______________________________________________
> 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