[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[pygame] display surface question



I'm using Python/pygame to develop an application that will be used in
windowed mode.  I've been monitoring the memory usage of my program. 
(I'm trying to keep the memory footprint as small as reasonably
possible).

When "pygame.display.set_mode(...)" is called, it appears that the
pygame/SDL allocates a display surface which is the size of the entire
window.  I assume that pygame/SDL uses this surface to handle any
VIDEOEXPOSE type events that may appear in the queue (to automagically
redraw those portions of the screen for me).

Many window managers already provide a backing store for the visible
windows (I believe that windows, mac, and x11 already due this when
possible.)  In theory, this should make the surface on the
process/client side redundant.  (After all, most other GUI apps don't
keep a per-pixel buffer of the entire display.)

I realize the keeping a local "backing-store" can be useful for many
game-like apps.  However, I would like to forego this display buffer and
handle VIDEOEXPOSE events directly from my app.  (My application can
redraw the screen piecewise using smaller rectangles.)  Is this
possible?

Dave

-- 
David J. C. Beach
<beach@verinet.com>

Attachment: signature.asc
Description: This is a digitally signed message part