0

I have a 64x64 image and I want to resize it just as I want within my program (make it 32x32 or 86x86 for exemple). How can I do it? I use SDL 1.2 in C.

genpfault
  • 51,148
  • 11
  • 85
  • 139
Maxime Beasse
  • 55
  • 2
  • 12
  • Already answered thousands of times on stackoverflow I bet. You can look at `SDL_gfx` but you should not perform resize operations with SDL, they cost alot CPU. Prefer to use OpenGL, for example SFML is a good alternative to SDL and provides you resize, without having to learn OpenGL. – Pierre Emmanuel Lallemant Feb 19 '18 at 14:35
  • Well, ok. I have to learn SDL for school purposes so I don't want to start OpenGL. But thank you for the answer – Maxime Beasse Feb 19 '18 at 14:37
  • @MaximeBeasse You can resize when rendering with SDL 2.0 – aram Feb 19 '18 at 14:39
  • The problem with resizing with SDL_gfx is that you will have to 1) store the original image 2) create a new SDL_surface in which you will perform the resize from the original. It will never be perfect, and if you don't free the resized surface at each loop, you will go out of memory. – Pierre Emmanuel Lallemant Feb 19 '18 at 14:39
  • Well, as it is to resize sprites from a game to follow the dimensions of the window, it won't matter if I use this method I hope – Maxime Beasse Feb 19 '18 at 14:43

0 Answers0