How do i convert pSDL_Color to TColor or Cardinal, and how do i convert Cardinal/TColor to pSDL_COLOR?
Are there any functions, maybe even in SDL which i can use?
Thanks for help.
How do i convert pSDL_Color to TColor or Cardinal, and how do i convert Cardinal/TColor to pSDL_COLOR?
Are there any functions, maybe even in SDL which i can use?
Thanks for help.
If by Cardinal, you mean a color in $RRGGBB format, then just (*, +) or (shl, or) the components of sdl's color.
Code:Function SDL_ColorToUInt(Col:PSDL_Color):Longword; begin Exit((Col^.R shl 16) or (Col^.G shl 8) or (Col^.B)) end; Function Make_PSDL_Color(Num:LongWord):PSDL_Color; Var Col:PSDL_Color; begin New(Col); Col^.R:=Num shr 16; Col^.G:=Num shr 8; Col^.B:=Num; Exit(Col) end;
Bookmarks