Sorry, the Forum is closed :(

Unfortunately, the forum is now closed.

Please read the following post for further details.

We apologize for the inconvenience.
The SharpDX team.
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: [WP8][Toolkit] SharpDX.Toolkit.Game with XAML menu

[WP8][Toolkit] SharpDX.Toolkit.Game with XAML menu 1 year 4 months ago #1270

I am using a SharpDX.Toolkit.Game on a page navigated to from a main menu.

When going back to the menu and then back into the game (thus reloading the game), it throws an error when creating some graphics resources (usually the first SpriteBatch I use, but it can change based on the debugging, i.e. when native code debugging is turned on, no error is thrown, but it doesn't render anything).

I dispose of the graphicsDeviceManager to get the xaml menu to render when returning to the main page (otherwise nothing will render. Found that out through random testing...)

Is there something I am missing to get the resources to properly reload, or is there something broken internally.
The administrator has disabled public write access.

Re: [WP8][Toolkit] SharpDX.Toolkit.Game with XAML menu 1 year 4 months ago #1281


  • Posts:843 Thank you received: 1
  • xoofx's Avatar
  • xoofx
  • Administrator
  • OFFLINE
The game class is not designed to handle this, so you will have to properly dispose the game class before getting out of the page (probably calling game.Exit(), and then game.Dispose()). You will have also to get the latest source code that is fixing Dispose of the Game class and all other dependent classes.
The administrator has disabled public write access.

Re: [WP8][Toolkit] SharpDX.Toolkit.Game with XAML menu 1 year 4 months ago #1300

Hmm, using the latest source everything I try on the phone just leads to a black screen (even the samples).

Though, it will navigate between the menu and the game correctly.
The administrator has disabled public write access.

Re: [WP8][Toolkit] SharpDX.Toolkit.Game with XAML menu 1 year 4 months ago #1301


  • Posts:843 Thank you received: 1
  • xoofx's Avatar
  • xoofx
  • Administrator
  • OFFLINE
The WP8 version is certainly not designed for such a scenario, even with latest build and would require some code refactoring to do this.
The administrator has disabled public write access.

Re: [WP8][Toolkit] SharpDX.Toolkit.Game with XAML menu 1 year 4 months ago #1302

Sorry, I mean even the samples (with only the game page) do not work properly on the phone, with the latest source.
The administrator has disabled public write access.

Re: [WP8][Toolkit] SharpDX.Toolkit.Game with XAML menu 1 year 4 months ago #1303


  • Posts:843 Thank you received: 1
  • xoofx's Avatar
  • xoofx
  • Administrator
  • OFFLINE
Ah, well, as I don't own a phone and I can't have one in my country, I can't debug this. You will have to debug this and find why there is a bug.
The administrator has disabled public write access.

Re: [WP8][Toolkit] SharpDX.Toolkit.Game with XAML menu 1 year 4 months ago #1304

i think I may have found a solution.

In the GamePlatformWP8 the IsBlockingRun should be false, instead of true, as the gameWindowWP8.RunDrawingSurfaceBackground(initCallback, tickCallback); does not block.

(I also added a call to OnExiting in the Game class in Exit, but this shouldn't affect the starting/rendering when starting).

Making this change seems to fix the samples. For some reason other projects I create don't seem to work, but I will try copying a sample project and changing stuff to see what makes it break.
The administrator has disabled public write access.

Re: [WP8][Toolkit] SharpDX.Toolkit.Game with XAML menu 1 year 4 months ago #1305


  • Posts:843 Thank you received: 1
  • xoofx's Avatar
  • xoofx
  • Administrator
  • OFFLINE
Oh, yes GamePlatformWP8.IsBlockingRun should be false, thanks for finding this. This should be fixed in revision r1fe627dd57b3.
The administrator has disabled public write access.
  • Page:
  • 1
Time to create page: 0.213 seconds