~ubuntu-branches/ubuntu/trusty/psychtoolbox-3/trusty-proposed

« back to all changes in this revision

Viewing changes to PsychSourceGL/Source/Common/Screen/SCREENgluDisk.c

  • Committer: Package Import Robot
  • Author(s): Yaroslav Halchenko
  • Date: 2013-11-19 23:34:50 UTC
  • mfrom: (3.1.4 experimental)
  • Revision ID: package-import@ubuntu.com-20131119233450-f7nf92vb8qavjmk8
Tags: 3.0.11.20131017.dfsg1-3
Upload to unsable since fresh glew has arrived to sid!

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
  
4
4
        AUTHORS:
5
5
 
6
 
                Allen.Ingling@nyu.edu           awi 
 
6
                Allen.Ingling@nyu.edu                           awi
 
7
                mario.kleiner@tuebingen.mpg.de          mk
7
8
  
8
 
        PLATFORMS:
 
9
    PLATFORMS:
9
10
        
10
 
                Only OS X for now.
11
 
    
 
11
                All.
12
12
 
13
13
        HISTORY:
14
14
  
15
15
                10/10/03  awi           Created.  It's experimental   
16
16
                2/25/05         awi             Added call to PsychUpdateAlphaBlendingFactorLazily().  Drawing now obeys settings by Screen('BlendFunction').
17
 
 
18
 
  
 
17
   
19
18
        TO DO:
20
 
  
21
19
 
22
20
*/
23
21
 
24
 
 
25
22
#include "Screen.h"
26
23
 
27
24
// If you change useString then also change the corresponding synopsis string in ScreenSynopsis.c
28
25
static char useString[] = "Screen('gluDisk', windowPtr, color, x, y [,size]);";
29
26
static char synopsisString[] = 
30
 
        "Draw a point at the specified location";
 
27
        "Draw a point at the specified location (x,y) in specified 'color' "
 
28
    "with radius 'size'.";
31
29
static char seeAlsoString[] = "FrameRect";      
32
30
 
33
31
PsychError SCREENgluDisk(void)  
36
34
        PsychColorType                  color;
37
35
        double                                  *xPosition, *yPosition, dotSize;
38
36
        PsychWindowRecordType   *windowRecord;
39
 
        int                                             whiteValue;
40
 
        psych_bool                                      isArgThere;
 
37
        double                                  whiteValue;
 
38
        psych_bool                              isArgThere;
41
39
        GLUquadricObj                   *diskQuadric;
42
40
    
43
41
        //all sub functions should have these two lines
53
51
        
54
52
        //Get the color argument or use the default, then coerce to the form determened by the window depth.  
55
53
        isArgThere=PsychCopyInColorArg(kPsychUseDefaultArgPosition, FALSE, &color);
56
 
                if(!isArgThere){
57
 
                        whiteValue=PsychGetWhiteValueFromWindow(windowRecord);
58
 
                        PsychLoadColorStruct(&color, kPsychIndexColor, whiteValue ); //index mode will coerce to any other.
59
 
                }
 
54
    if(!isArgThere){
 
55
        whiteValue=PsychGetWhiteValueFromWindow(windowRecord);
 
56
        PsychLoadColorStruct(&color, kPsychIndexColor, whiteValue ); //index mode will coerce to any other.
 
57
    }
60
58
 
61
59
        PsychCoerceColorMode( &color);
62
60
        
74
72
 
75
73
        PsychUpdateAlphaBlendingFactorLazily(windowRecord);
76
74
        PsychSetGLColor(&color, windowRecord);
77
 
        glPushMatrix();
78
 
        glTranslated(*xPosition,*yPosition,0);
79
 
        diskQuadric=gluNewQuadric();
80
 
        gluDisk(diskQuadric, 0, dotSize, 30, 30);
81
 
        gluDeleteQuadric(diskQuadric);
82
 
        glPopMatrix();
 
75
 
 
76
    if (PsychIsGLClassic(windowRecord)) {
 
77
        glPushMatrix();
 
78
        glTranslated(*xPosition,*yPosition,0);
 
79
        diskQuadric=gluNewQuadric();
 
80
        gluDisk(diskQuadric, 0, dotSize, 30, 30);
 
81
        gluDeleteQuadric(diskQuadric);
 
82
        glPopMatrix();
 
83
    }
 
84
    else {
 
85
        PsychDrawDisc(windowRecord, (float) *xPosition, (float) *yPosition, 0, (float) dotSize, 30, 1, 1, 0, 360);
 
86
    }
83
87
 
84
88
        // Mark end of drawing op. This is needed for single buffered drawing:
85
89
        PsychFlushGL(windowRecord);
87
91
        //All psychfunctions require this.
88
92
        return(PsychError_none);
89
93
}
90
 
 
91
 
 
92
 
 
93
 
 
94