Skip to content

Commit

Permalink
Update initial window width and center on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
dvsku committed Jan 29, 2024
1 parent 28cc9d7 commit 5644279
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/devue_app/src/devue_app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ using namespace devue::core;
INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR lpCmdLine, INT nCmdShow) {
dv_util_log::add_source(&std::cout);

dv_gui gui(1024, 768, "devue");
dv_gui gui(1360, 768, "devue");
gui.run();
}
3 changes: 3 additions & 0 deletions src/devue_core/src/graphics/dv_opengl_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ dv_opengl_window::dv_opengl_window(uint32_t width, uint32_t height, const std::s
glfwSetWindowIconifyCallback(m_native, iconify_callback);
glfwSetDropCallback(m_native, drop_callback);

glfwSetWindowMonitor(m_native, NULL, (GetSystemMetrics(SM_CXSCREEN) / 2) - (width / 2),
(GetSystemMetrics(SM_CYSCREEN) / 2) - (height / 2), width, height, GLFW_DONT_CARE);

// Init glad
if (!gladLoadGLLoader((GLADloadproc)glfwGetProcAddress))
throw std::runtime_error("Failed to init glad.");
Expand Down

0 comments on commit 5644279

Please sign in to comment.