DXVA2_Fixed32 a = DXVA2_Fixed32OpaqueAlpha();
float f = (float)a;
This is throwing a compilation error
“error C2440: Cannot convert from “DXVA2_Fixed32 ” to Float.
My purpose is to assign “a”‘s value to “f”.
Can anyone kindly let me know How to assign DXVA2_Fixed32 type variable “a” to “a float variable “f”.
Thanks in advance.
You can’t do it with a typecast like that. The
DXVA2_Fixed32type is a struct containing two fields with fractional and integer parts of the number.You need to call
DXVA2FixedToFloatto perform the conversion.If ever you need to go in the opposite direction you can use the predictably named
DXVA2FloatToFixed.