Win64 x64 port

Hi,

I am trying to build JOGL for Windows x64, and so far it looks promising. I’ve modified the build scripts to add a new compiler config (vc8_x64), amended build.xml and a few other “things”, some stuff in gluegen (CPU.java), set JAVA_HOME to the 64-bit JDK install, and eventually got it to build.

However, running some stuff it craps out [1] setting the pixel format. I eventually tracked down the problem, wrong layout of the PIXELFORMATDESCRIPTOR struct. To cut the long story short, this is due to gluegen assuming DWORD (unsigned long) being 64-bit wide, which is certainly not the case with the VC compiler! Indeed I’m wondering whether any other compiler treats longs as 64-bit. I seem to remember ‘long long’ being 64-bit on gcc. Anyway I’m guessing this can be amended in one of the gluegen config files, and would be grateful for any hints. I’ve also checked the stub windows.h header that is in CVS, and it looks like all the other types would be correct on either arch.

Thanks in advance,
Matt.

[1] I haven’t got the output handy as I’m writing this from my (32-bit) laptop, but will provide more info when I get back to the 64-bit machine…

What is the actual #define / typedef of DWORD in your 64-bit SDK? You should be able to change the typedef of DWORD in make/stub_includes/win32/windows.h appropriately (to unsigned int?) and GlueGen should start producing correct code.

GlueGen assumes an LP64 data model (longs and pointers become 64-bit). This is the case on all of the currently supported 64-bit platforms. It is very possible that JOGL’s notion of the size of the DWORD type is wrong.

OK it works now, thanks Ken! Changing the typedef for DWORD to unsigned int did the trick, and hurray we have a 64-bit Windows binary that appears to work fine (limited testing).

Please find attached patches to the current gluegen and jogl code base, with the changes required to build JOGL with MS Visual Studio 2005. Note this requires the Professional edition, the free Express edition will not build 64-bit binaries.

Ken, I really hope you will consider this for inclusion with JSR-231 beta4. :slight_smile:

Thanks,
Matt.

Absolutely. Thanks for the patch; it’s been applied with a few modifications to the source tree. Let me know if anything was broken during the merge. We’ll try to provide precompiled Windows 64-bit binaries for beta 4, but can’t promise anything (we currently don’t have such a machine in our nightly build setup).

For those who can be bothered to build their own binaries, I forgot to mention that you must set JAVA_HOME to the correct 64-bit JDK location, otherwise gluegen won’t correctly identify your architecture. This is a bit of a shame but I could think of no clever way around this.

Matt.