[osg-users] OSG and .NET in Windows 7 x64

Rafa Gaitan rafa.gaitan at gmail.com
Fri Apr 1 05:08:36 PDT 2016


Hello Diwas,

Yes, that's something you cannot get rid of it when you are building with
c++/cli in visual studio.

Our solution was implementing a holder like osg::ref_ptr in .net:

template<typename T>
ref class msclr_refptr { ... }

You can use the osg::ref_ptr class as inspiration to replicate the
behaviour in .NET. Unfortunately I cannot share any code but is pretty
straightforward to do it.

For managing properly the references in C++/CLI and use it in C# (with some
limitations of course), we created some C++/CLI wrappers using internally
the msclr_refptr holder:

ref class CLRGroup {
public:
    // whatever api you want to show
private:
     mslr_refptr<osg::Group> m_Group;
}

I hope this helps.

Regards,
Rafa.


El vie., 1 abr. 2016 a las 12:44, Diwas Bhattarai (<osgforum at tevs.eu>)
escribió:

> Hi,
> Did anybody came accross the problem when working with c#
>
> *Quote:*
>
>
>
>
>
> a member of a managed class cannot be of a non-managed class type
>
>
>
>
> I posted the question in
> http://forum.openscenegraph.org/viewtopic.php?p=66696#66696
>
>
> Thank you!
>
> Cheers,
> Diwas[/quote]
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=66704#66704
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20160401/f22ddcd8/attachment-0003.htm>


More information about the osg-users mailing list