Michael Van Canneyt
Tue, 02 Feb 2010 23:59:40 -0800
On Tue, 2 Feb 2010, leledumbo wrote:
Does the BlockRead below:
type
TRGBQuad = record
rgbBlue: GLubyte;
rgbGreen: GLubyte;
rgbRed: GLubyte;
rgbReserved: GLubyte;
end;
...
var
FileHandle: File;
BytesRead: GLuint;
FColorPalette: PRGBQuad;
NumberOfColours: GLuint;
...
BlockRead(FileHandle,FColorPalette^,SizeOf(TRQBQuad)*NumberOfColours,BytesRead);
corresponds to this C code:
typedef struct tagRGBQuad {
char rgbBlue;
char rgbGreen;
char rgbRed;
char rgbReserved;
} RGBQuad;
...
RGBQuad *colours;
FILE *in;
int numColours;
...
fread(colours,sizeof(RGBQuad),numColours,in);
Yes, if GLubyte=char Michael. _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal