I’m creating a graphing calculator app and I need a lot of gamepage to xaml page navigation. It all works except when I try going out of the app and then resume. Resuming even works fine if you don’t have additional xaml pages (i.e. if you haven’t navigated from and back to the gamepage), but if you have some it just doesn’t want to draw user primitives (spritebatch does work).
Now, in emulator, when you navigate to gamepage and back and try going out and then back into the app it will crash. On a device, It doesn’t crash, just doesn’t render the triangle. Spritebatch obviously still works!
(I am aware that some stuff in the test app are not as optimized as possible, like creating new basic effect every frame and such…)
EDIT: The error thrown when debugging in emulator is “A first chance exception of type ‘System.TypeLoadException’ occurred in SharpDX.DLL
Additional information: Could not find Windows Runtime type ‘SharpDX.WP8.Interop’.”
On the GraphicsDevice.DrawUserPrimitives(); line
I have done some more research and it seems that the GraphicsDevice gets suspended:
A first chance exception of type 'SharpDX.SharpDXException' occurred in SharpDX.DLL
Additional information: HRESULT: [0x887A0005], Module: [SharpDX.DXGI], ApiCode: [DXGI_ERROR_DEVICE_REMOVED/DeviceRemoved], Message: The GPU device instance has been suspended. Use GetDeviceRemovedReason to determine the appropriate action.
But this happens only if you navigate between pages! If you don’t, this does not happen. Any solutions for this?
I guess you are using a fairly old version of MonoGame that dosn’t support resuming on WP8 yet. I recommend building MonoGame yourself from github. Also, it seems that the reference to SharpDX.WP8.winmd is missing (which was missing in old MonoGame versions).
Have you had any luck with this? I am currently trying to work through what I think is the same issue.
Edit: I mean without re-writing and using the go back like in hybrid silverlight/xna apps. I am now going through the process of re-writing I guess now too ! :\
Nope, I just went with one game class (gamepage) to rule them all… It even worked out better than expected! But I know that in most cases it wont be that easy.