OpenTK tutorial exits with code -1073740791

35 views Asked by At

I'm following the tutorial in this link: https://opentk.net/learn/chapter1/1-creating-a-window.html?tabs=baseclass-opentk4%2Cgamewindow-ctor-opentk4%2Cgamewindow-run-opentk4%2Ckeypress-opentk4

I'm doing this on Visual Studio Code. I'm using net8.0 and OpenTK=4.8.2

This is what the .csproj looks like:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net8.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="OpenTK" Version="4.8.2" />
  </ItemGroup>
</Project>

The files that I have are:

Game.cs

using OpenTK.Windowing.Desktop;
using OpenTK.Mathematics;

namespace ARPG
{
    public class Game : GameWindow
    {
        public Game(int width, int height, string title) : base(GameWindowSettings.Default, new NativeWindowSettings() { ClientSize = new Vector2i(width, height), Title = title })
        {

        }
    }
}

Program.cs

namespace ARPG {
    class Program {
        static void Main(string[] args) {
            Game game = new Game(800,600,"Game");
            game.Run();
        }
    }
}

I'm getting the error

The program '[3112] MAIN.exe' has exited with code -1073740791 (0xc0000409).

when this line is getting invoked:

Game game = new Game(800,600,"Game");

Any help is appreciated.

0

There are 0 answers