0

我创建了一个 cocos2d-x 3.0 RC 项目,我也想在 Windows 中玩。我已将 CocosDension、libExtensions、libNetwork、libCurl 等库添加到我的项目中,因为这些是游戏所需的。编译时一切正常,但是当我尝试运行时,出现以下运行时错误。下面提到的是抛出的异常。

PhoneDirect3DXamlAppInterop.DLL 中出现“System.IO.FileNotFoundException”类型的异常,但未在用户代码中处理。如果有这个异常的处理程序,程序可以安全地继续。

在下面的代码块中引发了此特定异常

private void DrawingSurfaceBackground_Loaded(object sender, RoutedEventArgs e)
        {
            if (m_d3dInterop == null)
            {
                m_d3dInterop = new Direct3DInterop();

                // Set WindowBounds to size of DrawingSurface
                m_d3dInterop.WindowBounds = new Windows.Foundation.Size(
                    (float)Application.Current.Host.Content.ActualWidth,
                    (float)Application.Current.Host.Content.ActualHeight
                    );

                // Hook-up native component to DrawingSurfaceBackgroundGrid
                DrawingSurfaceBackground.SetBackgroundContentProvider(m_d3dInterop.CreateContentProvider());
                DrawingSurfaceBackground.SetBackgroundManipulationHandler(m_d3dInterop);

                // Hook-up Cocos2d-x delegates
                m_d3dInterop.SetCocos2dEventDelegate(OnCocos2dEvent);
                m_d3dInterop.SetCocos2dMessageBoxDelegate(OnCocos2dMessageBoxEvent);`
                m_d3dInterop.SetCocos2dEditBoxDelegate(OpenEditBox);
            }
        }

在行抛出异常

m_d3dInterop = new Direct3DInterop();

我还将错误日志放在下面

The specified module could not be found. (Exception from HRESULT: 0x8007007E)

   at System.StubHelpers.StubHelpers.GetWinRTFactoryObject(IntPtr pCPCMD)
   at PhoneDirect3DXamlAppComponent.Direct3DInterop..ctor()
   at PhoneDirect3DXamlAppInterop.MainPage.DrawingSurfaceBackground_Loaded(Object sender, RoutedEventArgs e)
   at MS.Internal.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args)
   at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName)

如果有人有任何相同的想法,请帮忙

4

1 回答 1

0

我会更新新发布的 Cocos2d-x v3,因为它支持 WP8。

http://cocos2d-x.org/download

发行说明:https ://github.com/cocos2d/cocos2d-x/blob/v3/docs/RELEASE_NOTES.md

于 2014-05-01T21:43:12.540 回答