Fix bad application quitting with multiple windows

This commit is contained in:
Lorenzooone
2024-04-26 00:15:50 +02:00
parent 1938d01e91
commit cea5a4e40b
3 changed files with 17 additions and 3 deletions

View File

@@ -290,6 +290,8 @@ void WindowScreen::poll() {
break;
}
break;
default:
break;
}
}
@@ -324,8 +326,8 @@ void WindowScreen::display_thread(CaptureData* capture_data) {
this->display_call(false);
}
}
if(this->m_win.isOpen())
this->m_win.close();
if(!this->main_thread_owns_window)
this->m_win.setActive(false);
this->done_display = true;
}
@@ -335,6 +337,13 @@ void WindowScreen::end() {
this->display_lock.unlock();
}
void WindowScreen::after_thread_join() {
if(this->m_win.isOpen()) {
this->m_win.setActive(true);
this->m_win.close();
}
}
void WindowScreen::draw(double frame_time, VideoOutputData* out_buf) {
if(!this->done_display)
return;
@@ -537,7 +546,7 @@ void WindowScreen::window_factory(bool is_main_thread) {
}
void WindowScreen::pre_texture_conversion_processing() {
//Place preprocessing effects here
//Place preprocessing window-specific effects here
this->in_tex.update((uint8_t*)this->saved_buf, IN_VIDEO_WIDTH, IN_VIDEO_HEIGHT, 0, 0);
}