flickering fullscreen gabor

sorry if this is an easy question(I am fairly new to matlab), but, I am having trouble understanding the correct way to implement a flicker for a full screen gabor. For this flicker, I have taken parts of the program from AsyncFlipTest. Parts of the code I am using currently to flip:

 ifi = Screen('GetFlipInterval', window);

 while ~KbCheck(device)

    tv1 = Screen('AsyncFlipEnd', window);

 

    Screen('DrawTextures', window, gabortex, [], [], orientation, 0, [], [], [],kPsychDontDoRotation,...      propertiesMat');


    Screen('AsyncFlipBegin', window, tv1 + ifi/2);

    

    Screen('Flip', window, vbl + (waitframes - 0.5) * ifi);

 

end

 

I have two questions regarding this:

 

1: correctly calling the command- how to include the contrastmodulation parameter used in the first part of the program, for the red screen (from AsyncFlipTest), but for the gabor. Where the red flickering screen would be a lower contrast red.

 

 

2: correct timing- may be a simple question, but if I wanted to vary the Hz the screen was flickering at, I have been trying to do this via refresh rate of the screen, and then implementing this into the flip. As I am calling two flip functions in order to make the stimuli flicker, I assume this gives me incorrect timing of the stimuli presented. This question, I suppose relates to the first question in correctly calling the command.