agadoul's picture

Generics

HI,

I have been developing for quite some time now with openTK and I love it.
The only problem I always have is the lack of generics.
Let me explain. If for example, I want to develop a KeyFrameAnimation class,
I need to create KeyFrameAnimationVec2f, KeyFrameAnimationVec3f, KeyFameAnimationVec4f.....
which is relly a pain in the ass when a KeyFrameAnimation where T is a vector3f, vector4f... would do the trick.
I know that operators are quite a pain in the ass to implement in c# generics but there is still some solutions:

http://www.codeproject.com/KB/cs/genericnumerics.aspx

http://www.codeproject.com/KB/cs/genericoperators.aspx

Do you think I might have the chance to see this feature in a future release or not ?

thanks.

Axel.


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
the Fiddler's picture

The lack of generic operators in .Net is quite annoying indeed.

There are no plans to add such functionality in OpenTK. However, patches are welcome.

kvark's picture

Consider using Boo:
http://boo.codehaus.org/

It suits .NET perfectly, provides friendly language interface, generics, extensibility and more.
It's still not 1.0, but develops actively towards it.

I started using it recently and very glad seeing the smaller size and better readability of the code (after C++).

agadoul's picture

ok it's a shame it's not going to be implemented but tha's not a BIG problem.
I do not like python like programming languages so boo might not be the good fit for me.
is boo really use generics like in c# or templates-like version like in c++?