Skip to content

Commit

Permalink
Fix TTF output blanked if window is minimized (Windows build)
Browse files Browse the repository at this point in the history
  • Loading branch information
maron2000 committed Sep 13, 2023
1 parent b2f27f2 commit bbefcec
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
10 changes: 3 additions & 7 deletions src/gui/sdlmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3756,13 +3756,9 @@ static void GUI_StartUp() {
else if (output == "ttf")
{
LOG_MSG("SDL(sdlmain.cpp): TTF activated");
#if defined(WIN32) && !defined(C_SDL2)
if(!init_output) OUTPUT_SURFACE_Select(); // Initialize screen by output=surface for Windows for SDL1
#elif C_OPENGL
if(!init_output) OUTPUT_OPENGL_Select(GLBilinear); // Initialize screen before switching to TTF (required for macOS builds)
#else
if(!init_output) OUTPUT_SURFACE_Select();
#endif // C_DIRECT3D || C_OPENGL
#if ((WIN32 && !defined(C_SDL2)) || MACOSX) && C_OPENGL
if(!init_output) OUTPUT_OPENGL_Select(GLBilinear); // Initialize screen before switching to TTF (required for Windows & macOS builds)
#endif
OUTPUT_TTF_Select(0);
init_output = true;
}
Expand Down
5 changes: 4 additions & 1 deletion src/output/output_ttf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1392,7 +1392,10 @@ void ttf_switch_on(bool ss=true) {
#endif
}
bool OpenGL_using(void), gl = OpenGL_using();
change_output(10);
#if defined(WIN32) && !defined(C_SDL2)
change_output(3); // call OUTPUT_OPENGL_Select(GLBilinear) to initialize output before enabling TTF output on Windows builds (does nothing if OpenGL not available)
#endif
change_output(10); // call OUTPUT_TTF_Select()
SetVal("sdl", "output", "ttf");
std::string showdbcsstr = static_cast<Section_prop *>(control->GetSection("dosv"))->Get_string("showdbcsnodosv");
showdbcs = showdbcsstr=="true"||showdbcsstr=="1"||(showdbcsstr=="auto" && (loadlang || dbcs_sbcs));
Expand Down

0 comments on commit bbefcec

Please sign in to comment.