[visionegg] screen.clear() requires 40ms....

Hi Andrew

the VE-fMRI project goes on..now I can read in by means of a simple GUI (thanks 
to wxPython) the subject ID and the stimulus-file (where the to be shown 
stimuli are listed).

One problem: the following code snippet is the essential part yielding a 
problem: 
this code shows me (my_debug_msg), that the screen.clear() routine takes most 
of the times between 20 and 60ms.
..why this?



while (not pygame.event.peek((QUIT,KEYDOWN))): 

    while (not TRIGGER_RECEIVED):
        poll the Lpt...   
 
    my_debug_msg.append('before clear.screen [ms]: ' + str(1000 * 
(VisionEgg.time_func()-start_time)) )         

    screen.clear()

    my_debug_msg.append('after clear screen [ms]: ' + str(1000 * 
(VisionEgg.time_func()-start_time)) )   


    viewport.parameters.stimuli = [preloaded_stimulus_list[stim_index]] #update 
the viewport 
    viewport.draw()

    swap_buffers()                                          


--

I cannot explain it.

Thanks for a hint

christoph
--
p.s.

the preloaded_stimulus_list[stim_index] comes from:

--
# Create a list of TextureStimulus instances, one with each of your texture 
images. 
preloaded_stimulus_list = []                                 #empty at first
for stim_index in range(num_images):                         #for all stimuli 
except the null-event create a texture object
    if not photoX[stim_index] == nullevent:
        # Read the texture file
        texture = Texture(photoX[stim_index])
 
        # Add to list of TEXTURES
        x = screen.size[0]/2 - texture.size[0]/2
        y = screen.size[1]/2 - texture.size[1]/2
    
        # Load the texture to OpenGL, prepare for display
        stimulus = TextureStimulus(texture = texture,size = texture.size, 
lowerleft=(x,y))
    else:                                                    #for the 
nullevent, just append the nullevent-indicator
        stimulus = nullevent
    # Add to list of stimuli
    preloaded_stimulus_list.append( stimulus )

viewport = Viewport( screen=screen)
--


-- 
Christoph Lehmann <lehmann@xxxxxxxxxxxx>
University Hospital of Clinical Psychiatry

======================================
The Vision Egg mailing list
Archives: http://www.freelists.org/archives/visionegg
Website: http://www.visionegg.org/mailinglist.html

Other related posts: