SDL slower in fullscreen mode

Hi,

I am experiencing a problem running my 640x480 32bit screen application
(win32). It runs at a reasonable speed in windowed mode but slows down
drastically in fullscren mode. Has anyone experienced the same problem and
perhaps shed some light as to the likely cause? (My desktop is set at
1024x768 32bit)

Thanks,
Colin

Colin,
Are you using SDL_DisplayFormat() to ensure that your surfaces will blit as
fast as possible? Also, check that you really are getting a 32-bit surface,
and that everything is not being converted “on-the-fly”, with every
blit(Though, SDL_DisplayFormat should keep that from happening, regardless
of actual bit-depth.)
Another thing to check is: Are you using SDL_Delay() with values of less
than 10? For some reason, one application I wrote behaved very erratically
and slowly if I used anything less than 10ms as a delay. Some CPU’s don’t
respond well to that I guess. Just an idea.
-Dave> ----- Original Message -----

From: colinvella@waldonet.net.mt (Colin Vella)
To:
Sent: Sunday, January 16, 2005 5:57 AM
Subject: [SDL] SDL slower in fullscreen mode

Hi,

I am experiencing a problem running my 640x480 32bit screen application
(win32). It runs at a reasonable speed in windowed mode but slows down
drastically in fullscren mode. Has anyone experienced the same problem and
perhaps shed some light as to the likely cause? (My desktop is set at
1024x768 32bit)

Thanks,
Colin


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

Dave,

I’m not using SDL_DisplayFormat() because it strips away the alpha channel
from 32-bit images (since the display format is really 24 bit -
format->Amask == 0). I did try it actually and, besides disabling per-pixel
alpha it still ran slowly in fullscreen mode.
I also tried creating a temporary 32-bit hardware surface and use
SDL_ConvertSurface to turn my loaded 24- and 32-bit images to 32-bit
hardware surfaces but I still experienced the same slowdown, which is quite
bad… circa 3 FPS!
I’m not using SDL_Delay by the way.
I have also verified that the fullscreen display surface is 32-bit.

Regards,
Colin

Message: 14Date: Sun, 16 Jan 2005 13:05:38 -0600
From: jolynsbass@hotmail.com (David Olsen)
Subject: Re: [SDL] SDL slower in fullscreen mode
To: “A list for developers using the SDL library.
(includesSDL-announce)”
Message-ID:
Content-Type: text/plain; charset=“iso-8859-1”

Colin,
Are you using SDL_DisplayFormat() to ensure that your surfaces will blit as
fast as possible? Also, check that you really are getting a 32-bit surface,
and that everything is not being converted “on-the-fly”, with every
blit(Though, SDL_DisplayFormat should keep that from happening, regardless
of actual bit-depth.)
Another thing to check is: Are you using SDL_Delay() with values of less
than 10? For some reason, one application I wrote behaved very erratically
and slowly if I used anything less than 10ms as a delay. Some CPU’s don’t
respond well to that I guess. Just an idea.
-Dave

Does SDL_DisplayFormatAlpha() not work for you?

-bill!On Mon, Jan 17, 2005 at 12:06:06AM +0100, Colin Vella wrote:

Dave,

I’m not using SDL_DisplayFormat() because it strips away the alpha channel
from 32-bit images (since the display format is really 24 bit -
format->Amask == 0). I did try it actually and, besides disabling per-pixel
alpha it still ran slowly in fullscreen mode.

another posibility is that your driver uses hardware surface in fullscreen mode.
Alpha blits are slow on hardware surfaces without hwaccel(which practically no drivers have).
in such a case you can use a secondary sw surface and blit to that,
and then blit the changed parts or the whole thing to the real screen.
you may also consider converting the project to opengl or using glSDL.

-LIM-