AssemblyBrowser.SimpleGLWindow.SimpleGLWindow C# (CSharp) Method

SimpleGLWindow() public method

public SimpleGLWindow ( string title, int desiredWidth, int desiredHeight ) : System
title string
desiredWidth int
desiredHeight int
return System
        public unsafe SimpleGLWindow(string title, int desiredWidth, int desiredHeight)
        {
            _nativeWindow = new NativeWindow(desiredWidth, desiredHeight, title, GameWindowFlags.Default, GraphicsMode.Default, DisplayDevice.Default);
            _scaleFactor = NativeWindow.Width / desiredWidth;

            GraphicsContextFlags flags = GraphicsContextFlags.Default;
            _graphicsContext = new GraphicsContext(GraphicsMode.Default, NativeWindow.WindowInfo, 3, 0, flags);
            _graphicsContext.MakeCurrent(NativeWindow.WindowInfo);
            ((IGraphicsContextInternal)_graphicsContext).LoadAll(); // wtf is this?
            GL.ClearColor(Color.Black);

            NativeWindow.Closing += OnWindowClosing;

            NativeWindow.KeyDown += OnKeyDown;
            NativeWindow.KeyUp += OnKeyUp;
            NativeWindow.KeyPress += OnKeyPress;

            ImGui.LoadDefaultFont();

            SetOpenTKKeyMappings();

            CreateDeviceObjects();
        }