Originally Posted By: Uhrwerk
On the other hand I don't get your concept of using this. Very roughly speaking you bind functions to structs so they more or less appear as methods. That goes into an oop direction. However, you do not provide inheritance (at least not without a workaround), no polymorphy and no encapsulation.

I don't see why adding a line of code is a workaround to create inheritance, I mean, even in Java and C++ you have to provide the name of the class you want to subclass. So I don't see why inheritance is a huge problem (including that I just updated the runtime) but maybe I miss a point?
About polymorphism, like I already mentioned in my answer to Schubido, it IS possible and done through protocols. I see that its not the most convenient way and I'm open for any suggestions about this because I find this part a bit dirty too, but it works and since the last update it also works nicely with inheritance.

You are right about encapsulation, however, you can still move your struct into the .c file and thus encapsulate the structs members from the user (plus if you are really crazy you can go ahead and build a public struct that has the same size but not all members but padding stuff in between).
This is where it hits the language limitations really bad and I can't offer any solution for this, but like in C++: Don't use classes as containers can be used as rule of thumb for Lite Foundation classes too and it works just fine.

Quote:
So the question is: why should I use this complicated stuff instead of just using the c++ sdk?

Now that is a good question and the answer is the same as I gave ratchet for his C# question; If you can work with C++, work with it!
For me thats not an option, I hate C++, I hate the memory model of C++ etc. This is the same with any other wrapper for language xyz; If you like the language and can work with it, do it!

However, if you are not sure if you like C++ and are used to C, you can give Lite Foundation a try and might fall in love with its reference counting environment and this other "complicated" stuff laugh


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com