列出使用GLFW的可用视频模式

时间:2014-05-29 22:09:14

标签: c++ c opengl glfw

我正在尝试使用GLFW 3检索我的显示器的可用视频模式列表,但我很难理解GLFW帮助页面。

我可以按如下方式检索当前的视频模式:

int county
const GLFWvidmode* modes = glfwGetVideoModes(glfwGetPrimaryMonitor(), &county);

int width = modes->width;
int height = modes->height;

但如何检索视频模式列表?根据这个应该是可能的:

http://www.glfw.org/docs/latest/monitor.html

1 个答案:

答案 0 :(得分:4)

它将为您提供一组模式,其大小由county给出(代码中显示的变量名称)。 因此,您需要将modes从零循环到小于county