Hi John and Colin,

I'm also looking to get C# and OSG working well together.  I've been
seriously considering creating managed OSG wrappers on my own, so I'd
definitely be interested in working with anyone else wanting to do the
same.

Recently I've actually developed a C# app that uses OSG via a hand-coded
C++/CLI assembly.  In the process I hit so many pain points that I
became convinced that an auto-generated wrapper at the OSG level is the
only reasonable way to provide a managed interface to OSG functionality.
The worst of the problems were:
  - duplication of complex types due to the fact that managed and
unmanaged data does not integrate at any level higher than POD types
  - the added complexity of managing object lifetimes in the presence of
garbage collection
  - ensuring thread safety if any work is done in finalizers, since the
garbage collector runs on an arbitrary thread
  - the second-class state of C++/CLI and native development tools when
working within a managed application 

In terms of wrappers, I think the two main options are auto-generating
C++/CLI bindings using osgIntrospection and using SWIG to create C#
bindings.  IMHO the former is really the way to go.  It's more work
up-front, but it's likely to be a lot more flexible and higher
performing in the long run.

-Mike


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: Monday, November 13, 2006 9:08 AM
To: osg users
Subject: RE: [osg-users] OSG and C#

Hi Colin, I'm glad I'm not the only one contemplating this. The biggest 
problem with wrapping OSG with C++/CLI as far as I can see is 
reference-counted objects.
I'm not sure I could justify to my boss spending lots of time writing a
C# 
wrapper on my own, but if there are a few people willing to invest time,

I'd be happy to be part of the team.
For speed of development, I've considered writing a high-level,
unmanaged 
viewer DLL that just gets passed the DC of my C# render surface,and any 
input events, and then use osgLua or similar to handle the scenegraph.

John Donovan
Sony Computer Entertainment Europe
http://www.scee.com


[EMAIL PROTECTED] wrote on 13/11/2006 14:31:10:

> 
> We're also about to try an integrate C# with OSG so would be
interested
> in any experiences as well. I would imagine the main issue is the
> relationship between managed and unmanaged code (that's been discussed
> on other threads. Also, my understanding is that you need to go via a
> C++/.Net managed intermediate layer.
> 


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
[EMAIL PROTECTED]

This footnote also confirms that this email message has been checked
for all known viruses.

**********************************************************************
Sony Computer Entertainment Europe

_______________________________________________
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/
_______________________________________________
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to