A Windows Store Story - Part #5

posted in New New Things
Published January 25, 2018
Advertisement

Progress! I managed to get remote debugging working on the tablet and found the cause of the crash bug at once:

Interestingly during initialisation of the input wrapper I registered for gyro changing events before the basic input setup was complete. And, lo and behold, I received an event before the input init completed. Null pointer, bam! instant crash. Weirdly, this never happened on Windows phone. Seems UWP has some subtle differences between platforms.

So now that crash cause is history and the next release is up.

 

Now a bit more about the framework I've setup. I've tried two or three times to set up a simple UWP sample app and include the main game code in that. The sample app was setup differently (but I think I didn't do it on purpose, rather the SP of Visual Studio 2015 changed to 3 in between)

With the first two tries the sample app had some XAML stuff (which I don't really like), and I never got the swap chain to work properly. With the 3d try there was no XAML document at all, and this time the swap chain worked (after a few attempts with different parameters)

There's quite a few preconditions and certain parameter combinations that are mandatory. Luckily the runtime spits out a pretty descriptive error message what was actually expected. 

 

Using a generic framework for both Win32 and UWP proves a tad tricky, since UWP wants a managed main method. With a bit of pseudo global magic (I've got one environment instance where several services like renderer, logger, sound and also the main application register) I was able to refactor the main function out. 
So for HitBlock Deluxe I have a solution with a shared project containing the actual game logic, and a UWP and Win32 application project; both having the shared project as dependency. 

Current gotchas: Since UWP requires assets to be embedded, and absolutely does not want assets from outside the project folder, I share the assets from the UWP project. Ugly, but works.

 

And there's a new crash, unfortunately without any crash info. Oh well....

1 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement