SDL - double-size a surface's pixels?

Hello,

I am looking for a way to double-size (which actually means quadruple-size, I suppose), an image using SDL (SDL_Surface*). I have a surface which starts as 400x300, but I'd like to display it to the screen as 800x600, so that every single pixel now turns into 2x2 pixels.

I'm not trying to do any color averaging or multisampling here - so if pixel[0] was color ff0000, then I'd like all four colors of the 2x2 pixels in the upper left of the scaled up image to be ff0000, so that it creates a low-rez effect. (just like if you are playing a Nintendo emulator and you stretch the window bigger - it doesn't blur the pixels, but creates a pixelated look instead).

How should I do something like this?
closed account (Dy7SLyTq)
i personally use this http://sourceforge.net/projects/sdlresize/files/resize%2B%2B/ (and it works very well). note two things
a)you have to pass it the picture you want to manipulate, but you also have to make the sdl_surface* holding that image.
ie SDL_Surface *whatever = loadimage("image.jpeg");
whatever = SDL_Resize(args, whatever, more_args);

b)make sure to add the .cpp file to your project if your using an ide. (took me a while to figure that one out *facepalm* :})
Topic archived. No new replies allowed.