/// <summary> /// Returns an array of all video modes supported by the specified /// monitor. The returned array is sorted in ascending order, first by /// color bit depth (the sum of all channel depths) and then by /// resolution area (the product of width and height). /// </summary> /// <param name="monitor"> /// The monitor to query. /// </param> /// <returns> /// An array of video modes, or Null if an error occurred. /// </returns> public static VideoMode[] GetVideoModes(MonitorHandle monitor) { VideoMode *videoModePointer = GetVideoModes(monitor, out int count); var result = new VideoMode[count]; for (int i = 0; i < count; i++) { result[i] = videoModePointer[i]; } return(result); }
public static VideoMode[] GetVideoModes(MonitorPtr monitor) { unsafe { int count; VideoMode *ptr = glfwGetVideoModes(monitor, out count); CheckError(); VideoMode[] result = new VideoMode[count]; for (int i = 0; i < count; i++) { result[i] = ptr[i]; } return(result); } }