mardi 16 février 2010

Mastering Surface SDK

To develop on our project we of course use Microsoft technologies since the game will be on the Microsoft Surface Table. So we do C# with the XNA and Surface framework in visual studio.

There are two ways to work with the Surface SDK, WPF and XNA.

WPF which would be similar to do a windows application, is quite easy to design and implement. You can drag components like buttons or scroll bars with a nice visual interface and then add functions to events liked to these components (buttons pressed, bar scrolled...). This way is quite easy to design and develop but have limitations as well.

XNA which is a framework originally designed to let developers create easily game for the XBOX. Is a bit more difficult to implement but gives you more possibilities. For example just to implement a button with XNA you need to do everything from the design, program the possible evens and action when in WPF its almost as easy as dragging it on the interface, on the other hand XNA will let you have any kind of button while in WPF you are limited to the standard design.

Since we are making a video game we choose XNA without much hesitation because the framework is much more adapted to the kind of applications, WPF would be a better choice to design quickly an interface for a more practical application like ordering tickets in a train station. Then most of the future posts will be about the XNA framework on Surface and not WPF.

The SDK is provided with quite good examples in both XNA and WPF that cover most of the interactions one would like to implement with Surface, like dragging, scaling, flickering...

The code source is available for all these examples and they are generally sufficient to see how to do everything which is specific to Surface. Then the rest is just XNA and a lot of documentation and examples are available online about XNA.

In addition a very good tool to develop on Surface is the Surface simulator. It can handle multiple mousses to simulate multiple fingers, can simulate finger, objects of any size and tags. It is possible as well to simulate the fact that you hold a finger or a tag on the table just by pushing two buttons and then you can simulate any number of (immobile) contacts.

The simulator is well integrated with Visual Studio and just if the simulator is running just by launching the debug of your program, it will by automatically open in Surface (with still all the debug functions available on Visual Studio.

There is only one problem with the simulator but it can get quite an issue. It’s that even though the resolution of Surface is quite low (1024x768) the simulator will need at least a resolution of 1280x960 to operate. And it not only that it won’t fit totally in a smaller screen, it means that it won’t launch if the screen don’t have the right resolution and will close automatically if it detects that you don’t have the proper resolution anymore... Then if like us you want to develop for Surface on a laptop, since most of them have resolution of 1280x800 an external screen is needed anytime you want to develop.

Aucun commentaire:

Enregistrer un commentaire