help on weird drawtexture error

Hi Everybody,

 

I am really new to PTB and trying to write my first experiment. So far, the instructions are showing up on the screen as I want them to. However, when trying to load in the pictures I get a weird error message. The script I am using to convert the jpg to texture has worked before. Can someone help please? I have included both scripts (the experiment itself isn’t done yet as I cannot get past this error message…).

 

Thank you so much in advance,

Best wishes,

Aleks

 

 

To follow up: this is the error message:

Error in function DrawTexture:       Missing argument

      Discrepancy between a specified and supplied argument:

            Specified Argument Description:

                  direction: Input

                  position: 2

                  presence:forbidden

                  formats allowed:

                        double

                  minimum M: 1

                  maximum M: 1

                  minimum N: 1

                  maximum N: 1

                  minimum P: 1

                  maximum P: 1

            Provided Argument Description:

                  direction: Input

                  position: 2

                  presence: absent

Error using Screen

Usage:

Screen('DrawTexture', windowPointer, texturePointer [,sourceRect] [,destinationRect] [,rotationAngle] [, filterMode]

[, globalAlpha] [, modulateColor] [, textureShader] [, specialFlags] [, auxParameters]);

Error in encoding_2 (line 219)

         Screen('DrawTexture', win, tex(trial_order(trial+1))); %uses loadJPG_as_Texture.m

 

 

From: Aleksandra Lecei
Sent: vrijdag 6 september 2019 18:30
To: 'psychtoolbox@yahoogroups.com' <psychtoolbox@yahoogroups.com>
Subject: help on weird drawtexture error

 

Hi Everybody,

 

I am really new to PTB and trying to write my first experiment. So far, the instructions are showing up on the screen as I want them to. However, when trying to load in the pictures I get a weird error message. The script I am using to convert the jpg to texture has worked before. Can someone help please? I have included both scripts (the experiment itself isn’t done yet as I cannot get past this error message…).

 

Thank you so much in advance,

Best wishes,

Aleks

 

 

The error message says that input arg 2 - the texture handle - is
missing. Now if you left input arg 2 empty [] that would also be a
missing input arg, ie. if tex(trial_order(trial+1)) = [] aka
isempty(tex(trial_order(trial+1))) == true then it would be missing.

-mario


On Sat, Sep 7, 2019 at 12:10 AM Aleksandra Lecei
aleksandra.lecei@... [PSYCHTOOLBOX]
<PSYCHTOOLBOX@yahoogroups.com> wrote:
>
>
>
> To follow up: this is the error message:
>
> Error in function DrawTexture: Missing argument
>
> Discrepancy between a specified and supplied argument:
>
> Specified Argument Description:
>
> direction: Input
>
> position: 2
>
> presence:forbidden
>
> formats allowed:
>
> double
>
> minimum M: 1
>
> maximum M: 1
>
> minimum N: 1
>
> maximum N: 1
>
> minimum P: 1
>
> maximum P: 1
>
> Provided Argument Description:
>
> direction: Input
>
> position: 2
>
> presence: absent
>
> Error using Screen
>
> Usage:
>
> Screen('DrawTexture', windowPointer, texturePointer [,sourceRect] [,destinationRect] [,rotationAngle] [, filterMode]
>
> [, globalAlpha] [, modulateColor] [, textureShader] [, specialFlags] [, auxParameters]);
>
> Error in encoding_2 (line 219)
>
> Screen('DrawTexture', win, tex(trial_order(trial+1))); %uses loadJPG_as_Texture.m
>
>
>
>
>
> From: Aleksandra Lecei
> Sent: vrijdag 6 september 2019 18:30
> To: 'psychtoolbox@yahoogroups.com' <psychtoolbox@yahoogroups.com>
> Subject: help on weird drawtexture error
>
>
>
> Hi Everybody,
>
>
>
> I am really new to PTB and trying to write my first experiment. So far, the instructions are showing up on the screen as I want them to. However, when trying to load in the pictures I get a weird error message. The script I am using to convert the jpg to texture has worked before. Can someone help please? I have included both scripts (the experiment itself isn’t done yet as I cannot get past this error message…).
>
>
>
> Thank you so much in advance,
>
> Best wishes,
>
> Aleks
>
>
>
>
>
>