FinalProject/Myst/myst.cpp
//Method which assigns the resolution of the window instance based on whether a flag is set to windowed mode or (fake) fullscreen
Method which assigns the resolution of the window instance based on whether a flag is set to windowed mode or (fake) fullscreen
Method which assigns the resolution of the window instance based on whether a flag is set to windowed mode or ( fake ) fullscreen
void SetResolution() {
    const GLFWvidmode* videoMode = glfwGetVideoMode(glfwGetPrimaryMonitor());
    if (isFullscreen) {
        WINDOW_WIDTH = videoMode->width;
        WINDOW_HEIGHT = videoMode->height;
        glfwSetWindowMonitor(gWindow, nullptr, 0, 0, WINDOW_WIDTH, WINDOW_HEIGHT, GLFW_DONT_CARE);
        glfwWindowHint(GLFW_DECORATED, false);
    }
    else
    {
        WINDOW_WIDTH = 1280;
        WINDOW_HEIGHT = 720;
        int centerX = (videoMode->width / 2) - (WINDOW_WIDTH / 2);
        int centerY = (videoMode->height / 2) - (WINDOW_HEIGHT / 2);
        glfwSetWindowMonitor(gWindow, nullptr, centerX, centerY, WINDOW_WIDTH, WINDOW_HEIGHT, GLFW_DONT_CARE);
        glfwWindowHint(GLFW_DECORATED, true);
    }
    glfwSetWindowSize(gWindow, WINDOW_WIDTH, WINDOW_HEIGHT);
}
void SetResolution ( ) { const GLFWvidmode * videoMode = glfwGetVideoMode ( glfwGetPrimaryMonitor ( ) ) ; if ( isFullscreen ) { WINDOW_WIDTH = videoMode -> width ; WINDOW_HEIGHT = videoMode -> height ; glfwSetWindowMonitor ( gWindow , nullptr , 0 , 0 , WINDOW_WIDTH , WINDOW_HEIGHT , GLFW_DONT_CARE ) ; glfwWindowHint ( GLFW_DECORATED , false ) ; } else { WINDOW_WIDTH = 1280 ; WINDOW_HEIGHT = 720 ; int centerX = ( videoMode -> width / 2 ) - ( WINDOW_WIDTH / 2 ) ; int centerY = ( videoMode -> height / 2 ) - ( WINDOW_HEIGHT / 2 ) ; glfwSetWindowMonitor ( gWindow , nullptr , centerX , centerY , WINDOW_WIDTH , WINDOW_HEIGHT , GLFW_DONT_CARE ) ; glfwWindowHint ( GLFW_DECORATED , true ) ; } glfwSetWindowSize ( gWindow , WINDOW_WIDTH , WINDOW_HEIGHT ) ; }
Method which assigns the resolution of the window instance based on whether a flag is set to windowed mode or (fake) fullscreen
Method which assigns the resolution of the window instance based on whether a flag is set to windowed mode or ( fake ) fullscreen