[[tutorials:legacy:net_xna|{{ :ms-xna.logo.png }}]]

This binding has been deprecated - please see the most recent [[:release_notes| 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 [[http://gestureworks.com/|Gestureworks Core]] multitouch framework; a [[http://files.gestureworks.com/downloads/Core/Trial/GestureworksCoreTrialSetup.exe|free trial]] is available. Download the code for all of the **C# & XNA** multitouch tutorials here: [[http://files.gestureworks.com/tutorials/tutorials_csharp_xna.zip|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: [[http://files.gestureworks.com/tutorials/GestureWorksCoreNET_Help.zip|gestureworkscorenet_help.zip]] ==== Gestureworks Core .NET and XNA ==== {{:net_logo.jpg?nolink |}}~~CLEARFLOAT~~
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. {{:ms-xna.logo.png?direct |}}~~CLEARFLOAT~~
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 ===== The following primary steps are performed in this tutorial: - [[tutorials:legacy:net_xna:getting_started_1_hello_world#download_and_install_software_prerequisites|Download and install software prerequisites]] - [[tutorials:legacy:net_xna:getting_started_1_hello_world#download_and_install_gestureworks_core_package|Download and install Gestureworks Core package]] - [[tutorials:legacy:net_xna:getting_started_1_hello_world#create_a_new_xna_game_solution_in_visual_studio|Create a new solution in Visual Studio]] - [[tutorials:legacy:net_xna:getting_started_1_hello_world#add_gestureworks_core_net_reference_to_project|Add Gestureworks Core .NET reference to project]] - [[tutorials:legacy:net_xna:getting_started_1_hello_world#compiler_settings|Compiler settings]] ---- ===== 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. - Microsoft Visual C# 2010 Express * Install [[http://www.microsoft.com/visualstudio/eng/downloads#d-2010-express|Microsoft Visual C# 2010 Express]] * NOTE: You may also use Visual Studio 2010 Professional - [[http://www.microsoft.com/en-us/download/details.aspx?id=30653|.NET Framework 4.5]] - XNA Game Studio 4.0 Refresh * Windows 8 only: Install the [[http://www.xbox.com/en-US/LIVE/PC/DownloadClient|Games For Windows Marketplace Client]] first * Windows 7 & 8: Install [[http://www.microsoft.com/en-us/download/details.aspx?id=27599|XNA Game Studio 4.0 Refresh]] - For more information on Windows 8 and XNA Game Studio issues, see: * [[http://blogs.msdn.com/b/astebner/archive/2012/02/29/10274694.aspx|How to work around a possible XNA Game Studio or Windows Phone SDK install failure on Windows 8]] * [[http://stackoverflow.com/questions/12849107/how-to-install-the-xna-game-studio-4-0-in-windows-8|How to install the XNA Game Studio 4.0 in Windows 8?]] - Optional: [[http://www.microsoft.com/en-us/download/details.aspx?id=27598|Microsoft XNA Framework Redistributable 4.0 Refresh]] * If you wish to run your XNA Game Studio-based application on other computers, the [[http://www.microsoft.com/en-us/download/details.aspx?id=27598Microsoft XNA Framework Redistributable 4.0 Refresh]] must be installed ==== 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 [[http://files.gestureworks.com/downloads/Core/Trial/GestureworksCoreTrialSetup.exe|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 {{:tutorials:net_xna:gestureworkscorenet_help.zip|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: - Click **File → New Project** - Under Installed Templates, click **XNA Game Studio 4.0** - Click **Windows Game (4.0)** - Name the solution **GestureWorksTutorial1** - (optional) Click **Browse**... to select a location for the solution folder - Check **Create directory for solution** - Click **OK** {{ :tutorials:net_xna:gw_tut_1.1.png?nolink |}} ==== 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**... {{ :tutorials:net_xna:gw_tut_1.5.png?nolink |}} * 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 {{ :tutorials:net_xna:gw_tut_1.6.png?nolink |}} 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. {{ :tutorials:net_xna:gw_tut_1.7.png?nolink |}} 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, [[tutorials:legacy:net_xna:getting_started_2_hello_multitouch|.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. - 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 [[tutorials:legacy:net_xna:getting_started_2_hello_multitouch|.NET & XNA: Getting Started II (Hello Multitouch)]]. - .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. {{ :tutorials:net_xna:gw_tut_1.8.png?nolink |}} ---- ===== 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 [[tutorials:legacy:net_xna:getting_started_2_hello_multitouch|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 [[https://monogame.codeplex.com/|MonoGame site on CodePlex]]. ---- Next up: [[tutorials:legacy:net_xna:getting_started_2_hello_multitouch|.NET & XNA: Getting Started II (Hello Multitouch)]]