Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


index_0x0000

Member Since 02 Aug 2011
Offline Last Active Aug 02 2011 06:55 AM

Topics I've Started

linux 64 loadBMP in tutorials

02 August 2011 - 04:52 AM

First of all I want to thank about these fine openGL tutorials. Thanks! : )
I'm using 32 and 64 bit linux machines to compile ( Linux/GLX Code ). I faced with problem in loadBMP function on linux64. To be short the problem is in the following line ( starting from lesson06 ):
long int bfOffBits;
and later in the function
if (!fread(&bfOffBits, sizeof(long int), 1, file))
it's better to replace it with
int bfOffBits;
... 
	if (!fread(&bfOffBits, sizeof(bfOffBits), 1, file))
because:
linux32: sizeof( long int ) == 4
linux64: sizeof( long int ) == 8
and BMP file format assumes the field size ( File offset to Pixel Array ) to be 4 bytes.

Please correct me if I'm wrong.
Best regards.

PARTNERS