> For the complete documentation index, see [llms.txt](https://docs.flatredball.com/gum/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flatredball.com/gum/code/getting-started/setup/empty-project-before-adding-gum/silk.net.md).

# Silk.NET

## Introduction

Gum can be used in Silk.NET projects by importing Gum's `Gum.SilkNet` NuGet package. `Gum.SilkNet` renders through SkiaSharp and adds real Forms input via `Silk.NET.Input`; your project still owns window creation and the render loop.

## Creating a New Project

Before using Gum, you should first verify that you can create a normal windowed Silk.NET project. For the full API reference, see the Silk.NET documentation: <https://dotnet.github.io/Silk.NET/docs/v3/>

{% hint style="info" %}
To skip these steps, run [`gumcli new MyGame -p silknet`](/gum/cli/cli/new.md). It creates a Silk.NET project with Gum already added and a window that opens on Windows, macOS, and Linux.
{% endhint %}

If you are starting a brand new Silk.NET project from scratch, you can follow these steps:

{% tabs %}
{% tab title="Visual Studio" %}
First, create an empty console project

1. Open Visual Studio
2. Select File -> New Project, or select the **Create a new project** option in the popup window.
3. Select the option to create a **Console App**
4. Enter a name, select a location, then click **Next**
5. Select the desired **Framework** and other options, then click **Create**

Next, add the needed NuGet package:

1. Expand your game project in the Solution Explorer
2. Right-click on **Dependencies** and select **Manage NuGet Packages**
3. Search for and install `Silk.NET.Windowing`
4. Search for and install `Silk.NET.Windowing.Sdl`. Gum requires the SDL window backend.
   {% endtab %}
   {% endtabs %}

Once you have your project set up, it might look similar to the following code block — a window that opens and clears to a solid color every frame:

```csharp
using Silk.NET.Windowing;
using Silk.NET.Windowing.Sdl;
using Silk.NET.Maths;

namespace SilkNetExample1;

public class Program
{
    public static void Main()
    {
        SdlWindowing.Use();

        var options = WindowOptions.Default;
        options.Size = new Vector2D<int>(800, 480);
        options.Title = "Gum Sample";

        using var window = Window.Create(options);

        window.Render += delta =>
        {
            // Per-frame rendering goes here.
        };

        window.Run();
    }
}
```

Next, you can begin adding Gum to your project. For more information see the [Adding/Initializing Gum](/gum/code/getting-started/setup/adding-initializing-gum/silk.net.md) page.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.flatredball.com/gum/code/getting-started/setup/empty-project-before-adding-gum/silk.net.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
