문제

I have created a project that runs on Windows Phone 8 that uses the template Direct3D With XAML provided by the Windows Phone SDK. I have also incorporated DirectXTK and declared a std::unique_ptr<DirectX::SpriteBatch> m_SB; in the CubeRenderer.h

When I try to assign it in the function CreateDeviceResources thus:

m_SB.reset(new SpriteBatch(m_d3dContext.Get()));

it gives the error: An unhandled exception of type 'System.AccessViolationException' occurred in Unknown Module.

I do not know why this is. This works perfectly if I create the project with the Direct3D (Native) template.

Any help would be appreciated.

도움이 되었습니까?

해결책

You have to put the code inside the CreateWindowSizeDependentResources function, then it should work fine.

Source

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top