Skip to content

Commit

Permalink
force full screen
Browse files Browse the repository at this point in the history
  • Loading branch information
FayeSpica committed Jun 5, 2024
1 parent a1d96db commit 23f9afe
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions gui2/borealis/library/lib/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,14 +183,20 @@ bool Application::init(std::string title, Style* style, LibraryViewsThemeVariant
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
#endif

Application::window = glfwCreateWindow(WINDOW_WIDTH, WINDOW_HEIGHT, title.c_str(), nullptr, nullptr);
// Switch to fullscreen mode
GLFWmonitor* monitor = glfwGetPrimaryMonitor();
const GLFWvidmode* mode = glfwGetVideoMode(monitor);

Application::window = glfwCreateWindow(mode->width, mode->height, title.c_str(), nullptr, nullptr);
if (!window)
{
Logger::error("glfw: failed to create window");
glfwTerminate();
return false;
}

glfwSetWindowMonitor(window, monitor, 0, 0, mode->width, mode->height, mode->refreshRate);

// Configure window
glfwSetInputMode(window, GLFW_STICKY_KEYS, GLFW_TRUE);
glfwMakeContextCurrent(window);
Expand Down Expand Up @@ -222,7 +228,7 @@ bool Application::init(std::string title, Style* style, LibraryViewsThemeVariant
return false;
}

windowFramebufferSizeCallback(window, WINDOW_WIDTH, WINDOW_HEIGHT);
windowFramebufferSizeCallback(window, mode->width, mode->height);
glfwSetTime(0.0);

// Load fonts
Expand Down

0 comments on commit 23f9afe

Please sign in to comment.