| View previous topic :: View next topic |
| Author |
Message |
framerate
Joined: 14 Aug 2005 Posts: 20
|
Posted: Tue Aug 22, 2006 11:03 pm Post subject: SDL Initialization / Issues |
|
|
So I wrote my recent RPG engine on my Macbook pro using SDL (for faster compilation and testing) and began running it on the PSP last week. I'm noticing some definitely issues and lag when running on the handheld.
- The first issue was my fading screen code was "flickering" when using double buffering. Now, I'm sure this is something I can figure out... but is there an issue with SDL_DOUBLEBUF that I need to be aware of?
- The main issues is the lagging. I'm rather new to the PSP scene, and my graphics are NOT optimized in any way shape or form (they're rather big). Could it be possible that the graphics are taking up too much memory causing the game to lag a bit? Or would this be based entirely on the CPU?
- My currently released demo uses the following initialization:
| Code: |
screen = SDL_SetVideoMode(480, 272, 32,SDL_SWSURFACE|SDL_NOFRAME);
SDL_ShowCursor(SDL_DISABLE);
|
Notice the lack of doublebuf since I didn't notice any improvement with it enabled... I may be naive here so I was hoping I could get some suggestions on the best way to initialize SDL for the PSP? (hardware vs software.. does doublebuf make a big difference? I read up on how SDL handles it if doublebuf is NOT present and it seems very similar...)
Thanks in advance for the help guys! |
|
| Back to top |
|
 |
danzel
Joined: 04 Nov 2005 Posts: 182
|
Posted: Wed Aug 23, 2006 6:44 am Post subject: |
|
|
Go to 16 bit color to get a big speed increase:
screen = SDL_SetVideoMode(480, 272, 16,SDL_SWSURFACE|SDL_NOFRAME); |
|
| Back to top |
|
 |
framerate
Joined: 14 Aug 2005 Posts: 20
|
Posted: Wed Aug 23, 2006 6:54 am Post subject: |
|
|
| danzel wrote: | Go to 16 bit color to get a big speed increase:
screen = SDL_SetVideoMode(480, 272, 16,SDL_SWSURFACE|SDL_NOFRAME); |
It really makes that big of a difference, eh?. Also, you're recommending SWSURFACE over HWSURFACE and don't think DOUBLEBUF makes that big of a diff? Or just correcting my code? :) |
|
| Back to top |
|
 |
danzel
Joined: 04 Nov 2005 Posts: 182
|
Posted: Wed Aug 23, 2006 11:43 am Post subject: |
|
|
Not really sure on what flags to pass through, In AFKIM I'm passing 0.
Based on the readme I don't think passing SDL_HWSURFACE will do anything
| Quote: | Video - yes, single 32-bit ABGR framebuffer surface only; SDL will
emulate other formats as necessary. No HW accel. No 3D. |
|
|
| Back to top |
|
 |
ufoz
Joined: 10 Nov 2005 Posts: 86 Location: Tokyo
|
Posted: Wed Aug 23, 2006 11:50 am Post subject: |
|
|
| danzel wrote: | Not really sure on what flags to pass through, In AFKIM I'm passing 0.
Based on the readme I don't think passing SDL_HWSURFACE will do anything
| Quote: | Video - yes, single 32-bit ABGR framebuffer surface only; SDL will
emulate other formats as necessary. No HW accel. No 3D. |
|
Looking at the sdl-psp source, it makes all the difference. HW_SURFACE data goes in video memory and uses the GU for blits, and I remember it being a huge speedup when I finally remembered setting it back when I tried SDL.
(then I abandoned SDL because the input lagged horribly, not sure why that was happening) |
|
| Back to top |
|
 |
framerate
Joined: 14 Aug 2005 Posts: 20
|
Posted: Wed Aug 23, 2006 12:54 pm Post subject: |
|
|
| ufoz wrote: | | danzel wrote: | Not really sure on what flags to pass through, In AFKIM I'm passing 0.
Based on the readme I don't think passing SDL_HWSURFACE will do anything
| Quote: | Video - yes, single 32-bit ABGR framebuffer surface only; SDL will
emulate other formats as necessary. No HW accel. No 3D. |
|
Looking at the sdl-psp source, it makes all the difference. HW_SURFACE data goes in video memory and uses the GU for blits, and I remember it being a huge speedup when I finally remembered setting it back when I tried SDL.
(then I abandoned SDL because the input lagged horribly, not sure why that was happening) |
Interesting...
I'm gonna try a build tomorrow with SDL_HWSURFACE and 16 bit textures.. see how drastic the framerate increase is.
Any experiences enable/disable SDL_DOUBLEBUF ? |
|
| Back to top |
|
 |
|