|
|
@ -83,7 +83,6 @@ void TargetWindow::setClickThrough(bool click_through)
|
|
|
|
void TargetWindow::update()
|
|
|
|
void TargetWindow::update()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
sf::Event event{};
|
|
|
|
sf::Event event{};
|
|
|
|
|
|
|
|
|
|
|
|
while (window_.pollEvent(event)) {
|
|
|
|
while (window_.pollEvent(event)) {
|
|
|
|
Overlay::ProcessEvent(event);
|
|
|
|
Overlay::ProcessEvent(event);
|
|
|
|
if (event.type == sf::Event::Closed) {
|
|
|
|
if (event.type == sf::Event::Closed) {
|
|
|
@ -99,6 +98,16 @@ void TargetWindow::update()
|
|
|
|
if (toggle_window_mode_after_frame_) {
|
|
|
|
if (toggle_window_mode_after_frame_) {
|
|
|
|
createWindow(!windowed_);
|
|
|
|
createWindow(!windowed_);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// As SFML screws us out of most windows-events, just poll resolution every once in a while
|
|
|
|
|
|
|
|
// If changed, recreate window.
|
|
|
|
|
|
|
|
// Fixes Blackscreen issues when user does funky stuff and still uses GlosSI in non windowed mod...
|
|
|
|
|
|
|
|
// (WHY?!)
|
|
|
|
|
|
|
|
if (check_resolution_clock_.getElapsedTime().asSeconds() > RES_CHECK_SECONDS) {
|
|
|
|
|
|
|
|
if (sf::VideoMode::getDesktopMode().width != old_desktop_mode_.width) {
|
|
|
|
|
|
|
|
createWindow(windowed_);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
check_resolution_clock_.restart();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void TargetWindow::close()
|
|
|
|
void TargetWindow::close()
|
|
|
@ -228,6 +237,7 @@ void TargetWindow::createWindow(bool window_mode)
|
|
|
|
toggle_window_mode_after_frame_ = false;
|
|
|
|
toggle_window_mode_after_frame_ = false;
|
|
|
|
|
|
|
|
|
|
|
|
auto desktop_mode = sf::VideoMode::getDesktopMode();
|
|
|
|
auto desktop_mode = sf::VideoMode::getDesktopMode();
|
|
|
|
|
|
|
|
old_desktop_mode_ = desktop_mode;
|
|
|
|
if (window_mode) {
|
|
|
|
if (window_mode) {
|
|
|
|
window_.create(sf::VideoMode(desktop_mode.width * 0.75, desktop_mode.height * 0.75, 32), "GlosSITarget");
|
|
|
|
window_.create(sf::VideoMode(desktop_mode.width * 0.75, desktop_mode.height * 0.75, 32), "GlosSITarget");
|
|
|
|
windowed_ = true;
|
|
|
|
windowed_ = true;
|
|
|
|