It’s not really clear if you’re using all of this correctly without any code
context. In what context does one use ‘dim_screen’? How frequently are you
calling this?
Are you sure that it’s the call to SDL_UpdateRect that is slow? I would be
very surprised to see it take more than 10ms on a reasonably-sized display
surface, even on an embedded device. Where else are you calling
SDL_UpdateRect or SDL_Flip?
‘screen’ must be your display surface. I’ve never messed with the
per-surface alpha of the display surface. Does that work? I usually blit a
black surface on the screen and modify the alpha of that surface.
Jonny DOn Fri, Mar 12, 2010 at 1:29 PM, Dan wrote:
Hi,
I’m using the following code to dim the screen (i.e. to disable focus on
the
background for a popup menu) on an embeded linux device.
However, it takes almost a complete second for UpdateRect to complete. Can
anyone comment on improving the performance of this code?