Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- switch (event.type)
- {
- case SDL_KEYDOWN:
- if (event.key.keysym.scancode == SDL_SCANCODE_S)
- {
- SDL_Surface* screenShot = SDL_CreateRGBSurface(0, 800, 600, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000);
- if (screenShot)
- {
- SDL_RenderReadPixels(renderer, NULL, SDL_GetWindowPixelFormat(window), screenShot->pixels, screenShot->pitch);
- SDL_SaveBMP(screenShot, "map.bmp");
- SDL_FreeSurface(screenShot);
- }
- }
- case SDL_QUIT:
- break;
- default:
- break;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement