xpnteam / xpnet

Develop X-Plane plugins in .NET.
MIT License
50 stars 15 forks source link

WIP: Instance drawing #14

Open mbrachner opened 5 years ago

mbrachner commented 5 years ago

Add instance drawing API mappings to XPNet

mbrachner commented 5 years ago

@jaurenq can you have a look at the XPNet API for instancedrawing. CreateInstance is now a method of the XPSceneryObject, but maybe you would prefer a solution that is nearer to the XP SDK here, that is, something like m_api.Instance.CreateInstance(sceneryObject)

mbrachner commented 5 years ago

I will also remove the WIP, as this is in a quite mature state already

jaurenq commented 5 years ago

I'll check it out. My preference on merging back to master would be to only merge things that are totally ready to go - meaning I'd create a new nuget package for end-users to use with a usable version of whatever new new APIs are included. Is that where this is? (Maybe it is, I haven't looked at it yet -- just you said "quite advanced", and "quite advanced" and "finished feature" aren't quite the same thing :-)

jaurenq commented 5 years ago

@mbrachner have you tested Draw in X-Plane yet, or with more than one location (more than one XPLMDrawInfo_t) passed to it yet? The X-Plane API definition of XPLMDrawObjects accepts a pointer to an XPLMDrawInfo_t (which is actually the pointer to the first element in an array of them), but the mapping you added indicates that a single instance of XPLMDrawInfo_t will be passed (by value). If that's working, I'm not sure why, looks like it'd crash to me :-)

mbrachner commented 5 years ago

It works in X-Plane, however just with one instance. Sorry, that was one mistake in coding and one in testing it, I completely disregarded the case of several instances. Will take care of it.