JA_Screen_Settings.m 804 B

123456789101112131415161718192021222324252627282930313233
  1. function [window, screen_dimensions, screenNum, CenterX, CenterY, ifi] = JA_Screen_Settings(tinker)
  2. PsychDefaultSetup(2);
  3. PsychImaging('PrepareConfiguration');
  4. PsychImaging('AddTask', 'General', 'FloatingPoint32Bit');
  5. screenNum = max(Screen('Screens')); % Screen Number
  6. if tinker == 0
  7. [window, screen_dimensions] = PsychImaging('OpenWindow', screenNum);
  8. else
  9. [window, screen_dimensions] = PsychImaging('OpenWindow', screenNum, [],[0 0 640 360]);
  10. Screen('Preference', 'SkipSyncTests', 1)
  11. end
  12. ifi = Screen('GetFlipInterval', window);
  13. [CenterX, CenterY] = RectCenter(screen_dimensions);%variabile coordinate centro dell schermo, [orizzontale verticale]
  14. disp(ifi)
  15. % Maximum priority level
  16. topPriorityLevel = MaxPriority(window);
  17. Priority(topPriorityLevel);
  18. end