View Full Version : Converting pSDL_COLOR to TColor/Cardinal and back
30-05-2012, 10:09 AM
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.
30-05-2012, 10:48 AM
If by Cardinal, you mean a color in $RRGGBB format, then just (*, +) or (shl, or) the components of sdl's color.
begin Exit((Col^.R shl 16) or (Col^.G shl 8) or (Col^.B)) end;
Col^.R:=Num shr 16;
Col^.G:=Num shr 8;
Powered by vBulletin® Version 4.1.10 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.