Search code examples
c#visual-studioopenglopentk

OpenTK Windows Application screen size?


I'm working on a small project in OpenTK and I want to get the screen resolution of the primary monitor. My application is a windows application, I have tried to use
width = Screen.PrimaryScreen.Bounds.Width;
But The name 'screen' does not exists in the current context.
I have included the required using statements, is there any other way to get screen size?


Solution

  • Try using DisplayDevice.

     int width = DisplayDevice.Default.Width;
     int height = DisplayDevice.Default.Height;
    

    Source here