mirror of
https://git.sr.ht/~rabbits/uxn
synced 2024-11-05 22:05:04 +00:00
Fixed order of unlock/save
This commit is contained in:
parent
52e0f9b29e
commit
acf517c422
1 changed files with 1 additions and 1 deletions
|
@ -93,8 +93,8 @@ save_screenshot(void)
|
||||||
SDL_Surface *surface = SDL_CreateRGBSurfaceWithFormat(0, w, h, 32, format);
|
SDL_Surface *surface = SDL_CreateRGBSurfaceWithFormat(0, w, h, 32, format);
|
||||||
SDL_LockSurface(surface);
|
SDL_LockSurface(surface);
|
||||||
SDL_RenderReadPixels(gRenderer, NULL, format, surface->pixels, surface->pitch);
|
SDL_RenderReadPixels(gRenderer, NULL, format, surface->pixels, surface->pitch);
|
||||||
SDL_UnlockSurface(surface);
|
|
||||||
SDL_SaveBMP(surface, "screenshot.bmp");
|
SDL_SaveBMP(surface, "screenshot.bmp");
|
||||||
|
SDL_UnlockSurface(surface);
|
||||||
SDL_FreeSurface(surface);
|
SDL_FreeSurface(surface);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue