clc;                                                                            % clear the command window
clear all;                                                                      % clear all variables in memory
close all;                                                                      % close all windows and ports
rng('shuffle');                                                                 % seed the random number generator

Screen('Preference', 'SkipSyncTests', 1);                                       % skip the Sync tests
[window, window_size] = Screen('OpenWindow', 0, [0 0 0], [],32,2);              % open a drawing window

our_image = imread('duck.jpg');                                                 % load an image
our_texture = Screen('MakeTexture', window, our_image);                         % make a texture
Screen('DrawTexture', window, our_texture, [], []);                             % draw a texture

Screen('Flip',window);                                                          % push the current drawing to the screen
    
WaitSecs(3);                                                                    % wait for 3 seconds

Screen('CloseAll');                                                             % close the drawing window