How to resize/scale surface in SDL?

I want to change scale of my surface, because it's too big and I don't want to redraw everything.
Here's the code to create image in SDL

1
2
3
4
5
6
7
8
    SDL_Rect grassCord;
    grass =  SDL_LoadBMP("grass.bmp");
    grassCord.x = 0;
    grassCord.y = 220;
    grassCord.h = SCREEN_HEIGHT;
    grassCord.w = SCREEN_WIDTH;
    SDL_BlitSurface (grass, NULL, screen, &grassCord);
    SDL_FreeSurface(grass);


anyone could give quick example how to do it, or give link to a site explaining it? Thank you :D

-----------------------------
I am using DEV C++
and Windows Vista
Last edited on
SDL is not designed to do image manipulation - only display. This is typical of the way old parallax video games work.

You can check out the SDL_gfx library http://www.ferzkopp.net/Software/SDL_gfx-2.0/

You can also do it yourself...

Hope this helps.
Topic archived. No new replies allowed.