Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

pygame.display.flip flickering in fullscreen

Hi everyone,
I've got a problem that I can't seem to isolate.
I've done a number of studies using videos in an eye and mouse-tracking paradigm, and the way I found which worked best was to blit each frame of a video to the pygame surface.
Since updating to OpenSesame v3.2.5 on the machine in our lab, I'm getting a flickering throughout the while loop below but only when in full screen

Things I've noted:

  • it works fine on my personal machine (linux, opensesame3.2.5) both fullscreen and running in window
  • it worked fine on the lab machine (win 7) prior to updating to Opensesame 3.2
  • it works fine on the lab machine now when running in window mode, but not in fullscreen (this is the problem)
  • it doesn't appear to be a version thing - I've tried it on the lab machine with opensesame v3.0 and v3.1, and with different version of pygame too.

any suggestions on what might be causing it?
The code below can replicate the problem (on the lab machine at least).
Thanks in advance for any thoughts!

-Josiah.

import random
import pygame
from openexp.mouse import mouse
my_mouse = mouse(exp, visible=True)
xc = self.get("width")/2
yc = self.get("height")/2
width=255
height=255
while True:
    pressed=my_mouse.get_pressed()
    pos, timestamp = my_mouse.get_pos()
    surf = pygame.Surface((width,height))
    rect = surf.get_rect()
    surf.fill((255,255,0), rect)
    exp.surface.blit(surf, (xc-int(width/2),yc-height))
    pygame.display.flip()
    if pressed[0]==1:
        break

Comments

Sign In or Register to comment.