How can I run XNA in VirtualBox on a Mac?

社会主义新天地 提交于 2019-12-21 17:38:15

问题


I know it's weird. XNA Version is 3.1 and VirtualBox version is 4.0.2.


回答1:


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.




回答2:


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!




回答3:


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



来源:https://stackoverflow.com/questions/4751820/how-can-i-run-xna-in-virtualbox-on-a-mac

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!