Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Getting Started on Windows
This guide assumes that you will be writing code using Visual Studio 2017. You can acquire Visual Studio 2017 Community Edition for free from Microsoft at https://www.visualstudio.com.
Creating a New Project
First, let's create a new project. From the FILE menu, select New and then Project... to open the New Project dialog. Choose Console App (.NET Framework) from the list of project types, and make sure that you're targeting .NET Framework 4.6.1 or later using the dropdown list at the top of the window.
Once you've selected the appropriate project type and target framework, give your project a suitable name, then click OK to create it.
Configuring the Project
Though we created our project as a Console App, we probably don't actually want to display the console when we run our game—at least, not most of the time. You can prevent the console window from being displayed by changing your project's properties.
In the Solution Explorer window, right-click on your project and select Properties from the context menu. Changing your project's output type from Console Application to Windows Application will hide the console.
Setting up Ultraviolet
With your project configured, the next thing you'll need to do is retrieve the Ultraviolet Framework assemblies and add them as references. The easiest way to do this is through NuGet.
In the Solution Explorer window, right-click on the References node beneath your project and select Manage NuGet Packages. This will open the NuGet Package Manager window. Click the Browse tab and search for Ultraviolet. This will return a list of all of the Ultraviolet Framework's official NuGet packages. There's one for every Ultraviolet assembly, and in some cases it may be useful to pick and choose just the ones you want. For the purposes of this guide, though, we're going to go with the simplest solution.
Look through the search results until you find a package called Ultraviolet.Game.Desktop. This package contains a complete skeleton of a working Ultraviolet Framework project. Adding it to your project will automatically pull in all of the required libraries, and it will also inject two code files into your project: a new Program.cs file (which will replace the one which already exists), and a file called Game.cs.
The Game.cs file contains an example implementation of the UltravioletApplication class; this is the starting point for all of your application's code. For example, the
OnUpdating() method should contain your application's update logic, and the
OnDrawing() method should be where you place your application's rendering logic.
At this point your project should run without any further modification. Press the F5 key to execute the program and you will be presented with an empty, cornflower blue window.
You now have a complete Ultraviolet Framework application. Enjoy!