|
|
|
@ -71,7 +71,21 @@ void Instance::initWindow() { |
|
|
|
|
glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API); |
|
|
|
|
glfwWindowHint(GLFW_RESIZABLE, GLFW_TRUE); |
|
|
|
|
glfwWindowHint(GLFW_MAXIMIZED, GLFW_TRUE); |
|
|
|
|
int monitorCount; |
|
|
|
|
GLFWmonitor** monitors = glfwGetMonitors(&monitorCount); |
|
|
|
|
GLFWmonitor *monitor = glfwGetPrimaryMonitor(); |
|
|
|
|
for (int i = 1; i < monitorCount; i++){ |
|
|
|
|
int w, h; |
|
|
|
|
glfwGetMonitorPhysicalSize(monitors[i], &w, &h); |
|
|
|
|
if (w > h){ |
|
|
|
|
monitor = monitors[i]; |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
int x, y; |
|
|
|
|
glfwGetMonitorPos(monitor, &x, &y); |
|
|
|
|
window = glfwCreateWindow(800, 600, "Vulkan Simulation", nullptr, nullptr); |
|
|
|
|
glfwSetWindowPos(window, x, y); |
|
|
|
|
glfwSetFramebufferSizeCallback(window, [](GLFWwindow* window, int width, int height) { |
|
|
|
|
instance->windowResized = true; |
|
|
|
|
}); |
|
|
|
|