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

[pygame] Double buffer?



I'm writing a game that (in theory) uses double buffering. At the start
of the game I do this:

  screen = pygame.display.set_mode((430, 200), DOUBLEBUF|HWSURFACE)
  pygame.draw.line(game.screen, [0,255,0], 
                    [game.scoreWindowRect.left,0], 
                    [game.scoreWindowRect.right,0] )

Let me emphasize that the above code is executed only once. Then I enter
the main loop and do this:

  pygame.display.flip()

Since the line was only drawn on one buffer, it should flicker,
shouldn't it? It doesn't flicker. Does that mean I'm not using double
buffering?

-- 
 The first time the [artificially intelligent] creature was put down
 in the game world, he just stared at his feet. I was puzzled, but
 after debugging found that the creature was trying to eat himself.
 He was hungry, and had spotted himself as a nearby convenient object!
     - Richard Evans, creator of the AI game "Black & White"