Removed lock/unlock for screenshot
This commit is contained in:
parent
acf517c422
commit
6f406eebfc
|
@ -91,10 +91,8 @@ save_screenshot(void)
|
||||||
int w, h;
|
int w, h;
|
||||||
SDL_GetRendererOutputSize(gRenderer, &w, &h);
|
SDL_GetRendererOutputSize(gRenderer, &w, &h);
|
||||||
SDL_Surface *surface = SDL_CreateRGBSurfaceWithFormat(0, w, h, 32, format);
|
SDL_Surface *surface = SDL_CreateRGBSurfaceWithFormat(0, w, h, 32, format);
|
||||||
SDL_LockSurface(surface);
|
|
||||||
SDL_RenderReadPixels(gRenderer, NULL, format, surface->pixels, surface->pitch);
|
SDL_RenderReadPixels(gRenderer, NULL, format, surface->pixels, surface->pitch);
|
||||||
SDL_SaveBMP(surface, "screenshot.bmp");
|
SDL_SaveBMP(surface, "screenshot.bmp");
|
||||||
SDL_UnlockSurface(surface);
|
|
||||||
SDL_FreeSurface(surface);
|
SDL_FreeSurface(surface);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue