I'm not sure about wrapping to BlitzMax, but the C++ code has some problems:
In C++ you can pass by value (which copies the object), or by reference or pointer. Here you're passing and returning a copy of the object, which is not right. cDeleteParticle() is going to copy the object, then delete it, which actually does nothing to the original object (in fact it may even crash because you can't delete an object that you didn't create with "new").
Here's how it should be:
BlitzMax uses a garbage collection system, so everything is basically a pointer, but in C++ you need to make the distinction between passing pointers or passing a copy of the whole object.
cParticle cCreateParticle(void) { return new cParticle; // is this right? } void cDeleteParticle(cParticle p) { delete p; // is this right? }
In C++ you can pass by value (which copies the object), or by reference or pointer. Here you're passing and returning a copy of the object, which is not right. cDeleteParticle() is going to copy the object, then delete it, which actually does nothing to the original object (in fact it may even crash because you can't delete an object that you didn't create with "new").
Here's how it should be:
cParticle *cCreateParticle(void) { return new cParticle; } void cDeleteParticle(cParticle *p) { delete p; }
BlitzMax uses a garbage collection system, so everything is basically a pointer, but in C++ you need to make the distinction between passing pointers or passing a copy of the whole object.