How detect current screen resolution?

前端 未结 7 1069
悲哀的现实
悲哀的现实 2020-11-27 04:00

How do I from Winapi (in C or C++) detect the current screen resolution?

Some background:

I want to start a new OpenGL fullscreen window, but want it open wi

7条回答
  •  迷失自我
    2020-11-27 04:16

    I use the GetSystemMetrics function

    GetSystemMetrics(SM_CXSCREEN) returns screen width(in pixels)

    GetSystemMetrics(SM_CYSCREEN) - height in pixels

    https://msdn.microsoft.com/en-us/library/windows/desktop/ms724385%28v=vs.85%29.aspx

提交回复
热议问题