I am using a structure who has its three parameters declared as "COLOR16". I didn't find any documentation for it on MSDN but it says the value of COLOR16 can range from 0x0000 to 0xff00. This is hex but I have an integer that I want to pass it. Example:
PHP Code:
TRIVERTEX        vert[2] ;
vert [0] .Red      GetRValue(mycolor);
vert [0] .Green      GetGValue(mycolor);
//..... 
.Red and .Green are decalred as COLOR16. But GetRValue is either BYTE or int. It just doesn't work if I use the above method of typecast it like "(COLOR16)GetRValue(mycolor)". It only works if I provide a haxadecimal value.
How can I make it work WITH a variable instead of just passing it a non-declared hex value?