[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] Hardware acceleration
Hi,
Running fullscreen has found a HW surface, but my frame rate is dead! I 
am not doing any reads from the hardware... so why so slow?
Casey Duncan wrote:
Please post the code you are using to init the display surface. 
       #Hardware
       flags =  pygame.FULLSCREEN | pygame.DOUBLEBUF | pygame.HWSURFACE
       #Software
       #flags =  pygame.NOFRAME
       self.screen = pygame.display.set_mode((self.width, self.height), 
flags)
       print pygame.display.get_driver()
       print pygame.display.get_surface()
You may not in fact be getting a hardware surface, try printing the 
surface object to see what type it actually is. 
On Ubuntu Linux:
x11
<Surface(1024x768x32 SW)>
FPS: 75
On WinXP with HW flags:
directx
<Surface(1024x768x32 HW)>
FPS: 4!!!!!
On WinXP with SW flags:
directx
<Surface(1024x768x32 SW)>
FPS: 75
Also, are you sure drawing is the thing making the framerate too slow? 
Also, what are you drawing that is slow?
I am not drawing much. A fullscreen surface to clear the display, then  
several sprites with per-pixel alpha (perhaps 30% of screen area). I've 
posted it here:
http://img246.imageshack.us/my.php?image=inflation20080226pc7.jpg
Without the per pixel alpha it looks like some sort of 8bit retro game! 
No can do!
Do I need to tell pygame to load the images into video memory? My theory 
is I have a HW surface to which I am copying images each frame from 
system memory.....