C++ Version on 64 bit

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
Post Reply
playerdark
Posts: 64
Joined: Mon Aug 01, 2005 5:06 am

C++ Version on 64 bit

Post by playerdark »

Ok, I'm fairly new to Irrlicht, but I'm an experienced game programmer. Although I can't contribute much to the Irrlicht specific talks yet, I'm pretty good at general programming.

I hope to use irrlicht for my next game project that I am preparing right now (indy development, low budget) but I tend to think ahead to the time when my game will be released which will probably be two years from now. By then I expect 64 bit systems to be quite widespread. I myself just got a 64 system for development and upgraded my Windows XP (yes I actually have an original :) ) to the new 64 bit version under their technology upgrade program. I also have the MSVC 8 beta compiler.

Long story short, its important for me, that my programs run in native 64 bit code.

After doing my first compile run, I realized that I was actually compiling the Linux version, since Irrlicht uses the WIN32 macro to test for Windows in general. perhaps it would be better to move that test to the configuration include file and then define a WINDOWS constant there.

Anyway, after replacing all #ifdef WIN32 with #if defined(WIN32) || defined(WIN64) and also doing similar things in the png, jpeg and zlib library where opportune, the first obstacle is taken.

The second one is, to replace all _asm int 3 with assert(0) and also including assert.h since the 64 bit compiler doesnt like the _asm keywoard. I am too new to 64 bit to figure out how to do my own assembler code for my project, but I will eventually.

Anyway, when creating a new compile plattform in the configuration manager there's another catch: The linker settings are so that no machine is specified in the drop down field, instead, the command line option /MACHINE:x86 is set manually which interferes with the 64 bit linker of course. Removing that from teh 64 bit version (and replacing it with the drop down selection in the 32 bit version for that matter) fixed the linker problem.

I have now a basic Irrlicht framework running in native 64 bit code without further problems. Whether everything works or not, I can't say yet, but I wanted to give you a headstart on how to adjust Irrlicht for 64 bit in case anybody else wants to try it out.

The other reason of course is to ask Niko to inmplement those changes into the next version so that Irrlicht becomes 64 bit enabled out of the box without having to go through the source code again and changing the defines.

Oh yes: I dont know if my changes with the png and the other helper libs work or not yet, I may have to fiddle with them some more, but if it turns out those changes are necessary, perhaps it would be prudent to make these changes in the Irrlicht package too, although those libraries are thrid party libraries.

Thanks for the great library Niko :)
playerdark
Posts: 64
Joined: Mon Aug 01, 2005 5:06 am

Post by playerdark »

I have just seen the other thread about 64 bit :(

Anyway, I forgot to mention that you will most likely have to disable DX8 under 64 bit windows version. The new DX 9.0c SDK just doesnt provide the stuff that's needed by Irrlicht.
sRc
Posts: 431
Joined: Thu Jul 28, 2005 1:44 am
Location: Salt Lake City, Utah
Contact:

Post by sRc »

Haha another x64 person!

Hmm I didnt have to change anything to get it to compile, except disabling DX8 of course. Just set the correct machine type and include the libs from the Platform SDK, and it worked fine. I'll have to look at it some more.

I did compile the PerPixelLighting example last night, and it worked with no problem. It's not using any of the PNG or JPG libraries though, I'm gonna compile one right now.

EDIT: Just compiled the TerrainRendering demo under x64, not problems there. It loads JPGs for the skybox.
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

Ok, thanks for the description, I'm going to do all this in the next version, so you won't have to worry.
Post Reply