% draw_stuff.m
%
% Draws stuff on the screen
    clear all;
try
    
    [wPtr, rect] = Screen('OpenWindow',0);%max(Screen('Screens'))); 

    tic
    while(toc<3)
        Screen(wPtr,'FillRect', [0,0,0], rect);
        % create shape
        %/2 will divide each of the value by two, it will reduce the square by
        %quarter changing [0,0,800,600] to [0,0,400,300]
        shape_dimensions = rect/2;
        Screen(wPtr,'FillRect', [0,0,255], shape_dimensions);
        
        % take things from off screen window and copy to the main window
        Screen('Flip', wPtr);
    end
    %clear screen and return control to matlab
    clear screen;
catch
    %clear screen and return control to matlab
    clear screen;
end





