% draw_stuff.m
%
% Draws stuff on the screen
try
    clear all;
    which_screen = 0;
    %[0,0,0] specifies the color of open wPtr
    [wPtr,rect]=Screen('OpenWindow',0, [0,0,0]);
    %/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;

    while(shape_dimensions(4)<rect(4))
        shape_dimensions(2)=shape_dimensions(2)+5;
        shape_dimensions(4)=shape_dimensions(4)+5;
        %Fill the rectangular windnow, which is the size of the monitor and
        %fill the black
        Screen(wPtr,'FillRect', [0,0,0], rect);
        %increasing 1% of the shape dimensions. USE shape_dimensions = shape_dimensions*1.01;
        %increase the shape of the screen in proportion to the size of the
        %screen sd(3) means the 3rd element of the vector.
        Screen(wPtr,'FillRect', [0,0,255], shape_dimensions);
        % take things from off screen window and copy to the main wPtr
        Screen('Flip', wPtr);
    end

    %clear screen and return control to matlab
    clear screen;

catch
    clear screen;
end


