@@ -94,6 +94,12 @@ void SetShowCursor(int show)
94
94
SDL_GetRelativeMouseState (NULL , NULL );
95
95
}
96
96
97
+ static int (* StretchFunc )(SDL_Surface * src , const SDL_Rect * srcrect , SDL_Surface * dst , SDL_Rect * dstrect ) = SDL_BlitScaled ;
98
+ static inline int SDL_SoftStretchWrapper (SDL_Surface * src , const SDL_Rect * srcrect , SDL_Surface * dst , SDL_Rect * dstrect )
99
+ {
100
+ return SDL_SoftStretch (src , srcrect , dst , dstrect );
101
+ }
102
+
97
103
void GraphicsMode ( void )
98
104
{
99
105
uint32_t flags = SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI ;
@@ -140,6 +146,18 @@ void GraphicsMode ( void )
140
146
iGLOBAL_SCREENWIDTH , iGLOBAL_SCREENHEIGHT );
141
147
142
148
SetShowCursor (!sdl_fullscreen );
149
+
150
+ const char * driver = SDL_GetCurrentVideoDriver ();
151
+ #ifndef _WIN32
152
+ if (driver && strcmp (driver , "x11" ) == 0 )
153
+ {
154
+ StretchFunc = SDL_SoftStretchWrapper ;
155
+ }
156
+ else
157
+ #endif
158
+ {
159
+ StretchFunc = SDL_BlitScaled ;
160
+ }
143
161
}
144
162
145
163
void ToggleFullScreen (void )
@@ -421,7 +439,7 @@ static void StretchMemPicture ()
421
439
dest .y = 0 ;
422
440
dest .w = iGLOBAL_SCREENWIDTH ;
423
441
dest .h = iGLOBAL_SCREENHEIGHT ;
424
- SDL_SoftStretch (unstretch_sdl_surface , & src , sdl_surface , & dest );
442
+ StretchFunc (unstretch_sdl_surface , & src , sdl_surface , & dest );
425
443
}
426
444
427
445
// bna function added start
0 commit comments