User Tools

Site Tools


tutorials:legacy:net_xna:getting_started_1_hello_world

This binding has been deprecated - please see the most recent release notes for more information.

Getting Started I (Hello World)

Introduction

In this tutorial you will prepare your development environment for use with the .NET bindings for Gestureworks Core. While no code will be written in this tutorial, the steps performed here will prepare your environment for subsequent Gestureworks Core .NET tutorials.

For this tutorial you will need the Gestureworks Core multitouch framework; a free trial is available.

Download the code for all of the C# & XNA multitouch tutorials here: tutorials_csharp_xna.zip

Gestureworks Core "Bindings"

The various bindings included with Gestureworks Core allow a developer to create multitouch applications using their preferred language and framework, and are essentially mini-APIs providing an interface to the functions exported by the native Gestureworks Core library (GestureWorksCoreWin7.dll, GestureWorksCoreWin8.dll). Source code for each of the bindings is included so that you may extend or modify them as you like, as well as providing a blueprint for creating bindings for other languages or frameworks.

You may download the API documentation for the .NET bindings in *.chm format here: gestureworkscorenet_help.zip

Gestureworks Core .NET and XNA


The .NET bindings for Gestureworks Core can be used by any .NET project. The source code for the .NET bindings is provided for portability and extensibility, but can be used quite effectively as-is in most situations.


In this and the following tutorials, Microsoft's XNA Game Studio 4.0 is used for demonstrating Gestureworks Core fundamentals using the .NET bindings. XNA Game Studio – while unfortunately no longer supported by Microsoft – is an easy-to-use framework providing methods for loading content (e.g. bitmap images), displaying that content on screen, and manipulating it; this allows us to focus on the use of Gestureworks instead of the intricacies of writing supporting code from scratch.


Requirements

Time to complete: 15 minutes

A number of software packages are required for completing this and the following .NET tutorials, as well as a multitouch display device and familiarity with object oriented programming in C#.

  • Gestureworks Core license
  • Microsoft Windows 7 or 8
  • Microsoft Visual Studio (C# 2010 Express or 2010 Professional)
  • .NET Framework 4.0+
  • XNA Game Studio 4.0 Refresh
  • Games For Windows Marketplace Client (Windows 8 only)
  • Multitouch display device

Process Overview

Process Detail

1. Download and install software prerequisites

Each of the following software packages must be downloaded and installed prior to continuing with the tutorial. Note that because XNA Game Studio 4.0 does not officially support Windows 8, there is an extra package (Games For Windows Marketplace Client) that must be installed before XNA; Windows 7 does not have this requirement.

  1. Microsoft Visual C# 2010 Express
  2. XNA Game Studio 4.0 Refresh
  3. For more information on Windows 8 and XNA Game Studio issues, see:

2. Download and install Gestureworks Core package

The Gestureworks Core installer package – GestureWorksCoreSetup.exe – contains the main GestureWorksCore.dll files (the “native” DLLs), various bindings (C++ .NET, Python, etc.), and supporting documentation. Gestureworks Core must be licensed prior to use in any software project.

Download the Gestureworks Core Trial package from here.

Double-click the downloaded installer package GestureWorksCoreSetup.exe to install Gestureworks Core. Gestureworks Core consists of the Gestureworks Core DLLs as well as various tutorials, bindings, and documentation:

GestureWorksCore*.dlls
\GestureworksCore\GestureworksCore32.dll
\GestureworksCore\GestureworksCore64.dll

Sample GestureML file:
\GestureworksCore\basic_manipulation.gml

.NET bindings (project source)
\GestureworksCore\bindings\dotNET\gwc_net

.NET bindings (compiled libraries)
\GestureworksCore\bindings\dotNET\gwc_net\bin\x64\Release
\GestureworksCore\bindings\dotNET\gwc_net\bin\x86\Release

.NET documentation (also available as downloadable *.chm help file)
\GestureworksCore\bindings\dotNET\gwc_net\docs\Help

.NET tutorials
\GestureworksCore\bindings\dotNET\XNA\tutorials

Assets for the tutorials
\GestureworksCore\bindings\dotNET\XNA\tutorials\assets

3. Create a new XNA Game solution in Visual Studio

Microsoft's XNA Game Studio 4.0 provides an easy-to-use framework for developing interactive graphics-based applications using C# and .NET. XNA supplies easy bitmap display using the “content pipeline” as well as a ready-made draw loop that’s perfect for use with Gestureworks.

First, create a new XNA Game Studio solution in Visual Studio 2010:

  1. Click File → New Project
  2. Under Installed Templates, click XNA Game Studio 4.0
  3. Click Windows Game (4.0)
  4. Name the solution GestureWorksTutorial1
  5. (optional) Click Browse… to select a location for the solution folder
  6. Check Create directory for solution
  7. Click OK

4. Add Gestureworks Core .NET reference to project

Next, add a reference to the appropriate GestureWorksCoreNET.dll to the GestureWorksTutorial1 project:

  • Right-click References under GestureWorksTutorial1
  • Click Add Reference

  • In the dialog that appears, select the Browse tab and navigate to the GestureWorksCoreNET*.dll appropriate for your application's platform (x86 vs. x64), then click OK.
  • NOTE: These tutorials assume a 32-bit application, thus we will add GestureWorksCoreNET32.dll to our project for the tutorials.
  • The Gestureworks Core .NET DLLs can be found here:
  \GestureWorksCore\bindings\dotNET\gwc_net\bin\x64\Release\GestureWorksCoreNET64.dll
  \GestureWorksCore\bindings\dotNET\gwc_net\bin\x86\Release\GestureWorksCoreNET32.dll

The Gestureworks Core .NET reference is now added to the GestureWorksTutorial1 project and will appear in its References. This will allow using the Gestureworks Core .NET bindings' code in the following tutorials.

Please note that this procedure added a reference to the binary version of the .NET bindings DLL and not the native Gestureworks Core DLL (GestureworksCore32.dll / GestureworksCore64.dll). You will learn more about the Gestureworks Core DLL in the next tutorial, .NET & XNA: Getting Started II (Hello Multitouch).

5. Compiler settings

There are some compiler settings that are unique to XNA development, and others that are applicable to all development with the Gestureworks Core .NET bindings.

  1. 32- vs. 64-bit
    • Please ensure that you target the correct version of the .NET bindings DLL (GestureWorksCoreNET.dll) and the native GestureWorksCore*.dll for your platform and application, i.e. 32-bit vs. 64-bit. Targeting the GestureWorksCore*.dll is covered further in .NET & XNA: Getting Started II (Hello Multitouch).
  2. .NET Target framework version
    • When developing with Microsoft XNA Game Studio, you must specify .NET Framework 4 as the target framework for your projects. Do so by right-clicking on a project in the Solution Explorer, click Properties, and in the Application tab select .NET Framework 4 with the Target framework: drop-down.


Review

In this tutorial we installed Gestureworks Core, the prerequisites for developing with the Gestureworks Core .NET bindings, and created a solution that includes the .NET bindings project. From here we move on to NET & XNA: Getting Started II (Hello Multitouch) in which we dig into actual source code, initializing Gestureworks Core and working with touch and gesture event data.


Other development Options

With the release of Windows 8, Microsoft has gone quiet on the future of XNA Game Studio. However, the community has stepped up by developing MonoGame, an open source version of XNA. For more information, see the MonoGame site on CodePlex.


Next up: .NET & XNA: Getting Started II (Hello Multitouch)

tutorials/legacy/net_xna/getting_started_1_hello_world.txt · Last modified: 2019/01/21 19:24 (external edit)