获取显示屏的个数和分辨率 — 通过使用OpenGL的GLFW库
程序
#include <iostream>
// GLFW
#include <GLFW/glfw3.h>
int main()
{
// Init GLFW
glfwInit();
// Set all the required options for GLFW
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
glfwWindowHint(GLFW_RESIZABLE, GL_FALSE);
int monitorCount;
//GLFWmonitor* pMonitor = glfwGetPrimaryMonitor();
GLFWmonitor** pMonitor = glfwGetMonitors(

该博客介绍了如何通过OpenGL的GLFW库来获取显示屏的数量及其分辨率,详细解析了相关程序的实现,并提供了参考链接。
最低0.47元/天 解锁文章
644

被折叠的 条评论
为什么被折叠?



