From d2b9d16f4660c21e81269f6b13ecf426b541d825 Mon Sep 17 00:00:00 2001 From: Dimitris Panokostas Date: Sat, 28 Jan 2017 01:01:51 +0100 Subject: [PATCH] Fixed #45 Fixed incorrect texture update that caused a black screen in some GUI options --- src/osdep/gui/SelectFile.cpp | 14 ++++++-------- src/osdep/gui/SelectFolder.cpp | 16 +++++++--------- src/osdep/gui/ShowMessage.cpp | 4 ++-- 3 files changed, 15 insertions(+), 19 deletions(-) diff --git a/src/osdep/gui/SelectFile.cpp b/src/osdep/gui/SelectFile.cpp index 05ca03eb..b19453e2 100644 --- a/src/osdep/gui/SelectFile.cpp +++ b/src/osdep/gui/SelectFile.cpp @@ -339,24 +339,22 @@ static void SelectFileLoop(void) } } - //------------------------------------------------- - // Send event to guisan-controls - //------------------------------------------------- + //------------------------------------------------- + // Send event to guisan-controls + //------------------------------------------------- gui_input->pushInput(event); } - // Now we let the Gui object perform its logic. + // Now we let the Gui object perform its logic. uae_gui->logic(); // Now we let the Gui object draw itself. uae_gui->draw(); // Finally we update the screen. -// wait_for_vsync(); -// SDL_Flip(gui_screen); // Update the texture from the surface - SDL_UpdateTexture(texture, NULL, gui_screen->pixels, gui_screen->pitch); + SDL_UpdateTexture(gui_texture, NULL, gui_screen->pixels, gui_screen->pitch); // Copy the texture on the renderer - SDL_RenderCopy(renderer, texture, NULL, NULL); + SDL_RenderCopy(renderer, gui_texture, NULL, NULL); // Update the window surface (show the renderer) SDL_RenderPresent(renderer); diff --git a/src/osdep/gui/SelectFolder.cpp b/src/osdep/gui/SelectFolder.cpp index a628937a..5d89a839 100644 --- a/src/osdep/gui/SelectFolder.cpp +++ b/src/osdep/gui/SelectFolder.cpp @@ -241,24 +241,22 @@ static void SelectFolderLoop(void) } } - //------------------------------------------------- - // Send event to guisan-controls - //------------------------------------------------- + //------------------------------------------------- + // Send event to guisan-controls + //------------------------------------------------- gui_input->pushInput(event); } - // Now we let the Gui object perform its logic. + // Now we let the Gui object perform its logic. uae_gui->logic(); // Now we let the Gui object draw itself. uae_gui->draw(); // Finally we update the screen. -// wait_for_vsync(); -// SDL_Flip(gui_screen); - +// // Update the texture from the surface - SDL_UpdateTexture(texture, NULL, gui_screen->pixels, gui_screen->pitch); + SDL_UpdateTexture(gui_texture, NULL, gui_screen->pixels, gui_screen->pitch); // Copy the texture on the renderer - SDL_RenderCopy(renderer, texture, NULL, NULL); + SDL_RenderCopy(renderer, gui_texture, NULL, NULL); // Update the window surface (show the renderer) SDL_RenderPresent(renderer); } diff --git a/src/osdep/gui/ShowMessage.cpp b/src/osdep/gui/ShowMessage.cpp index 0b1cf157..f24f3d7d 100644 --- a/src/osdep/gui/ShowMessage.cpp +++ b/src/osdep/gui/ShowMessage.cpp @@ -145,9 +145,9 @@ static void ShowMessageLoop(void) // Finally we update the screen. // Update the texture from the surface - SDL_UpdateTexture(texture, NULL, gui_screen->pixels, gui_screen->pitch); + SDL_UpdateTexture(gui_texture, NULL, gui_screen->pixels, gui_screen->pitch); // Copy the texture on the renderer - SDL_RenderCopy(renderer, texture, NULL, NULL); + SDL_RenderCopy(renderer, gui_texture, NULL, NULL); // Update the window surface (show the renderer) SDL_RenderPresent(renderer); }