
Awesome, I'm running not walking
Posted Monday, 31 March, 2008 - 02:38 by Boder inI was worried for no reason.
I got the SVN for the new FBO stuff, got confused with nant and realized I didn't need it for "build vs." Compiling was easy.
Started with my new project codenamed "Quick Start" (I expect many have the same codename). I had to change some things, but was simple with C# intellisense. I still hope for an updated Quick Start. Pseudo fullscreen works nicely and is the default (cool).
The only thing is the mouse cursor stays on the "loading" icon until I move it off the client area (very minor).
Now I'm on to figure out FBOs and GLSL, which I never got under C++, but should be easier now.


Comments
Re: Awesome, I'm running not walking
Sorry, misread.
This doesn't protect you from:
You also don't need the 'i' (a plain overload would do). Which brings us back to the "too many overloads to write by hand" problem.
Update: just checked and you cannot use enums for generic constraints. Which means there's no easy solution to this problem.
By the way, the more I use generics in C#, the more I dislike them. The strange decisions in the constraint system weaken them too much (you cannot use System.Array, enums, or any primitive type as constraint).
Re: Awesome, I'm running not walking
I thought the bulk of OpenTK was auto-generated..? Then such overloads would not be such a problem? Or is there some reason this has been avoided?
Re: Awesome, I'm running not walking
These overloads cannot be autogenerated, because the specs don't specify the allowed types.
For example,
TexParameteridefines the last parameter asint, when in fact it could beTextureMinFilter,TextureMagFilteror many other things. There's no way to infer the latter from the former.Re: Awesome, I'm running not walking
OK, I see now ... The second parameter decides which "enum" should be used in the third.
Inherently bad situation ... not much to do, unless OpenTK steps further away from OpenGL with something like named methods for each second parameter:
etc.
Re: Awesome, I'm running not walking
Exactly, this is the price tag. I assume when this design would be executed consequently, we'd easily get above 5000 functions for the GL class - not to mention the requirement to document all those changes and the intellisense chaos.
Even if we do this with 2 instead of 3 parameters, there would still be the problem that you may pass a mipmap filter to a TextureTarget.TextureRectangle (which cannot have mipmaps). The only "safe" solution would be:
void TexParameterRectangleMinFilter( TextureRectangleMinFilter f );Madness.
Re: Awesome, I'm running not walking
If only C# were typeless, we would not have to worry about all this type-centric issues ;)
Irony aside - I guess the current API is a good balance!