[SDL] Performance issues
e_byard at yahoo.co.uk
Tue Aug 8 01:32:02 PDT 2006
Kuisma, this isn't an embedded system, it's just a standard 1.5Ghz PC running Win2k.
>Now even more proper question is that is your installation SDL is
>relying on? One big bad thing can be improper backend for SDL when you
>have really things supported in hardware (for example for win32 you
>would use win32 graphics backend instead of dx).
Hmm - well I'm just using whatever is native to my SDL installation & system -
I'd prefer to keep DirectX or OpenGL out of the equation and just use whatever is
on the system..if you understand me. I'd like this game to just port to any PC running
Kuisma Salonen <kuisma.salonen at nokia.com> wrote: -----BEGIN PGP SIGNED MESSAGE-----
Edward Byard wrote:
> Hi Folks,
> I'm pretty new to video programming, but have many years of experience on embedded systems (mechanical control systems mostly).
> Anyway, I'm writing a slot machine simulator, and am having problems getting performance out of the system. Basically, I'm using SDL_ BlitSurface to blit a portion of an image to a rectangle, and it's pretty slow (800x600,16bpp,double-buffered).
Few relevant questions. Is this on an embedded system? How does you
hardware work (everything fits into video memory/screen control
blackbox/something else)? Are you sure this is really double-buffered
(in hardware, having flipping instead of copying)?
Now even more proper question is that is your installation SDL is
relying on? One big bad thing can be improper backend for SDL when you
have really things supported in hardware (for example for win32 you
would use win32 graphics backend instead of dx).
> Now, am I missing something? I have a background image, which I then place the aforementioned rectangle on. I don't re-draw the background at all - just update the rectangle. Is this making any sense?
Yes, this makes a sense. But in this case you should prefer always
SDL_UpdateRects() instead of SDL_Flip() (i assume you are using those
instead, right?) and single-buffer surface as you would still (most
probably, someone correct me if i am wrong?) need to call these
functions. Again, this depends on your installation.
And quotating another mail:
Paulo Pinto wrote:
> By that I mean, are you converting your surfaces
> before displaying them?
This conversion is relevant as it won't need to do
conversion-on-blitting. Also I would recommend to use bitdepth 0 when
creating the primary surface (SDL_SetVideoMode()) which will stick to
system default, on some systems it has to emulate that certain bitdepth
and that won't do any good for performance when calling SDL_Flip() or
Hope I could help you at least a bit...
- -- Kuisma
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.4 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----
SDL mailing list
SDL at libsdl.org
Copy addresses and emails from any email account to Yahoo! Mail - quick, easy and free. Do it now...
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SDL