I've been trying to work out why my code for getting stimuli to appear in two windows wasn't working. I think I've narrowed the cause down to the 'useFBO' option, which seems to somehow mess up the behaviour of multiple windows...? Sorry for my non-technical/non-specific description of the problem - perhaps it's easier to show you what I mean. I expected that the code below would display msg1 in win1 and msg2 in win2. Instead, the background of win2 changes colour to match win1 (which is very odd!) and msg1 appears in win2 (and nothing appears in win1). It's as if win1 is being ignored and win2 is behaving like win1 ought to.
Switching useFBO to False for both win1 and win2 gives the behaviour that I expected.
I therefore think I want to switch useFBO to False - under what circumstances might this cause me problems? (The only reason it was set to True in my experiment was that I had compiled the code from the Builder view.)
# Import key parts of the PsychoPy library:
from psychopy import visual, core
# Create 2 visual windows:
win1 = visual.Window([800,1000], pos=(40,40), color=(0,0,0), fullscr=False, screen=0, monitor='Monitor1', colorSpace='rgb', useFBO=True, waitBlanking=False)
win2 = visual.Window([800,1000], pos=(1000,40), color=(1,0,0), fullscr=False, screen=0, monitor='Monitor1', colorSpace='rgb', useFBO=True, waitBlanking=False)
# Create (but not yet display) some text:
msg1 = visual.TextStim(win1, text=u"Hello world!") # default position = centered
msg2 = visual.TextStim(win2, text=u"\u00A1Hola mundo!", pos=(0, -0.3))
# Draw the text to the hidden visual buffer:
msg1.draw()
msg2.draw()
# Show the hidden buffer--everything that has been drawn since the last win.flip():
win1.flip()
win2.flip()
# Wait 3 seconds so people can see the message, then exit gracefully:
core.wait(3)
win1.close()
win2.close()