-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using sfml types with Nim objects #6
Comments
http://irclogs.nim-lang.org/22-04-2015.html Ctrl+F "destructor" Basically, destructors are an extremely limiting experimental feature, and this may even be completely impossible to do. I had no idea what I was doing when I employed destructors in this library. Destructors are not related to garbage collection, but instead use complex scope rules. There are only 2 ways to avoid destructors:
...or call for some features in Nim, as discussed in IRC. |
So, going from my example, when game object is freed by GC, the memory occupied by And regarding wrapping |
Wrapping with macros is something I can't... wrap my head around. Either impossible or very difficult. Generating wrapper objects, however, is something I did recently, but I do not wish to resort to this here. There might even be some problems preventing this. |
Ok on another thought, I use sfml objects in a few of my own objects. If I disable the destructors, and call destroy on the finalizer of my objects, it should work? |
You can disable destructors and call It's a pity that CSFML's |
Seems to work now, AFAICT |
Technically yes, because I removed destructors - so all the downsides mentioned above apply. |
I'm using sfml objects (sprite, window etc.) in Nim objects.
And compiler complains with:
Any tips on the correct way?
The text was updated successfully, but these errors were encountered: