OGRECave / ogre

scene-oriented, flexible 3D engine (C++, Python, C#, Java)
https://ogrecave.github.io/ogre/
MIT License
3.9k stars 963 forks source link

C# SWIG binding issues #1760

Open mcloughlin77 opened 3 years ago

mcloughlin77 commented 3 years ago

System Information

Detailled description

Not all C# types are currently mapped correctly, in particular input and output typemaps as defined here: http://web.mit.edu/svn/src/swig-1.3.25/Lib/csharp/typemaps.i

This makes it so when implementing a RenderQueueListener and overriding renderQueueStarted you get the following method:

public override void renderQueueStarted(byte queueGroupId, string invocation, SWIGTYPE_p_bool skipThisInvocation)

instead of the expected:

public override void renderQueueStarted(byte queueGroupId, string invocation, out bool skipThisInvocation)

Collections also do not seem to be supported. For example, getRoot().getSceneManagers() returns the type SWIGTYPE_p_std__mapT_std__string_Ogre__SceneManager_p_std__lessT_std__string_t_t which cannot be enumerated.

paroj commented 3 years ago

output typemaps need to be defined manually as we used to do e.g. here: https://github.com/OGRECave/ogre/blob/972f5ebaf6a2e0c1db2712fac4359a9ca6355c2c/OgreMain/include/Ogre.i#L367

same goes for collections, which need a manual template instantiation: https://github.com/OGRECave/ogre/blob/ffcb7adccafa6a5759475184125eb9ada6e5e002/OgreMain/include/Ogre.i#L257-L258

as it is very likely to miss some of these when reviewing the API, we rely on the community to provide the missing bits.

So feel free to create a pull-request, extending the Ogre.i file mentioned above with the functionality you need.