[SDL] Resizing Main SDL_Surface
Christophe Cavalaria
chris.cavalaria at free.fr
Wed Aug 16 14:45:07 PDT 2006
Neil Hodges wrote:
> Hello,
>
> How would I go about resizing the main SDL_Surface?
>
> I've tried the following, but with no success:
> ================
> int ResizeSurface(SDL_Surface * surface, Uint32 flags, Uint32 width,
> Uint32 height, Uint16 depth) { SDL_FreeSurface(surface);
> surface = SDL_SetVideoMode(width, height, depth, flags);
> if(!surface) {
> fprintf(stderr, "Unable to set video: %s\n", SDL_GetError());
> return -1;
> }
> return 0;
> }
> ================
>
> - Neil
As was said not long ago, you MUST NOT FREE the main surface. The one
returned by SDL_SetVideoMode.
Try to quit SDL instead ( completly, use SDL_Quit ).
More information about the SDL
mailing list