diff --git a/src/pcedit/pc.main.cpp b/src/pcedit/pc.main.cpp index 9f905016..31c387b0 100644 --- a/src/pcedit/pc.main.cpp +++ b/src/pcedit/pc.main.cpp @@ -143,7 +143,8 @@ void init_main_window (sf::RenderWindow& mainPtr, sf::View& mainView) { ; mainPtr.create(sf::VideoMode(width, height), "Blades of Exile Character Editor", sf::Style::Titlebar | sf::Style::Close); - mainPtr.setPosition({0,0}); + sf::VideoMode desktop = sf::VideoMode::getDesktopMode(); + mainPtr.setPosition({static_cast((desktop.width - width) / 2), static_cast((desktop.height - height) / 2)}); // Initialize the view mainView.setSize(width, height); diff --git a/src/scenedit/scen.main.cpp b/src/scenedit/scen.main.cpp index da42555c..87119b39 100644 --- a/src/scenedit/scen.main.cpp +++ b/src/scenedit/scen.main.cpp @@ -163,7 +163,8 @@ void init_main_window (sf::RenderWindow & mainPtr, sf::View & mainView) { ; mainPtr.create(sf::VideoMode(width, height), "Blades of Exile Scenario Editor", sf::Style::Titlebar | sf::Style::Close); - mainPtr.setPosition({0,0}); + sf::VideoMode desktop = sf::VideoMode::getDesktopMode(); + mainPtr.setPosition({static_cast((desktop.width - width) / 2), static_cast((desktop.height - height) / 2)}); // Initialize the view mainView.setSize(width, height);