diff options
Diffstat (limited to 'src/graphics.cpp')
-rw-r--r-- | src/graphics.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/graphics.cpp b/src/graphics.cpp index 6f488cc1..02144cab 100644 --- a/src/graphics.cpp +++ b/src/graphics.cpp @@ -319,7 +319,11 @@ SDL_Surface *Graphics::getScreenshot() SDL_Surface *screenshot = SDL_CreateRGBSurface(0, mWidth, mHeight, 24, rmask, gmask, bmask, amask); - SDL_RenderReadPixels(mRenderer, nullptr, SDL_PIXELFORMAT_RGB888, screenshot->pixels, screenshot->pitch); + + SDL_RenderReadPixels(mRenderer, nullptr, + screenshot->format->format, + screenshot->pixels, + screenshot->pitch); return screenshot; } |