如何使用FREEGLUT获得多显示器的所有支持分辨率
how to get all supported resolution for multi monitor using FREEGLUT?
我有Windows代码,可以为多个显示器创建可用分辨率列表。
现在我必须将其移植到 Linux 上,所以我正在考虑使用"FREEGLUT",以便我可以使用相同的代码获取 Linux 和 Windows 的监视器相关信息。
我需要帮助来获取一些指针来获取多个显示器的所有支持分辨率..?
我希望我们能用免费的过剩来做到这一点。
Linux 本身没有图形系统。你必须依靠像X11或Wayland这样的东西。现在X11是通常发现的系统,用于枚举和配置监视器的X11-API称为XRandR。FreeGLUT并没有真正公开这个功能。因此,要么使用可以执行的框架,要么自己实现它。
请注意,当涉及到多显示器环境时,窗口管理器对窗口放置也有发言权。
我正在使用GLFW 3.0.4来获得多显示器支持的分辨率。我更喜欢使用特定于平台的功能来应用显示器分辨率。
// Get Resolution of Multimonitor
int totalMonitor;
GLFWmonitor** monitors = glfwGetMonitors(&totalMonitor);
printf("nn---------------------------------------------------------");
printf("n Total monitor [%d]",totalMonitor);
printf("n primary monitor [%s]",glfwGetMonitorName(glfwGetPrimaryMonitor()));
printf("nn---------------------------------------------------------");
for(int currMonitor=0;currMonitor<totalMonitor;currMonitor++)
{
printf("n monitor name: [%s]",glfwGetMonitorName(monitors[currMonitor]));
int count;
const GLFWvidmode* modes = glfwGetVideoModes(monitors[currMonitor], &count);
for (int i = 0; i < count; i++)
{
printf("n %d : [%d X %d]~[%d]",i,modes[i].width,modes[i].height,modes[i].refreshRate);
}
printf("n---------------------------------------------------------");
}
相关文章:
- 编译时未启用intel oneApi CUDA支持
- POCO::PostgreSQL:如何将std::vector支持添加到`Binder::bind`
- 使用CMake检测支持的C++标准
- 为什么istream不支持右值提取
- 当我编译webrtc服务器时,Windows上只支持clang-cl
- 扩展光电二极管探测器以支持多个传感器
- MSVC是否支持C++11样式的属性而不是__declspec
- 在使用GPU支持编译Tensorflow时,会遇到CUDA_TOOLKIT_PATH未绑定变量
- 当使用比格式支持的精度更高的精度来显示数字时,会写出什么数据
- 使用分辨率定理用Z3证明
- Alt+Enter 在 Win32 应用中,管理大小调整和分辨率
- Opencv 恢复到比我设置的更高的分辨率
- 错误:(-210:不支持的格式或格式组合)功能'create'中的硬件视频解码器不支持视频源
- 哪个C++规范开始支持 std::vector
- 如何在 SDL2 中获取视频卡的所有支持分辨率
- 如何使用FREEGLUT获得多显示器的所有支持分辨率
- C++ 获取支持的相机分辨率和帧速率 OSX
- 获取所有支持的屏幕分辨率
- 无法在Qt 5.0.2(Linux)中使用QCamera获取相机支持的分辨率以进行图像捕获
- 不支持缩放/固定输出分辨率