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

Re: [pygame] refresh problem



pistacchio wrote:
hi to all!
this is my first post in pygame (windows xp, python 2.5). i've started using pygame some days ago and after a bit of coding i'm completely stuck. the problem is that even the simpliest code like

import pygame
from pygame.locals import *
pygame.init()
screen = pygame.display.set_mode( (640,480) )

done = False
while not done:
    pygame.display.flip()
    for event in pygame.event.get():
        if event.type == QUIT:
            done = True

get the game window to freeze. it just doesn't update and acts strangely. the window is like "transparent", it makes me see what is behind it. if i minimize it and then reopen it, it shows the content, but if i drag it around the screen, it sort of "collects" the images it overlaps.. i've tried various code to get around the problem, like various flags in set_mode, flip and update and event pumping but nothing seems to work. it shows no problem in fullscreen mode, though.
any idea? thanks in advance,
gustavo
display.flip() might be the problem, you might be better off using display.update() in windowed mode.
That's really all I can think of, your code looks fine to me.
-Luke