Browse Source
* Get a fresh window surface before rendering to it It is possible that a window surface gets invalidated since we initially obtained it. We need to call GetWindowSurface every time we want one, instead of keeping a pointer to a possibly stale one. See https://hg.libsdl.org/SDL/file/369b01006eb2/src/video/SDL_video.c#l2312 Fixes #351pull/362/head
5 changed files with 34 additions and 14 deletions
@ -0,0 +1,17 @@ |
|||||||
|
#include "miniwin/ddraw.h" |
||||||
|
|
||||||
|
namespace dvl { |
||||||
|
|
||||||
|
extern SDL_Surface *renderer_texture_surface; // defined in dx.cpp
|
||||||
|
|
||||||
|
SDL_Surface *GetOutputSurface() { |
||||||
|
#ifdef USE_SDL1 |
||||||
|
return SDL_GetVideoSurface(); |
||||||
|
#else |
||||||
|
if (renderer) |
||||||
|
return renderer_texture_surface; |
||||||
|
return SDL_GetWindowSurface(window); |
||||||
|
#endif |
||||||
|
} |
||||||
|
|
||||||
|
} // namespace dvl
|
||||||
Loading…
Reference in new issue