简体   繁体   中英

Compiling XNA to 64-bit

I'm working on a simulator that models very complex interactions between many objects, and I mean millions.

I've used XNA because of the useful things that it lets me do easily, especially with the rendering.

My problem is that I'm running into OutOfMemoryException s after only a few seconds of simulation. I quickly realized that my program is only running in 32-bit mode, so I only get a few GBs of my somewhat larger amount of RAM.

How can I run an XNA game in 64-bit mode?

XNA used to be 32-bit only. You can try to compile to 64-bit, but then you are going to have issues because there won't be any 64-bit XNA libraries to load up. Everything I have found trying to back this up has been comments reminding viewers to compile as x86.

To compile as x64: Right-Click on your solution and go to Configuration Manager. From there select x64 as your Active Solution platform. You may have to create it and then select all your projects as x64. You could also try building as Any CPU since you are on 64-bit Windows, it should automatically start up in 64-bit mode.

EDIT: I found one of my old VM's that had XNA 4 installed on it. It appears that there is not a way to force it to compile to 64-bit. Even when I try to create a new platform, it will only allow me to select x86.

This does not directly answer the question. I've already upvoted TyCobb's answer.

I've run into the same issue in the past.

Have you considered switching to SlimDX ? It's a wrapper around DirectX and allows you to develop .Net applications using DirectX. According to the documentation:

SlimDX sports complete support for both 32 and 64 bit targets.

It might not be as user-friendly as XNA, but I think it could be a good option for you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM