Search code examples
c++openglwindowglfw

glfw get monitor width/height


I am new to OpenGL, glfw in particular, and was wondering if it is possible to retrieve the preferred monitor's width/height (in C/C++)? e.g. something like: unsigned int width = glfwGetMonitorWidth(), height = glfwGetMonitorHeight();


Solution

  • If you need the monitor size in pixels - you must be looking for glfwGetVideoMode

    If you need the physical monitor size (in millimeters) - there is glfwGetMonitorPhysicalSize