I am writing a program in SDL
and C
and I want to be able to save the window as an image.
This is my code:
screen = SDL_GetWindowSurface(win);
SDL_SaveBMP(screen,"screen");
But when I execute it I get:
Segmentation Fault
From other sources I gather that its about pointers and memory access. Any help?
Call SDL_LockSurface on a window surface before saving bitmap, and SDL_UnlockSurface after that.