Frame rate

Hi guys,
I want retry to write a question.
I don’t understand because the frame rate is very low with just 2 surface.
tnx

Well… What’s a “very low” frame rate? What kind of screen/window
resolution and depth are you using? How large are those two surfaces?
What pixel format do they have? Alpha blending? Did you
SDL_DisplayFormat*() the surfaces? How do you refresh the display?
(Flip or UpdateRects.) And of course, what OS are you on, and what
kind of hardware?

//David Olofson - Programmer, Composer, Open Source Advocate

.- Audiality -----------------------------------------------.
| Free/Open Source audio engine for games and multimedia. |
| MIDI, modular synthesis, real time effects, scripting,… |
`-----------------------------------> http://audiality.org -’
http://olofson.nethttp://www.reologica.se —On Tuesday 22 February 2005 16.36, NighTiger wrote:

Hi guys,
I want retry to write a question.
I don’t understand because the frame rate is very low with just 2
surface.

Hi there.

There is a lot of possible reasons.
(just some of them):
The drivers you are using.
The compatibility between your driver and the OS you
are running.
What you are trying to do ‘behind the scenes’ (what
you do between one frame and the next one).
What kind of video card you are using.
What kind of video features you are using (i.e.: try
to use some OpenGL opperations that requires real
video card support on a non-accellerated video card.
The size of your screen.
The amount of memory avaliable to the app.

There are a lot of possible others, and, since I did
not looked your code, it is even hard to think about
it.

Hope I helped,

In?cio.

— NighTiger escreveu:> Hi guys,

I want retry to write a question.
I don’t understand because the frame rate is very
low with just 2 surface.
tnx


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


Yahoo! Acesso Gr?tis - Instale o discador do Yahoo! agora. http://br.acesso.yahoo.com/ - Internet r?pida e gr?tis

J Inacio wrote:

Hi there.

There is a lot of possible reasons.
(just some of them):
The drivers you are using.
The compatibility between your driver and the OS you
are running.
What you are trying to do ‘behind the scenes’ (what
you do between one frame and the next one).
What kind of video card you are using.
What kind of video features you are using (i.e.: try
to use some OpenGL opperations that requires real
video card support on a non-accellerated video card.
The size of your screen.
The amount of memory avaliable to the app.

There are a lot of possible others, and, since I did
not looked your code, it is even hard to think about
it.

Hope I helped,

In?cio.

someone should add these sort of questions to the doc wiki…in a faq section
this is one of those that is a faq.

-LIM-

Well… What’s a “very low” frame rate?
What kind of screen/window resolution and depth are you using?
How large are those two surfaces?
What pixel format do they have? Alpha blending?
Did you SDL_DisplayFormat*() the surfaces?
How do you refresh the display?
(Flip or UpdateRects.) And of course, what OS are you on, and what
kind of hardware?

Mmm excuse me buy, you know, I don’t speak a good english so I write you
the link for the source of this my old example
http://www.gameprog.it/pub/sdl/pong.zip

Anyway I answer at your questions about my new project:

22 fps

screen -> 640x480x32
the first one is the screen (640x480x32) and the second, virtual screen,
is 1280x1024x32

for the virtual screen the pixel format is the same of the tiles image,
I don’t use alpha blending

no

with the flip

GNU/Linux or Windows (in GNU/Linux is worse than Windows does)
CPU: 2.8Ghz P4, ATI Mobility Radeon 9000 IGP 32 Mb, 512MB DDR

tnx you guys for your help!
bye> From: David Olofson

screen -> 640x480x32
the first one is the screen (640x480x32) and the second, virtual screen,
is 1280x1024x32

GNU/Linux or Windows (in GNU/Linux is worse than Windows does)
CPU: 2.8Ghz P4, ATI Mobility Radeon 9000 IGP 32 Mb, 512MB DDR

Are you by chance using a laptop computer? (your video card hints me that) Usually laptop computers works with fixed resolution, which causes the driver to resize the image to show it correctly - usually you notice that as the image not being as sharp as if it was rendered in the usual desktop resolution. This may be one source of problem, as the resizing requires some time to process and may reduce you frame rate.

I use an G3 iBook with a Radeon 7500 Mobility, with resolution fixed at 1024x768. My game was running at about 30fps when using SDL surfaces thanks to the image resizing done by the system. Changing my renderer to OpenGL made all the difference in the world, as the game can run as fast as 300fps on the same machine if I don’t keep track of the vertical retrace (sad that it’s a TFT screen, which sucks for 2D scrolling games).

There are other issues that other people already discussed, but this one is something nobody mentioned so far, so it’s worth a look :).

Best regards,

Paulo

Hi,

NighTiger schrieb:

I don’t understand because the frame rate is very low with just 2 surface.

  • If you’re using alpha blending, make sure that your display surface is
    software. Alternatively use a software buffer surface.

  • After loading images, always use SDL_DisplayFormatAlpha() on the surfaces.

  • Also call SDL_SetAlpha() on the surfaces with the SDL_RLEACCEL flag.

HTH,
Sebastian