nanogui: Thread: Problem with BMP


[<<] [<] Page 1 of 1 [>] [>>]
Subject: Problem with BMP
From: Matej Gutman ####@####.####
Date: 9 Feb 2010 15:09:16 -0000
Message-Id: <606cd00e1002090709s261c0712l90fe8a52d373539e@mail.gmail.com>

Hi all!

I've noticed, that there is a problem with loading BMP files after
i've compiled for my new laptop. I've came to a conclusion, that it
has to do with the fact that i've compiled it on 64 bit architecture.
Problem:

- sizeof(unsigned long) = 8 on 64 bit machine
- sizeof(unsigned long) = 4 on 32 bit machine

After changing
typedef unsigned long       DWORD;
into
typedef unsigned int        DWORD;
i was able to load BMPs accordingly.

Few thoughts:

1) Why is there a new define of DWORD in image_bmp.c? Would be better
to include windef.h, right?
2) Maybe it would be better to define 64 bit architecture in config?
Something like X86_64_BIT?

Regards,
Matej
Subject: Re: [nanogui] Problem with BMP
From: "Greg Haerr" ####@####.####
Date: 9 Feb 2010 20:10:42 -0000
Message-Id: <213a01caa9c4$02cb9120$0300a8c0@RDP>

: I've came to a conclusion, that it
: has to do with the fact that i've compiled it on 64 bit architecture.

You're right!

: 1) Why is there a new define of DWORD in image_bmp.c? Would be better
: to include windef.h, right?

Yes.  Or at least not redefine and use DWORD.  I'll look into
this, I'm not sure yet that I want windef.h to be a dependency
in the api-independent engine/ source.


: 2) Maybe it would be better to define 64 bit architecture in config?
: Something like X86_64_BIT?

Actually, someone has already produced a patch for 64 bit
compiles, which do not require any config requirement.
I had held off on this because of the need to move
to the u_int_32 typedef's etc.  I think its perhaps time
to patch the source with these updates.  They involved
many changes, as the current source pretty much has
assumed sizeof(long)=32.

Regards,

Greg
Subject: RE: Re: [nanogui] Problem with BMP
From: ####@####.####
Date: 10 Feb 2010 01:22:17 -0000
Message-Id: <918bcb65b06d6a0cff1a1dcfbfd109cc@i61791>

 
If you use a gcc compiler, then you can solve this problem by using -m32 option.
"-m32 option" means that "Generate code for a 32 bit".
 
It does not need any modification of source.
 
I have ever built microwindow on 64 bit machine with -m32.
It works well.
 
 
 
-----Original Message-----
From: "Greg ####@####.#### 
To: "Matej ####@####.#### ####@####.####
Cc: 
Sent: 10-02-10(수) 05:11:04
Subject: Re: [nanogui] Problem with BMP
: I've came to a conclusion, that it
: has to do with the fact that i've compiled it on 64 bit architecture.
You're right!
: 1) Why is there a new define of DWORD in image_bmp.c? Would be better
: to include windef.h, right?
Yes. Or at least not redefine and use DWORD. I'll look into
this, I'm not sure yet that I want windef.h to be a dependency
in the api-independent engine/ source.
: 2) Maybe it would be better to define 64 bit architecture in config?
: Something like X86_64_BIT?
Actually, someone has already produced a patch for 64 bit
compiles, which do not require any config requirement.
I had held off on this because of the need to move
to the u_int_32 typedef's etc. I think its perhaps time
to patch the source with these updates. They involved
many changes, as the current source pretty much has
assumed sizeof(long)=32.
Regards,
Greg
---------------------------------------------------------------------
To unsubscribe, e-mail: ####@####.####
For additional commands, e-mail: ####@####.####
[<<] [<] Page 1 of 1 [>] [>>]


Powered by ezmlm-browse 0.20.