Hi NighTiger, if you look back at one of my posts, I asked if you where
using a laptop, and now you answered that indirectly so I can make some
Laptops usually support only *ONE* actual video resolution (and lower
with scaling), associated to the video display. So if you are using a
640x480x32bpp surface and you displays resolution is 1024x768, the video
driver will have to convert that from 640x480 to 1024x768 BEFORE showing
it properly on the screen - and we are talking software conversion here.
This must be making your application run slower - it happened on my
iBook, so I know this problem quite well. Running really fast on the
desktop and about 33fps in the notebook.
BTW, have you ever tried your code on a desktop system?
To see if this is happening to you, try making your game screen the
same as the usual display resolution (don’t worry about your code, just
change the screen size), if it runs faster (I don’t expect a lot faster,
as the screen will be quite large now), you may be better off with
OpenGL, which is blazing fast and work really well with systems limited
to a single display resolution. I use it and it has solved my issues.
Besides that, one point that bothers me in your code is that you use
SDL ttf to draw text. If you’re using a hardware surface for the game,
this may be another performance hit. SDL ttf is great for software
surfaces, but blitting the text directly to a hardware surface may
impact performance, so if the previous test doesn’t help, try commenting
the text rendering in your game to see if there’s any change.
Paulo V W Radtke - Chien Loco Jogos de Garagem?
NighTiger escreveu:> I promise that it’s the last e-mail about the fps.
I don’t understand why I have only 32 fps with 3 surface:
1 screen 640x480x32
1 vs 1280x1024x32
1 tiles 320x178x24 (destroyed after the making of map)
all the surface are passed through the SDL_DisplayFormat(), before that
I use this.
I would like do get the tiles from the image in png, grab this and blit
this into the Virtual Screen.
When I get the tiles from the image by the grab funciont I modify all
the tiles by SDL_DisplayFormat();
Under Windows, in my office laptop (P4 2.8Ghz, 512 MB DDR, ATI MOBILITY
RADEON 9000) I have 32 fps.
Can anybody help me? I can send all the project, for me is important to
understand where is the mistake.
SDL mailing list
SDL at libsdl.org