SDL stretching a surface to the screen

Started by
2 comments, last by Kylotan 13 years, 9 months ago
I think I'm too dumb to develop games =(. Let me explain how I reached this conclusion.

I'm trying to develop a game to be displayed on a projector (heck it's hardly a game. just a few animations and sounds).
I wanted to use xnabut I had to refrain because XNA requires directx 9 with shaders x.x which the laptop I'm going to use to project may not support. Mh...
So I decided to use SDL instead.

I learned that applications for projectors should support several resolutions (http://www.gamedev.net/community/forums/topic.asp?topic_id=577808). I looked around and learned that a good way to support multi-resolution is to write everything to a fixed-sized offscreen surface first and later stretching it to the screen by blitting it (http://www.gamedev.net/reference/snippets/features/dx3d2dIndieRes/).
I thought I could just use SDL_BlitSurface but I misread the documentation. SDL_BlitSurface won't do any scaling. Mhh...
I learned about http://sdl-stretch.sourceforge.net/ but I couldn't get it to run on my machine. Mhhh...

I learned about SDL_gfx. It has a stretching blit operation : SDL_gfxBlitRGBA but when I replace BlitSurface with it, it gives my a blank screen. I tried the zoomSurface function which does work but it is too slow to call on each frame : I must be at around one or two fps. Mhhh...

So my conclusion is : I can't even get an application to display something in multiple resolutions. I must be too dense to write games.
I'm stumped. What I am doing wrong?
Advertisement
Are you calling the stretching functions each frame or are you creating new SDL_Surfaces for each of the stretched images and then using those each frame (I imagine it would cause a pretty severe slow-down to have to stretch everything each frame - although I could be wrong.)
I'm not stretching everything. I blit everything on an offscreen buffer and then I only perform one scaling : when I put the buffer on the screen.
Show the relevant code.

This topic is closed to new replies.

Advertisement