Tao.Sdl and Tao.Gl Interoperability
I've been attempting to port my code that used C++ with SDL and Open GL to the Tao framework. So far, it has been working very well, for the SDL part, at least. When it comes to the GL code, things stop working for some reason or another.
My GL skills are not nearly as nice as my SDL skills, and my background in GL is more or less just survival, if even that.
My old GL-SDL conversion code looked something like this:
//Build surface
convertedSurface = SDL_CreateRGBSurface( SDL_SWSURFACE, width, height, 32,
0x000000ff, 0x0000ff00, 0x00ff0000,
0xff000000 );
//Set surface properties
SDL_FillRect( convertedSurface, NULL, SDL_MapRGBA( convertedSurface->format, 0, 0, 0, 0 ) );
SDL_SetColorKey( original, SDL_SRCCOLORKEY,
SDL_MapRGB( original->format, 255, 0, 255 ) );
//Transfer old surface to new
SDL_BlitSurface( original, NULL, convertedSurface, NULL );
original and convertedSurface are both SDL_Surface*'s.
However, when I tried to move this to C#, 0xff000000 was too large of a number for a constant. This is a difference between data-types, I realize.
When I toss an unchecked( ) around the 0xff000000 to form:
unchecked( (int) 0xff000000 )
it seems to work alright -- but this is kind of an ugly method of doing it. Is there anything cleaner?
Thanks!

0xff000000 is too big a
0xff000000 is too big a number for a 32bit int, be it in C, C# or elsewhere. Turn up your compiler's warnings and it should complain.
Just make it a uint and do away with the unchecked stuff
Edit: what I meant was the data types are the same, the difference was in compiler technology.
------
OpenTK
Problem is that the
Problem is that the
SDL_CreateRGBSurfacemethod does not take uint's at all -- I've noticed this is the case on several Tao assemblies in both Sdl and GL... I'm just trying to handle it all with unchecked( ) for now. Maybe it'd be a good idea to apply such in the next build?In case you wonder, the
In case you wonder, the reason is that unsigned datatypes are not CLS compliant, which means they cannot be used by all .Net languages.
GL now provides both int and uint methods, see: http://taoframework.com/forum/development/developertalk/276
------
OpenTK
I'll start adding the uint
I'll start adding the uint methods for Tao.Sdl.
Thanks, but if it's not CLS
Thanks, but if it's not CLS compliant, then it's probably not worth adding. I'm ok with using unchecked for now. It makes sense to build it so it works correctly.
Oh well, I just finished
Oh well, I just finished adding the overloads to SVN. So they are there if anyone needs them.
Hah! Alright, well thank
Hah! Alright, well thank you so much for you hard work!