Changeset 3079 for trunk/src/opengl/mesa


Ignore:
Timestamp:
Mar 11, 2000, 10:05:07 AM (25 years ago)
Author:
jeroen
Message:

* empty log message *

Location:
trunk/src/opengl/mesa
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/opengl/mesa/GL/glu.h

    r2945 r3079  
    1 /* $Id: glu.h,v 1.2 2000-02-29 13:56:52 sandervl Exp $ */
     1/* $Id: glu.h,v 1.3 2000-03-11 09:05:07 jeroen Exp $ */
    22
    33/*
     
    3838#include "GL/gl.h"
    3939
    40         /* to facilitate clean DLL building ... */
     40        /* to facilitate clean DLL building ... */
    4141#if !defined(OPENSTEP) && (defined(__WIN32__) || defined(__CYGWIN32__))
    42 #       if defined(_MSC_VER) && defined(BUILD_GLU32) /* tag specify we're building mesa as a DLL */
    43 #               define GLUAPI __declspec(dllexport)
    44 #       elif defined(_MSC_VER) && defined(_DLL) /* tag specifying we're building for DLL runtime support */
    45 #               define GLUAPI __declspec(dllimport)
    46 #       else /* for use with static link lib build of Win32 edition only */
    47 #               define GLUAPI extern
    48 #       endif /* _STATIC_MESA support */
     42#       if defined(_MSC_VER) && defined(BUILD_GLU32) /* tag specify we're building mesa as a DLL */
     43#               define GLUAPI __declspec(dllexport)
     44#       elif defined(_MSC_VER) && defined(_DLL) /* tag specifying we're building for DLL runtime support */
     45#               define GLUAPI __declspec(dllimport)
     46#       else /* for use with static link lib build of Win32 edition only */
     47#               define GLUAPI extern
     48#       endif /* _STATIC_MESA support */
    4949#else
    50 #       define GLUAPI extern
     50#       define GLUAPI extern
    5151#endif /* WIN32 / CYGWIN32 bracket */
    5252
    5353#ifdef macintosh
    54         #pragma enumsalwaysint on
    55         #if PRAGMA_IMPORT_SUPPORTED
    56         #pragma import on
    57         #endif
     54        #pragma enumsalwaysint on
     55        #if PRAGMA_IMPORT_SUPPORTED
     56        #pragma import on
     57        #endif
    5858#endif
    5959
     
    7171
    7272
    73 #define GLU_VERSION_1_1         1
    74 #define GLU_VERSION_1_2         1
     73#define GLU_VERSION_1_1         1
     74#define GLU_VERSION_1_2         1
    7575
    7676
     
    8282
    8383enum {
    84         /* Normal vectors */
    85         GLU_SMOOTH      = 100000,
    86         GLU_FLAT        = 100001,
    87         GLU_NONE        = 100002,
    88 
    89         /* Quadric draw styles */
    90         GLU_POINT       = 100010,
    91         GLU_LINE        = 100011,
    92         GLU_FILL        = 100012,
    93         GLU_SILHOUETTE  = 100013,
    94 
    95         /* Quadric orientation */
    96         GLU_OUTSIDE     = 100020,
    97         GLU_INSIDE      = 100021,
    98 
    99         /* Tessellator */
    100         GLU_TESS_BEGIN          = 100100,
    101         GLU_TESS_VERTEX         = 100101,
    102         GLU_TESS_END            = 100102,
    103         GLU_TESS_ERROR          = 100103,
    104         GLU_TESS_EDGE_FLAG      = 100104,
    105         GLU_TESS_COMBINE        = 100105,
    106 
    107         GLU_TESS_BEGIN_DATA     = 100106,
    108         GLU_TESS_VERTEX_DATA    = 100107,
    109         GLU_TESS_END_DATA       = 100108,
    110         GLU_TESS_ERROR_DATA     = 100109,
    111         GLU_TESS_EDGE_FLAG_DATA = 100110,
    112         GLU_TESS_COMBINE_DATA   = 100111,
    113 
    114         /* Winding rules */
    115         GLU_TESS_WINDING_ODD            = 100130,
    116         GLU_TESS_WINDING_NONZERO        = 100131,
    117         GLU_TESS_WINDING_POSITIVE       = 100132,
    118         GLU_TESS_WINDING_NEGATIVE       = 100133,
    119         GLU_TESS_WINDING_ABS_GEQ_TWO    = 100134,
    120 
    121         /* Tessellation properties */
    122         GLU_TESS_WINDING_RULE   = 100140,
    123         GLU_TESS_BOUNDARY_ONLY  = 100141,
    124         GLU_TESS_TOLERANCE      = 100142,
    125 
    126         /* Tessellation errors */
    127         GLU_TESS_ERROR1 = 100151,  /* Missing gluBeginPolygon */
    128         GLU_TESS_ERROR2 = 100152,  /* Missing gluBeginContour */
    129         GLU_TESS_ERROR3 = 100153,  /* Missing gluEndPolygon */
    130         GLU_TESS_ERROR4 = 100154,  /* Missing gluEndContour */
    131         GLU_TESS_ERROR5 = 100155,  /* */
    132         GLU_TESS_ERROR6 = 100156,  /* */
    133         GLU_TESS_ERROR7 = 100157,  /* */
    134         GLU_TESS_ERROR8 = 100158,  /* */
     84        /* Normal vectors */
     85        GLU_SMOOTH      = 100000,
     86        GLU_FLAT        = 100001,
     87        GLU_NONE        = 100002,
     88
     89        /* Quadric draw styles */
     90        GLU_POINT       = 100010,
     91        GLU_LINE        = 100011,
     92        GLU_FILL        = 100012,
     93        GLU_SILHOUETTE  = 100013,
     94
     95        /* Quadric orientation */
     96        GLU_OUTSIDE     = 100020,
     97        GLU_INSIDE      = 100021,
     98
     99        /* Tessellator */
     100        GLU_TESS_BEGIN          = 100100,
     101        GLU_TESS_VERTEX         = 100101,
     102        GLU_TESS_END            = 100102,
     103        GLU_TESS_ERROR          = 100103,
     104        GLU_TESS_EDGE_FLAG      = 100104,
     105        GLU_TESS_COMBINE        = 100105,
     106
     107        GLU_TESS_BEGIN_DATA     = 100106,
     108        GLU_TESS_VERTEX_DATA    = 100107,
     109        GLU_TESS_END_DATA       = 100108,
     110        GLU_TESS_ERROR_DATA     = 100109,
     111        GLU_TESS_EDGE_FLAG_DATA = 100110,
     112        GLU_TESS_COMBINE_DATA   = 100111,
     113
     114        /* Winding rules */
     115        GLU_TESS_WINDING_ODD            = 100130,
     116        GLU_TESS_WINDING_NONZERO        = 100131,
     117        GLU_TESS_WINDING_POSITIVE       = 100132,
     118        GLU_TESS_WINDING_NEGATIVE       = 100133,
     119        GLU_TESS_WINDING_ABS_GEQ_TWO    = 100134,
     120
     121        /* Tessellation properties */
     122        GLU_TESS_WINDING_RULE   = 100140,
     123        GLU_TESS_BOUNDARY_ONLY  = 100141,
     124        GLU_TESS_TOLERANCE      = 100142,
     125
     126        /* Tessellation errors */
     127        GLU_TESS_ERROR1 = 100151,  /* Missing gluBeginPolygon */
     128        GLU_TESS_ERROR2 = 100152,  /* Missing gluBeginContour */
     129        GLU_TESS_ERROR3 = 100153,  /* Missing gluEndPolygon */
     130        GLU_TESS_ERROR4 = 100154,  /* Missing gluEndContour */
     131        GLU_TESS_ERROR5 = 100155,  /* */
     132        GLU_TESS_ERROR6 = 100156,  /* */
     133        GLU_TESS_ERROR7 = 100157,  /* */
     134        GLU_TESS_ERROR8 = 100158,  /* */
    135135
    136136        GLU_TESS_MISSING_BEGIN_POLYGON = GLU_TESS_ERROR1,
     
    141141        GLU_TESS_NEED_COMBINE_CALLBACK = GLU_TESS_ERROR6,
    142142
    143         /* NURBS */
    144         GLU_NURBS_MODE          = 100160,
    145         GLU_NURBS_TESSELLATOR   = 100161,
    146         GLU_NURBS_RENDERER      = 100162,
    147         GLU_NURBS_BEGIN         = 100164,
    148         GLU_NURBS_VERTEX        = 100165,
    149         GLU_NURBS_NORMAL        = 100166,
    150         GLU_NURBS_COLOR         = 100167,
    151         GLU_NURBS_TEXTURE_COORD = 100168,
    152         GLU_NURBS_END           = 100169,
    153         GLU_NURBS_BEGIN_DATA    = 100170,
    154         GLU_NURBS_VERTEX_DATA   = 100171,
    155         GLU_NURBS_NORMAL_DATA   = 100172,
    156         GLU_NURBS_COLOR_DATA    = 100173,
    157         GLU_NURBS_TEXTURE_COORD_DATA = 100174,
    158         GLU_NURBS_END_DATA      = 100175,
    159 
    160         GLU_AUTO_LOAD_MATRIX    = 100200,
    161         GLU_CULLING             = 100201,
    162         GLU_PARAMETRIC_TOLERANCE= 100202,
    163         GLU_SAMPLING_TOLERANCE  = 100203,
    164         GLU_DISPLAY_MODE        = 100204,
    165         GLU_SAMPLING_METHOD     = 100205,
    166         GLU_U_STEP              = 100206,
    167         GLU_V_STEP              = 100207,
    168         GLU_OBJECT_PARAMETRIC_ERROR = 100208,
    169         GLU_OBJECT_PATH_LENGTH  = 100209,
    170 
    171         GLU_MAP1_TRIM_2         = 100210,
    172         GLU_MAP1_TRIM_3         = 100211,
    173 
    174         GLU_PATH_LENGTH         = 100215,
    175         GLU_PARAMETRIC_ERROR    = 100216,
    176         GLU_DOMAIN_DISTANCE     = 100217,
    177 
    178         GLU_OUTLINE_POLYGON     = 100240,
    179         GLU_OUTLINE_PATCH       = 100241,
    180 
    181         GLU_ERROR               = GLU_TESS_ERROR,
     143        /* NURBS */
     144        GLU_NURBS_MODE          = 100160,
     145        GLU_NURBS_TESSELLATOR   = 100161,
     146        GLU_NURBS_RENDERER      = 100162,
     147        GLU_NURBS_BEGIN         = 100164,
     148        GLU_NURBS_VERTEX        = 100165,
     149        GLU_NURBS_NORMAL        = 100166,
     150        GLU_NURBS_COLOR         = 100167,
     151        GLU_NURBS_TEXTURE_COORD = 100168,
     152        GLU_NURBS_END           = 100169,
     153        GLU_NURBS_BEGIN_DATA    = 100170,
     154        GLU_NURBS_VERTEX_DATA   = 100171,
     155        GLU_NURBS_NORMAL_DATA   = 100172,
     156        GLU_NURBS_COLOR_DATA    = 100173,
     157        GLU_NURBS_TEXTURE_COORD_DATA = 100174,
     158        GLU_NURBS_END_DATA      = 100175,
     159
     160        GLU_AUTO_LOAD_MATRIX    = 100200,
     161        GLU_CULLING             = 100201,
     162        GLU_PARAMETRIC_TOLERANCE= 100202,
     163        GLU_SAMPLING_TOLERANCE  = 100203,
     164        GLU_DISPLAY_MODE        = 100204,
     165        GLU_SAMPLING_METHOD     = 100205,
     166        GLU_U_STEP              = 100206,
     167        GLU_V_STEP              = 100207,
     168        GLU_OBJECT_PARAMETRIC_ERROR = 100208,
     169        GLU_OBJECT_PATH_LENGTH  = 100209,
     170
     171        GLU_MAP1_TRIM_2         = 100210,
     172        GLU_MAP1_TRIM_3         = 100211,
     173
     174        GLU_PATH_LENGTH         = 100215,
     175        GLU_PARAMETRIC_ERROR    = 100216,
     176        GLU_DOMAIN_DISTANCE     = 100217,
     177
     178        GLU_OUTLINE_POLYGON     = 100240,
     179        GLU_OUTLINE_PATCH       = 100241,
     180
     181        GLU_ERROR               = GLU_TESS_ERROR,
    182182        GLU_NURBS_ERROR         = GLU_ERROR, /* FIXME: is this correct?? */
    183183
    184         GLU_NURBS_ERROR1  = 100251,   /* spline order un-supported */
    185         GLU_NURBS_ERROR2  = 100252,   /* too few knots */
    186         GLU_NURBS_ERROR3  = 100253,   /* valid knot range is empty */
    187         GLU_NURBS_ERROR4  = 100254,   /* decreasing knot sequence */
    188         GLU_NURBS_ERROR5  = 100255,   /* knot multiplicity > spline order */
    189         GLU_NURBS_ERROR6  = 100256,   /* endcurve() must follow bgncurve() */
    190         GLU_NURBS_ERROR7  = 100257,   /* bgncurve() must precede endcurve() */
    191         GLU_NURBS_ERROR8  = 100258,   /* ctrlarray or knot vector is NULL */
    192         GLU_NURBS_ERROR9  = 100259,   /* can't draw pwlcurves */
    193         GLU_NURBS_ERROR10 = 100260,   /* missing gluNurbsCurve() */
    194         GLU_NURBS_ERROR11 = 100261,   /* missing gluNurbsSurface() */
    195         GLU_NURBS_ERROR12 = 100262,   /* endtrim() must precede endsurface() */
    196         GLU_NURBS_ERROR13 = 100263,   /* bgnsurface() must precede endsurface() */
    197         GLU_NURBS_ERROR14 = 100264,   /* curve of improper type passed as trim curve */
    198         GLU_NURBS_ERROR15 = 100265,   /* bgnsurface() must precede bgntrim() */
    199         GLU_NURBS_ERROR16 = 100266,   /* endtrim() must follow bgntrim() */
    200         GLU_NURBS_ERROR17 = 100267,   /* bgntrim() must precede endtrim()*/
    201         GLU_NURBS_ERROR18 = 100268,   /* invalid or missing trim curve*/
    202         GLU_NURBS_ERROR19 = 100269,   /* bgntrim() must precede pwlcurve() */
    203         GLU_NURBS_ERROR20 = 100270,   /* pwlcurve referenced twice*/
    204         GLU_NURBS_ERROR21 = 100271,   /* pwlcurve and nurbscurve mixed */
    205         GLU_NURBS_ERROR22 = 100272,   /* improper usage of trim data type */
    206         GLU_NURBS_ERROR23 = 100273,   /* nurbscurve referenced twice */
    207         GLU_NURBS_ERROR24 = 100274,   /* nurbscurve and pwlcurve mixed */
    208         GLU_NURBS_ERROR25 = 100275,   /* nurbssurface referenced twice */
    209         GLU_NURBS_ERROR26 = 100276,   /* invalid property */
    210         GLU_NURBS_ERROR27 = 100277,   /* endsurface() must follow bgnsurface() */
    211         GLU_NURBS_ERROR28 = 100278,   /* intersecting or misoriented trim curves */
    212         GLU_NURBS_ERROR29 = 100279,   /* intersecting trim curves */
    213         GLU_NURBS_ERROR30 = 100280,   /* UNUSED */
    214         GLU_NURBS_ERROR31 = 100281,   /* unconnected trim curves */
    215         GLU_NURBS_ERROR32 = 100282,   /* unknown knot error */
    216         GLU_NURBS_ERROR33 = 100283,   /* negative vertex count encountered */
    217         GLU_NURBS_ERROR34 = 100284,   /* negative byte-stride */
    218         GLU_NURBS_ERROR35 = 100285,   /* unknown type descriptor */
    219         GLU_NURBS_ERROR36 = 100286,   /* null control point reference */
    220         GLU_NURBS_ERROR37 = 100287,   /* duplicate point on pwlcurve */
    221 
    222         /* Errors */
    223         GLU_INVALID_ENUM                = 100900,
    224         GLU_INVALID_VALUE               = 100901,
    225         GLU_OUT_OF_MEMORY               = 100902,
    226         GLU_INCOMPATIBLE_GL_VERSION     = 100903,
     184        GLU_NURBS_ERROR1  = 100251,   /* spline order un-supported */
     185        GLU_NURBS_ERROR2  = 100252,   /* too few knots */
     186        GLU_NURBS_ERROR3  = 100253,   /* valid knot range is empty */
     187        GLU_NURBS_ERROR4  = 100254,   /* decreasing knot sequence */
     188        GLU_NURBS_ERROR5  = 100255,   /* knot multiplicity > spline order */
     189        GLU_NURBS_ERROR6  = 100256,   /* endcurve() must follow bgncurve() */
     190        GLU_NURBS_ERROR7  = 100257,   /* bgncurve() must precede endcurve() */
     191        GLU_NURBS_ERROR8  = 100258,   /* ctrlarray or knot vector is NULL */
     192        GLU_NURBS_ERROR9  = 100259,   /* can't draw pwlcurves */
     193        GLU_NURBS_ERROR10 = 100260,   /* missing gluNurbsCurve() */
     194        GLU_NURBS_ERROR11 = 100261,   /* missing gluNurbsSurface() */
     195        GLU_NURBS_ERROR12 = 100262,   /* endtrim() must precede endsurface() */
     196        GLU_NURBS_ERROR13 = 100263,   /* bgnsurface() must precede endsurface() */
     197        GLU_NURBS_ERROR14 = 100264,   /* curve of improper type passed as trim curve */
     198        GLU_NURBS_ERROR15 = 100265,   /* bgnsurface() must precede bgntrim() */
     199        GLU_NURBS_ERROR16 = 100266,   /* endtrim() must follow bgntrim() */
     200        GLU_NURBS_ERROR17 = 100267,   /* bgntrim() must precede endtrim()*/
     201        GLU_NURBS_ERROR18 = 100268,   /* invalid or missing trim curve*/
     202        GLU_NURBS_ERROR19 = 100269,   /* bgntrim() must precede pwlcurve() */
     203        GLU_NURBS_ERROR20 = 100270,   /* pwlcurve referenced twice*/
     204        GLU_NURBS_ERROR21 = 100271,   /* pwlcurve and nurbscurve mixed */
     205        GLU_NURBS_ERROR22 = 100272,   /* improper usage of trim data type */
     206        GLU_NURBS_ERROR23 = 100273,   /* nurbscurve referenced twice */
     207        GLU_NURBS_ERROR24 = 100274,   /* nurbscurve and pwlcurve mixed */
     208        GLU_NURBS_ERROR25 = 100275,   /* nurbssurface referenced twice */
     209        GLU_NURBS_ERROR26 = 100276,   /* invalid property */
     210        GLU_NURBS_ERROR27 = 100277,   /* endsurface() must follow bgnsurface() */
     211        GLU_NURBS_ERROR28 = 100278,   /* intersecting or misoriented trim curves */
     212        GLU_NURBS_ERROR29 = 100279,   /* intersecting trim curves */
     213        GLU_NURBS_ERROR30 = 100280,   /* UNUSED */
     214        GLU_NURBS_ERROR31 = 100281,   /* unconnected trim curves */
     215        GLU_NURBS_ERROR32 = 100282,   /* unknown knot error */
     216        GLU_NURBS_ERROR33 = 100283,   /* negative vertex count encountered */
     217        GLU_NURBS_ERROR34 = 100284,   /* negative byte-stride */
     218        GLU_NURBS_ERROR35 = 100285,   /* unknown type descriptor */
     219        GLU_NURBS_ERROR36 = 100286,   /* null control point reference */
     220        GLU_NURBS_ERROR37 = 100287,   /* duplicate point on pwlcurve */
     221
     222        /* Errors */
     223        GLU_INVALID_ENUM                = 100900,
     224        GLU_INVALID_VALUE               = 100901,
     225        GLU_OUT_OF_MEMORY               = 100902,
     226        GLU_INCOMPATIBLE_GL_VERSION     = 100903,
    227227        GLU_INVALID_OPERATION           = 100904,
    228228
    229         /* New in GLU 1.1 */
    230         GLU_VERSION     = 100800,
    231         GLU_EXTENSIONS  = 100801,
    232 
    233         /*** GLU 1.0 tessellation - obsolete! ***/
    234 
    235         /* Contour types */
    236         GLU_CW          = 100120,
    237         GLU_CCW         = 100121,
    238         GLU_INTERIOR    = 100122,
    239         GLU_EXTERIOR    = 100123,
    240         GLU_UNKNOWN     = 100124,
    241 
    242         /* Tessellator */
    243         GLU_BEGIN       = GLU_TESS_BEGIN,
    244         GLU_VERTEX      = GLU_TESS_VERTEX,
    245         GLU_END         = GLU_TESS_END,
    246         GLU_EDGE_FLAG   = GLU_TESS_EDGE_FLAG
     229        /* New in GLU 1.1 */
     230        GLU_VERSION     = 100800,
     231        GLU_EXTENSIONS  = 100801,
     232
     233        /*** GLU 1.0 tessellation - obsolete! ***/
     234
     235        /* Contour types */
     236        GLU_CW          = 100120,
     237        GLU_CCW         = 100121,
     238        GLU_INTERIOR    = 100122,
     239        GLU_EXTERIOR    = 100123,
     240        GLU_UNKNOWN     = 100124,
     241
     242        /* Tessellator */
     243        GLU_BEGIN       = GLU_TESS_BEGIN,
     244        GLU_VERTEX      = GLU_TESS_VERTEX,
     245        GLU_END         = GLU_TESS_END,
     246        GLU_EDGE_FLAG   = GLU_TESS_EDGE_FLAG
    247247};
    248248
     
    360360
    361361GLUAPI void GLAPIENTRY gluQuadricCallback( GLUquadricObj *qobj,
    362                                          GLenum which, void (GLCALLBACK *fn)() );
     362                                           GLenum which,
     363                                           void (GLCALLBACK *fn)() );
    363364
    364365GLUAPI void GLAPIENTRY gluCylinder( GLUquadricObj *qobj,
     
    449450
    450451GLUAPI void GLAPIENTRY gluTessBeginPolygon( GLUtesselator *tobj,
    451                                             void *polygon_data );
     452                                            void *polygon_data );
    452453
    453454GLUAPI void GLAPIENTRY gluTessBeginContour( GLUtesselator *tobj );
    454455
    455456GLUAPI void GLAPIENTRY gluTessVertex( GLUtesselator *tobj, GLdouble coords[3],
    456                                       void *vertex_data );
     457                                      void *vertex_data );
    457458
    458459GLUAPI void GLAPIENTRY gluTessEndContour( GLUtesselator *tobj );
     
    461462
    462463GLUAPI void GLAPIENTRY gluTessProperty( GLUtesselator *tobj, GLenum which,
    463                                         GLdouble value );
     464                                        GLdouble value );
    464465
    465466GLUAPI void GLAPIENTRY gluTessNormal( GLUtesselator *tobj, GLdouble x,
    466                                       GLdouble y, GLdouble z );
     467                                      GLdouble y, GLdouble z );
    467468
    468469GLUAPI void GLAPIENTRY gluTessCallback( GLUtesselator *tobj, GLenum which,
    469                                         void (GLCALLBACK *fn)() );
     470                                        void (GLCALLBACK *fn)() );
    470471
    471472GLUAPI void GLAPIENTRY gluGetTessProperty( GLUtesselator *tobj, GLenum which,
    472                                            GLdouble *value );
     473                                           GLdouble *value );
    473474
    474475/*
     
    502503
    503504#ifdef macintosh
    504         #pragma enumsalwaysint reset
    505         #if PRAGMA_IMPORT_SUPPORTED
    506         #pragma import off
    507         #endif
     505        #pragma enumsalwaysint reset
     506        #if PRAGMA_IMPORT_SUPPORTED
     507        #pragma import off
     508        #endif
    508509#endif
    509510
  • trunk/src/opengl/mesa/api1.c

    r2938 r3079  
    1 /* $Id: api1.c,v 1.1 2000-02-29 00:49:57 sandervl Exp $ */
     1/* $Id: api1.c,v 1.2 2000-03-11 09:05:06 jeroen Exp $ */
    22
    33/*
     
    5454#endif
    5555
     56#include <misc.h>
     57
    5658/*
    5759 * Part 1 of API functions
     
    8587 * function pointer.
    8688 */
    87 #define ARRAY_ELT( IM, i )                                      \
    88 {                                                               \
    89    GLuint count = IM->Count;                                    \
    90    IM->Elt[count] = i;                                          \
    91    IM->Flag[count] = ((IM->Flag[count] & IM->ArrayAndFlags) |   \
    92                       VERT_ELT);                                \
    93    IM->FlushElt |= IM->ArrayEltFlush;                           \
    94    IM->Count = count += IM->ArrayIncr;                          \
    95    if (count == VB_MAX)                                         \
    96       IM->maybe_transform_vb( IM );                             \
     89#define ARRAY_ELT( IM, i )                                      \
     90{                                                               \
     91   GLuint count = IM->Count;                                    \
     92   IM->Elt[count] = i;                                          \
     93   IM->Flag[count] = ((IM->Flag[count] & IM->ArrayAndFlags) |   \
     94                      VERT_ELT);                                \
     95   IM->FlushElt |= IM->ArrayEltFlush;                           \
     96   IM->Count = count += IM->ArrayIncr;                          \
     97   if (count == VB_MAX)                                         \
     98      IM->maybe_transform_vb( IM );                             \
    9799}
    98100
     
    125127   if (mode < GL_POINTS || mode > GL_POLYGON) {
    126128      gl_compile_error( CC, GL_INVALID_ENUM, "glBegin" );
    127       return;           
     129      return;
    128130   }
    129131
     
    251253 * color-material and vertex arrays.
    252254 */
    253 #define COLOR( IM, r,g,b,a )                    \
    254 {                                               \
    255    GLuint count = IM->Count;                    \
    256    IM->Flag[count] |= VERT_RGBA;                \
    257    IM->Color[count][0] = r;                     \
    258    IM->Color[count][1] = g;                     \
    259    IM->Color[count][2] = b;                     \
    260    IM->Color[count][3] = a;                     \
     255#define COLOR( IM, r,g,b,a )                    \
     256{                                               \
     257   GLuint count = IM->Count;                    \
     258   IM->Flag[count] |= VERT_RGBA;                \
     259   IM->Color[count][0] = r;                     \
     260   IM->Color[count][1] = g;                     \
     261   IM->Color[count][2] = b;                     \
     262   IM->Color[count][3] = a;                     \
    261263}
    262264
    263265#if 0
    264 #define COLOR4F( IM, r,g,b,a )                          \
    265 {                                                       \
    266    GLuint count = IM->Count;                            \
    267    IM->Flag[count] |= VERT_RGBA | VERT_FLOAT_RGBA;      \
    268    IM->FloatColor[count][0] = r;                        \
    269    IM->FloatColor[count][1] = g;                        \
    270    IM->FloatColor[count][2] = b;                        \
    271    IM->FloatColor[count][3] = a;                        \
     266#define COLOR4F( IM, r,g,b,a )                          \
     267{                                                       \
     268   GLuint count = IM->Count;                            \
     269   IM->Flag[count] |= VERT_RGBA | VERT_FLOAT_RGBA;      \
     270   IM->FloatColor[count][0] = r;                        \
     271   IM->FloatColor[count][1] = g;                        \
     272   IM->FloatColor[count][2] = b;                        \
     273   IM->FloatColor[count][3] = a;                        \
    272274}
    273275#else
    274 #define COLOR4F(IM, r, g, b, a)                 \
    275 {                                               \
    276    GLubyte col[4];                              \
    277    FLOAT_COLOR_TO_UBYTE_COLOR(col[0], r);       \
    278    FLOAT_COLOR_TO_UBYTE_COLOR(col[1], g);       \
    279    FLOAT_COLOR_TO_UBYTE_COLOR(col[2], b);       \
    280    FLOAT_COLOR_TO_UBYTE_COLOR(col[3], a);       \
    281    COLORV( IM, col );                           \
     276#define COLOR4F(IM, r, g, b, a)                 \
     277{                                               \
     278   GLubyte col[4];                              \
     279   FLOAT_COLOR_TO_UBYTE_COLOR(col[0], r);       \
     280   FLOAT_COLOR_TO_UBYTE_COLOR(col[1], g);       \
     281   FLOAT_COLOR_TO_UBYTE_COLOR(col[2], b);       \
     282   FLOAT_COLOR_TO_UBYTE_COLOR(col[3], a);       \
     283   COLORV( IM, col );                           \
    282284}
    283285#endif
     
    285287
    286288
    287 #define COLORV( IM, v )                         \
    288 {                                               \
    289    GLuint count = IM->Count;                    \
    290    IM->Flag[count] |= VERT_RGBA;                \
    291    COPY_4UBV(IM->Color[count], v);              \
     289#define COLORV( IM, v )                         \
     290{                                               \
     291   GLuint count = IM->Count;                    \
     292   IM->Flag[count] |= VERT_RGBA;                \
     293   COPY_4UBV(IM->Color[count], v);              \
    292294}
    293295
     
    297299   GET_IMMEDIATE;
    298300   COLOR( IM,
    299           BYTE_TO_UBYTE(red),
    300           BYTE_TO_UBYTE(green),
    301           BYTE_TO_UBYTE(blue),
    302           255 );
     301          BYTE_TO_UBYTE(red),
     302          BYTE_TO_UBYTE(green),
     303          BYTE_TO_UBYTE(blue),
     304          255 );
    303305}
    304306
     
    339341   GET_IMMEDIATE;
    340342   COLOR( IM, INT_TO_UBYTE(red),
    341           INT_TO_UBYTE(green),
    342           INT_TO_UBYTE(blue),
    343           255);
     343          INT_TO_UBYTE(green),
     344          INT_TO_UBYTE(blue),
     345          255);
    344346}
    345347
     
    349351   GET_IMMEDIATE;
    350352   COLOR( IM, SHORT_TO_UBYTE(red),
    351           SHORT_TO_UBYTE(green),
    352           SHORT_TO_UBYTE(blue),
    353           255);
     353          SHORT_TO_UBYTE(green),
     354          SHORT_TO_UBYTE(blue),
     355          255);
    354356}
    355357
     
    366368   GET_IMMEDIATE;
    367369   COLOR( IM, UINT_TO_UBYTE(red),
    368           UINT_TO_UBYTE(green),
    369           UINT_TO_UBYTE(blue),
    370           255 );
     370          UINT_TO_UBYTE(green),
     371          UINT_TO_UBYTE(blue),
     372          255 );
    371373}
    372374
     
    376378   GET_IMMEDIATE;
    377379   COLOR( IM, USHORT_TO_UBYTE(red), USHORT_TO_UBYTE(green),
    378           USHORT_TO_UBYTE(blue),
    379           255 );
     380          USHORT_TO_UBYTE(blue),
     381          255 );
    380382}
    381383
     
    385387   GET_IMMEDIATE;
    386388   COLOR( IM, BYTE_TO_UBYTE(red), BYTE_TO_UBYTE(green),
    387           BYTE_TO_UBYTE(blue), BYTE_TO_UBYTE(alpha) );
     389          BYTE_TO_UBYTE(blue), BYTE_TO_UBYTE(alpha) );
    388390}
    389391
    390392
    391393void GLAPIENTRY glColor4d(CTX_ARG GLdouble red, GLdouble green, GLdouble blue,
    392                            GLdouble alpha )
     394                           GLdouble alpha )
    393395{
    394396   GLubyte col[4];
     
    426428   GET_IMMEDIATE;
    427429   COLOR( IM, INT_TO_UBYTE(red), INT_TO_UBYTE(green),
    428           INT_TO_UBYTE(blue), INT_TO_UBYTE(alpha) );
     430          INT_TO_UBYTE(blue), INT_TO_UBYTE(alpha) );
    429431}
    430432
     
    435437   GET_IMMEDIATE;
    436438   COLOR( IM, SHORT_TO_UBYTE(red), SHORT_TO_UBYTE(green),
    437           SHORT_TO_UBYTE(blue), SHORT_TO_UBYTE(alpha) );
     439          SHORT_TO_UBYTE(blue), SHORT_TO_UBYTE(alpha) );
    438440}
    439441
     
    450452   GET_IMMEDIATE;
    451453   COLOR( IM, UINT_TO_UBYTE(red), UINT_TO_UBYTE(green),
    452           UINT_TO_UBYTE(blue), UINT_TO_UBYTE(alpha) );
     454          UINT_TO_UBYTE(blue), UINT_TO_UBYTE(alpha) );
    453455}
    454456
     
    458460   GET_IMMEDIATE;
    459461   COLOR( IM, USHORT_TO_UBYTE(red), USHORT_TO_UBYTE(green),
    460           USHORT_TO_UBYTE(blue), USHORT_TO_UBYTE(alpha) );
     462          USHORT_TO_UBYTE(blue), USHORT_TO_UBYTE(alpha) );
    461463}
    462464
     
    466468   GET_IMMEDIATE;
    467469   COLOR( IM, BYTE_TO_UBYTE(v[0]), BYTE_TO_UBYTE(v[1]),
    468           BYTE_TO_UBYTE(v[2]), 255 );
     470          BYTE_TO_UBYTE(v[2]), 255 );
    469471}
    470472
     
    505507   GET_IMMEDIATE;
    506508   COLOR( IM, INT_TO_UBYTE(v[0]), INT_TO_UBYTE(v[1]),
    507           INT_TO_UBYTE(v[2]), 255 );
     509          INT_TO_UBYTE(v[2]), 255 );
    508510}
    509511
     
    513515   GET_IMMEDIATE;
    514516   COLOR( IM, SHORT_TO_UBYTE(v[0]), SHORT_TO_UBYTE(v[1]),
    515           SHORT_TO_UBYTE(v[2]), 255 );
     517          SHORT_TO_UBYTE(v[2]), 255 );
    516518}
    517519
     
    528530   GET_IMMEDIATE;
    529531   COLOR( IM, UINT_TO_UBYTE(v[0]), UINT_TO_UBYTE(v[1]),
    530           UINT_TO_UBYTE(v[2]), 255 );
     532          UINT_TO_UBYTE(v[2]), 255 );
    531533}
    532534
     
    536538   GET_IMMEDIATE;
    537539   COLOR( IM, USHORT_TO_UBYTE(v[0]), USHORT_TO_UBYTE(v[1]),
    538           USHORT_TO_UBYTE(v[2]), 255 );
     540          USHORT_TO_UBYTE(v[2]), 255 );
    539541
    540542}
     
    545547   GET_IMMEDIATE;
    546548   COLOR( IM, BYTE_TO_UBYTE(v[0]), BYTE_TO_UBYTE(v[1]),
    547           BYTE_TO_UBYTE(v[2]), BYTE_TO_UBYTE(v[3]) );
     549          BYTE_TO_UBYTE(v[2]), BYTE_TO_UBYTE(v[3]) );
    548550}
    549551
     
    585587   GET_IMMEDIATE;
    586588   COLOR( IM, INT_TO_UBYTE(v[0]), INT_TO_UBYTE(v[1]),
    587           INT_TO_UBYTE(v[2]), INT_TO_UBYTE(v[3]) );
     589          INT_TO_UBYTE(v[2]), INT_TO_UBYTE(v[3]) );
    588590}
    589591
     
    593595   GET_IMMEDIATE;
    594596   COLOR( IM, SHORT_TO_UBYTE(v[0]), SHORT_TO_UBYTE(v[1]),
    595           SHORT_TO_UBYTE(v[2]), SHORT_TO_UBYTE(v[3]) );
     597          SHORT_TO_UBYTE(v[2]), SHORT_TO_UBYTE(v[3]) );
    596598}
    597599
     
    608610   GET_IMMEDIATE;
    609611   COLOR( IM, UINT_TO_UBYTE(v[0]), UINT_TO_UBYTE(v[1]),
    610           UINT_TO_UBYTE(v[2]), UINT_TO_UBYTE(v[3]) );
     612          UINT_TO_UBYTE(v[2]), UINT_TO_UBYTE(v[3]) );
    611613}
    612614
     
    616618   GET_IMMEDIATE;
    617619   COLOR( IM, USHORT_TO_UBYTE(v[0]), USHORT_TO_UBYTE(v[1]),
    618           USHORT_TO_UBYTE(v[2]), USHORT_TO_UBYTE(v[3]) );
     620          USHORT_TO_UBYTE(v[2]), USHORT_TO_UBYTE(v[3]) );
    619621}
    620622
     
    833835   state = IM->BeginState;
    834836   inflags = (~state) & (VERT_BEGIN_0|VERT_BEGIN_1);
    835    state |= inflags << 2;       /* errors */
     837   state |= inflags << 2;       /* errors */
    836838
    837839   if (MESA_VERBOSE&VERBOSE_API) {
    838840      if (MESA_VERBOSE&VERBOSE_IMMEDIATE)
    839         fprintf(stderr, "glEnd(IM %d), BeginState is %x, errors %x\n",
    840                 IM->id, state,
    841                 inflags<<2);
     841        fprintf(stderr, "glEnd(IM %d), BeginState is %x, errors %x\n",
     842                IM->id, state,
     843                inflags<<2);
    842844      else
    843         fprintf(stderr, ">");
     845        fprintf(stderr, ">");
    844846   }
    845847
     
    857859
    858860      if (IM->FlushElt) {
    859         gl_exec_array_elements( IM->backref, IM, last, count );
    860         IM->FlushElt = 0;
     861        gl_exec_array_elements( IM->backref, IM, last, count );
     862        IM->FlushElt = 0;
    861863      }
    862864   }
     
    881883   if (MESA_VERBOSE&VERBOSE_API) {
    882884      if (MESA_VERBOSE&VERBOSE_IMMEDIATE)
    883         fprintf(stderr, "gl_End(IM %d), BeginState is %x, errors %x\n",
    884                 IM->id, state,
    885                 inflags<<2);
     885        fprintf(stderr, "gl_End(IM %d), BeginState is %x, errors %x\n",
     886                IM->id, state,
     887                inflags<<2);
    886888      else
    887         fprintf(stderr, ">");
     889        fprintf(stderr, ">");
    888890   }
    889891
    890    state |= inflags << 2;       /* errors */
     892   state |= inflags << 2;       /* errors */
    891893
    892894   if (inflags != (VERT_BEGIN_0|VERT_BEGIN_1))
     
    902904
    903905      if (IM->FlushElt) {
    904         gl_exec_array_elements( ctx, IM, last, count );
    905         IM->FlushElt = 0;
     906        gl_exec_array_elements( ctx, IM, last, count );
     907        IM->FlushElt = 0;
    906908      }
    907909   }
     
    950952
    951953
    952 #define EVALCOORD1(IM, x)                               \
    953 {                                                       \
    954    GLuint count = IM->Count++;                          \
    955    IM->Flag[count] |= VERT_EVAL_C1;                     \
    956    ASSIGN_4V(IM->Obj[count], x, 0, 0, 1);               \
    957    if (count == VB_MAX-1)                               \
    958       IM->maybe_transform_vb( IM );                     \
    959 }
    960 
    961 #define EVALCOORD2(IM, x, y)                            \
    962 {                                                       \
    963    GLuint count = IM->Count++;                          \
    964    IM->Flag[count] |= VERT_EVAL_C2;                     \
    965    ASSIGN_4V(IM->Obj[count], x, y, 0, 1);               \
    966    if (count == VB_MAX-1)                               \
    967       IM->maybe_transform_vb( IM );                     \
    968 }
    969 
    970 #define EVALPOINT1(IM, x)                               \
    971 {                                                       \
    972    GLuint count = IM->Count++;                          \
    973    IM->Flag[count] |= VERT_EVAL_P1;                     \
    974    ASSIGN_4V(IM->Obj[count], x, 0, 0, 1);               \
    975    if (count == VB_MAX-1)                               \
    976       IM->maybe_transform_vb( IM );                     \
    977 }
    978 
    979 #define EVALPOINT2(IM, x, y)                            \
    980 {                                                       \
    981    GLuint count = IM->Count++;                          \
    982    IM->Flag[count] |= VERT_EVAL_P2;                     \
    983    ASSIGN_4V(IM->Obj[count], x, y, 0, 1);               \
    984    if (count == VB_MAX-1)                               \
    985       IM->maybe_transform_vb( IM );                     \
     954#define EVALCOORD1(IM, x)                               \
     955{                                                       \
     956   GLuint count = IM->Count++;                          \
     957   IM->Flag[count] |= VERT_EVAL_C1;                     \
     958   ASSIGN_4V(IM->Obj[count], x, 0, 0, 1);               \
     959   if (count == VB_MAX-1)                               \
     960      IM->maybe_transform_vb( IM );                     \
     961}
     962
     963#define EVALCOORD2(IM, x, y)                            \
     964{                                                       \
     965   GLuint count = IM->Count++;                          \
     966   IM->Flag[count] |= VERT_EVAL_C2;                     \
     967   ASSIGN_4V(IM->Obj[count], x, y, 0, 1);               \
     968   WriteLog("OPENGL32: EVALCOORD2 (%f,%f) IM: %08X - cnt %d\n",x,y,IM,count); \
     969   if (count == VB_MAX-1)                               \
     970   {WriteLog("OPENGL32: EVALCOORD2 is calling maybe_transform\n"); \
     971      IM->maybe_transform_vb( IM );                     }\
     972}
     973
     974#define EVALPOINT1(IM, x)                               \
     975{                                                       \
     976   GLuint count = IM->Count++;                          \
     977   IM->Flag[count] |= VERT_EVAL_P1;                     \
     978   ASSIGN_4V(IM->Obj[count], x, 0, 0, 1);               \
     979   if (count == VB_MAX-1)                               \
     980      IM->maybe_transform_vb( IM );                     \
     981}
     982
     983#define EVALPOINT2(IM, x, y)                            \
     984{                                                       \
     985   GLuint count = IM->Count++;                          \
     986   IM->Flag[count] |= VERT_EVAL_P2;                     \
     987   ASSIGN_4V(IM->Obj[count], x, y, 0, 1);               \
     988   if (count == VB_MAX-1)                               \
     989      IM->maybe_transform_vb( IM );                     \
    986990}
    987991
     
    11731177      case GL_FOG_END:
    11741178      case GL_FOG_INDEX:
    1175         p[0] = (GLfloat) *params;
    1176         break;
     1179        p[0] = (GLfloat) *params;
     1180        break;
    11771181      case GL_FOG_COLOR:
    1178         p[0] = INT_TO_FLOAT( params[0] );
    1179         p[1] = INT_TO_FLOAT( params[1] );
    1180         p[2] = INT_TO_FLOAT( params[2] );
    1181         p[3] = INT_TO_FLOAT( params[3] );
    1182         break;
     1182        p[0] = INT_TO_FLOAT( params[0] );
     1183        p[1] = INT_TO_FLOAT( params[1] );
     1184        p[2] = INT_TO_FLOAT( params[2] );
     1185        p[3] = INT_TO_FLOAT( params[3] );
     1186        break;
    11831187      default:
    11841188         /* Error will be caught later in gl_Fogfv */
     
    14771481
    14781482
    1479 #define INDEX( c )                              \
    1480 {                                               \
    1481    GLuint count;                                \
    1482    GET_IMMEDIATE;                               \
    1483    count = IM->Count;                           \
    1484    IM->Index[count] = c;                        \
    1485    IM->Flag[count] |= VERT_INDEX;               \
     1483#define INDEX( c )                              \
     1484{                                               \
     1485   GLuint count;                                \
     1486   GET_IMMEDIATE;                               \
     1487   count = IM->Count;                           \
     1488   IM->Index[count] = c;                        \
     1489   IM->Flag[count] |= VERT_INDEX;               \
    14861490}
    14871491
     
    17401744
    17411745   for (i=0;i<16;i++) {
    1742           fm[i] = (GLfloat) m[i];
     1746          fm[i] = (GLfloat) m[i];
    17431747   }
    17441748
     
    19461950
    19471951   for (i=0;i<16;i++) {
    1948           fm[i] = (GLfloat) m[i];
     1952          fm[i] = (GLfloat) m[i];
    19491953   }
    19501954
     
    19741978 *     (ie shared) normals.
    19751979 */
    1976 #define NORMAL( x,y,z )                         \
    1977 {                                               \
    1978    GLuint count;                                \
    1979    GLfloat *normal;                             \
    1980    GET_IMMEDIATE;                               \
    1981    count = IM->Count;                           \
    1982    IM->Flag[count] |= VERT_NORM;                \
    1983    normal = IM->Normal[count];                  \
    1984    ASSIGN_3V(normal, x,y,z);                    \
     1980#define NORMAL( x,y,z )                         \
     1981{                                               \
     1982   GLuint count;                                \
     1983   GLfloat *normal;                             \
     1984   GET_IMMEDIATE;                               \
     1985   count = IM->Count;                           \
     1986   IM->Flag[count] |= VERT_NORM;                \
     1987   normal = IM->Normal[count];                  \
     1988   ASSIGN_3V(normal, x,y,z);                    \
    19851989}
    19861990
     
    19891993{
    19901994   NORMAL( BYTE_TO_FLOAT(nx),
    1991            BYTE_TO_FLOAT(ny),
    1992            BYTE_TO_FLOAT(nz) );
     1995           BYTE_TO_FLOAT(ny),
     1996           BYTE_TO_FLOAT(nz) );
    19931997}
    19941998
     
    20092013{
    20102014   NORMAL( INT_TO_FLOAT(nx),
    2011            INT_TO_FLOAT(ny),
    2012            INT_TO_FLOAT(nz) );
     2015           INT_TO_FLOAT(ny),
     2016           INT_TO_FLOAT(nz) );
    20132017}
    20142018
     
    20172021{
    20182022   NORMAL( SHORT_TO_FLOAT(nx),
    2019            SHORT_TO_FLOAT(ny),
    2020            SHORT_TO_FLOAT(nz) );
     2023           SHORT_TO_FLOAT(ny),
     2024           SHORT_TO_FLOAT(nz) );
    20212025}
    20222026
     
    20252029{
    20262030   NORMAL( BYTE_TO_FLOAT(v[0]),
    2027            BYTE_TO_FLOAT(v[1]),
    2028            BYTE_TO_FLOAT(v[2]) );
     2031           BYTE_TO_FLOAT(v[1]),
     2032           BYTE_TO_FLOAT(v[2]) );
    20292033}
    20302034
     
    20452049{
    20462050   NORMAL( INT_TO_FLOAT(v[0]),
    2047            INT_TO_FLOAT(v[1]),
    2048            INT_TO_FLOAT(v[2]) );
     2051           INT_TO_FLOAT(v[1]),
     2052           INT_TO_FLOAT(v[2]) );
    20492053}
    20502054
     
    20532057{
    20542058   NORMAL( SHORT_TO_FLOAT(v[0]),
    2055            SHORT_TO_FLOAT(v[1]),
    2056            SHORT_TO_FLOAT(v[2]) );
    2057 }
    2058 
     2059           SHORT_TO_FLOAT(v[1]),
     2060           SHORT_TO_FLOAT(v[2]) );
     2061}
     2062
Note: See TracChangeset for help on using the changeset viewer.