[fpc-pascal] Problem with c header conversion
dmitry boyarintsev
skalogryz.lists at gmail.com
Sun Jan 4 11:37:34 CET 2009
each "union" is a separate case for pascal. another thing is that the
structure is quite agly and does not reveale the logicals usage.
The problem is that pascal does not allow you to use multiple cases in
single record, that would require you to declare additional types.
_PFColorSize = record
case Integer of
0: (dwRGBBitCount : DWORD);
1: (dwYUVBitCount : DWORD);
2: (dwAlphaBitDepth : DWORD);
end;
_PFColorMask = record
case Integer of
0: (
dwRBitMask : DWORD;
dwGBitMask : DWORD;
dwBBitMask : DWORD;
dwRGBAAlphaBitMask: DWORD;
);
1: (dwYBitMask : DWORD;
dwUBitMask : DWORD;
dwVBitMask : DWORD
);
end;
PDDPixelFormat = ^TDDPixelFormat;
_DDPIXELFORMAT = record
dwSize: DWORD;
dwFlags: DWORD;
dwFourCC: DWORD;
_size : PFColorSize;
_mask : PFColorMask;
end;
DDPIXELFORMAT = _DDPIXELFORMAT;
TDDPixelFormat = _DDPIXELFORMAT;
More information about the fpc-pascal
mailing list