Advertisement

SDL - Too slow

Started by February 25, 2005 05:43 AM
36 comments, last by 23yrold3yrold 19 years, 11 months ago
Hi guys, I've a problem I working with the SDL under linux and under windows too, and the HWSURFACE are not supported (I've a ATI Radeon Mobility 9000 IGP). So the fps is very slow (24 fps). I've 3 surfaces. Screen -> 640x480x32 Tiles -> 320x128x24 VirtualScreen -> 1280x1024x24 (where I draw my world) All the surface are passed through the SDL_DisplayFormat(tiles); I use SDL_Flip to draw the scene... Where I wrong? Is better use another libraries?
Try it without SDL_DisplayFormat. What are you doing that makes it slow?
Rob Loach [Website] [Projects] [Contact]
Advertisement
Make sure everything is display formatted into 32bpp. Make sure your FPS counter works right.
HxRender | Cornerstone SDL TutorialsCurrently picking on: Hedos, Programmer One
Quote:
Original post by NighTiger
Screen -> 640x480x32
Tiles -> 320x128x24
VirtualScreen -> 1280x1024x24 (where I draw my world)


Wait, are you drawing the entire 1280 x 1024 surface or just a portion of it everytime? So my question is how are you blitting that surface to the screen?
Are you passing everything through SDL_DisplayFormat for *every* frame? That's gonna be *sllooooooowww*. Always make sure that all your surfaces have the exact same format (the format of the video surface). If needed, convert them *once*, in the init part of your program.
Quote:
Original post by Anonymous Poster
If you're already doing this, then never mind.


okkey... never mind because I just doing this :°°°°(
Advertisement
What do you need the virtual screen for anyway?
Quote:
Original post by Kylotan
What do you need the virtual screen for anyway?


I use my VS for make a map with tiles
Why not just blit the relevant tiles directly to the screen?
Quote:
Original post by Kylotan
Why not just blit the relevant tiles directly to the screen?


because the screen is more thin than the vs, and I would like make a function that blit only the portion of vs is visible on the screen.

This topic is closed to new replies.

Advertisement