16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-18 03:09:18 +02:00

configurable fullscreen monitors

This commit is contained in:
milek7
2019-02-21 00:06:51 +01:00
parent cbd640a6aa
commit 56584dc13e
7 changed files with 72 additions and 9 deletions

View File

@@ -579,7 +579,25 @@ eu07_application::init_glfw() {
// match requested video mode to current to allow for
// fullwindow creation when resolution is the same
auto *monitor { glfwGetPrimaryMonitor() };
auto *monitor { glfwGetPrimaryMonitor() };
{
int monitor_count;
GLFWmonitor **monitors = glfwGetMonitors(&monitor_count);
WriteLog("available monitors:");
for (size_t i = 0; i < monitor_count; i++) {
const char *name = glfwGetMonitorName(monitors[i]);
int x, y;
glfwGetMonitorPos(monitors[i], &x, &y);
std::string desc = std::string(name) + ":" + std::to_string(x) + "," + std::to_string(y);
WriteLog(desc);
if (desc == Global.fullscreen_monitor)
monitor = monitors[i];
}
}
auto const *vmode { glfwGetVideoMode( monitor ) };
glfwWindowHint( GLFW_RED_BITS, vmode->redBits );