开发者

How can I run XNA in VirtualBox on a Mac?

I know it's weird. XNA Version is 3.1 and V开发者_开发知识库irtualBox version is 4.0.2.


Install the software reference device that comes with DirectX SDK. For me, that enabled running XNA related unit tests on a Hyper-V virtual machine. It should do the trick for any virtual environment since it implements a full DirectX device in software and does not rely on available hardware or virtualized drivers. It will not be blazingly fast but it should work.

Installing the core parts of the DirectX SDK is enough, no further installation or configuration is required.

(Almost forgot) In the code that sets up the device you must specify the device type to use:

var deviceType = (hardwareDevice ? DeviceType.Hardware : DeviceType.Reference);
var graphicsDevice = new GraphicsDevice(GraphicsAdapter.DefaultAdapter,
                                            deviceType,
                                            ...);

As a side note: in XNA 4.0, choosing reference or hardware device is moved to the GraphicsAdapter using the UseReferenceDevice property.


I've managed it in VMware Fusion, which supports DirectX 9c. However, you may have to use the Reach game profile rather than the full HiDef one. This can be done easily in the game project properties window in Visual Studio.

I hope this helps, but as dotalchemy says, you will want to make sure support is there!


Enable 3D Acceleration according to DirectX in VirtualBox 3.0.0 - Pure joy is here and the XNA project would run just fine.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜