From 8cc249c05620f26e2a54b9fb59ba92892f335291 Mon Sep 17 00:00:00 2001 From: VB Date: Sun, 12 Feb 2017 16:50:32 +0100 Subject: [PATCH] multisampling --- EU07.cpp | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/EU07.cpp b/EU07.cpp index c192caf6..d3638c9e 100644 --- a/EU07.cpp +++ b/EU07.cpp @@ -212,28 +212,21 @@ int CALLBACK WinMain(HINSTANCE, HINSTANCE, LPSTR lpCmdLine, int) while (!token.empty()); } - bool fullscreen = Global::bFullScreen; - int width = Global::iWindowWidth; - int height = Global::iWindowHeight; + glfwWindowHint(GL_SAMPLES, Global::iMultisampling); - GLFWwindow *window; - if (fullscreen) - { - // match requested video mode to current to allow for - // fullwindow creation when resolution is the same + // match requested video mode to current to allow for + // fullwindow creation when resolution is the same + GLFWmonitor *monitor = glfwGetPrimaryMonitor(); + const GLFWvidmode *vmode = glfwGetVideoMode(monitor); - GLFWmonitor *monitor = glfwGetPrimaryMonitor(); - const GLFWvidmode *vmode = glfwGetVideoMode(monitor); + glfwWindowHint(GLFW_RED_BITS, vmode->redBits); + glfwWindowHint(GLFW_GREEN_BITS, vmode->greenBits); + glfwWindowHint(GLFW_BLUE_BITS, vmode->blueBits); + glfwWindowHint(GLFW_REFRESH_RATE, vmode->refreshRate); - glfwWindowHint(GLFW_RED_BITS, vmode->redBits); - glfwWindowHint(GLFW_GREEN_BITS, vmode->greenBits); - glfwWindowHint(GLFW_BLUE_BITS, vmode->blueBits); - glfwWindowHint(GLFW_REFRESH_RATE, vmode->refreshRate); - - window = glfwCreateWindow(width, height, "EU07++", monitor, nullptr); - } - else - window = glfwCreateWindow(width, height, "EU07++", nullptr, nullptr); + GLFWwindow *window = + glfwCreateWindow(Global::iWindowWidth, Global::iWindowHeight, + "EU07++", Global::bFullScreen ? monitor : nullptr, nullptr); if (!window) return -1;