Direct2d access violation in C++ XAML game -
i have created windows phone game in c++ (native only) using directxtoolkit , wanted recreate app using xaml , c++.
i followed steps this tutorial got stuck on following problem.
in void renderer::createdeviceresources()
function calling m_spritebatch = unique_ptr<spritebatch>(new directx::spritebatch(m_d3dcontext.get()));
this is, however, causing problem in mainpage.xaml.cs
inside drawingsurfacebackground_loaded
function @ line drawingsurfacebackground.setbackgroundcontentprovider(m_d3dbackground.createcontentprovider());
i getting an unhandled exception of type 'system.accessviolationexception' occurred in unknown module. attempted read or write protected memory. indication other memory corrupt.
when removing m_spritebatch...
line starting fine can't render sprites in game.
any idea how fix this? new c++ don't know look.
this guess, perhaps cannot instantiate using "new" doing:
(new directx::spritebatch(m_d3dcontext.get()))
in case, new allocating memory heap. causing memory access violation?
Comments
Post a Comment