FAQ - Blue Screen
Q: When I call Screen('OpenWindow') my screen turns blue or white and nothing happens anymore. What's wrong?
A: A blue screen used to be the normal behaviour, nowadays it means you use an outdated copy of PTB. Since 2007 we've replaced the blue screen by a white screen and some welcome message: During the first call to Screen('OpenWindow'), PTB-3 checks out your video driver for compatibility and calibrates the timing of your display. It indicates this to you by making the screen white and showing some welcome message on some operating systems. After a successfull 'OpenWindow', the screen switches to the selected background color as specified in the Screen('OpenWindow') call until you call the Screen('Flip', ...) command to change it. If the background colored screen persists for many seconds, your program may be stuck, waiting for something, or terminated normally or abnormally (error). If your program is running you may be able to stop it by hitting Command-Period or Control-C or Escape or Command-Option-Escape (results vary, the last often kills MATLAB). Once your program has stopped running, you can blindly type sca, which is an abbreviation for Screen('CloseAll') to restore the screen and get back to the Matlab command prompt. Depending on what your program did, you may also want to type ShowCursor.
Current releases of PTB-3 will show a nice Welcome message during startup, and will switch to your selected background color immediately after execution of OpenWindow, so you will know when your script takes control.
You can disable the startup screen, i.e., replace it by a black display until calibration is finished, by issuing the command Screen('Preference', 'VisualDebuglevel', 3); at the beginning of your script.
See also: