Changeset 3079 for trunk/src/opengl/mesa
- Timestamp:
- Mar 11, 2000, 10:05:07 AM (26 years ago)
- 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 sandervlExp $ */1 /* $Id: glu.h,v 1.3 2000-03-11 09:05:07 jeroen Exp $ */ 2 2 3 3 /* … … 38 38 #include "GL/gl.h" 39 39 40 /* to facilitate clean DLL building ... */40 /* to facilitate clean DLL building ... */ 41 41 #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 extern48 # 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 */ 49 49 #else 50 # define GLUAPI extern50 # define GLUAPI extern 51 51 #endif /* WIN32 / CYGWIN32 bracket */ 52 52 53 53 #ifdef macintosh 54 #pragma enumsalwaysint on55 #if PRAGMA_IMPORT_SUPPORTED56 #pragma import on57 #endif54 #pragma enumsalwaysint on 55 #if PRAGMA_IMPORT_SUPPORTED 56 #pragma import on 57 #endif 58 58 #endif 59 59 … … 71 71 72 72 73 #define GLU_VERSION_1_1 174 #define GLU_VERSION_1_2 173 #define GLU_VERSION_1_1 1 74 #define GLU_VERSION_1_2 1 75 75 76 76 … … 82 82 83 83 enum { 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, /* */ 135 135 136 136 GLU_TESS_MISSING_BEGIN_POLYGON = GLU_TESS_ERROR1, … … 141 141 GLU_TESS_NEED_COMBINE_CALLBACK = GLU_TESS_ERROR6, 142 142 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, 182 182 GLU_NURBS_ERROR = GLU_ERROR, /* FIXME: is this correct?? */ 183 183 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, 227 227 GLU_INVALID_OPERATION = 100904, 228 228 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_FLAG229 /* 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 247 247 }; 248 248 … … 360 360 361 361 GLUAPI void GLAPIENTRY gluQuadricCallback( GLUquadricObj *qobj, 362 GLenum which, void (GLCALLBACK *fn)() ); 362 GLenum which, 363 void (GLCALLBACK *fn)() ); 363 364 364 365 GLUAPI void GLAPIENTRY gluCylinder( GLUquadricObj *qobj, … … 449 450 450 451 GLUAPI void GLAPIENTRY gluTessBeginPolygon( GLUtesselator *tobj, 451 void *polygon_data );452 void *polygon_data ); 452 453 453 454 GLUAPI void GLAPIENTRY gluTessBeginContour( GLUtesselator *tobj ); 454 455 455 456 GLUAPI void GLAPIENTRY gluTessVertex( GLUtesselator *tobj, GLdouble coords[3], 456 void *vertex_data );457 void *vertex_data ); 457 458 458 459 GLUAPI void GLAPIENTRY gluTessEndContour( GLUtesselator *tobj ); … … 461 462 462 463 GLUAPI void GLAPIENTRY gluTessProperty( GLUtesselator *tobj, GLenum which, 463 GLdouble value );464 GLdouble value ); 464 465 465 466 GLUAPI void GLAPIENTRY gluTessNormal( GLUtesselator *tobj, GLdouble x, 466 GLdouble y, GLdouble z );467 GLdouble y, GLdouble z ); 467 468 468 469 GLUAPI void GLAPIENTRY gluTessCallback( GLUtesselator *tobj, GLenum which, 469 void (GLCALLBACK *fn)() );470 void (GLCALLBACK *fn)() ); 470 471 471 472 GLUAPI void GLAPIENTRY gluGetTessProperty( GLUtesselator *tobj, GLenum which, 472 GLdouble *value );473 GLdouble *value ); 473 474 474 475 /* … … 502 503 503 504 #ifdef macintosh 504 #pragma enumsalwaysint reset505 #if PRAGMA_IMPORT_SUPPORTED506 #pragma import off507 #endif505 #pragma enumsalwaysint reset 506 #if PRAGMA_IMPORT_SUPPORTED 507 #pragma import off 508 #endif 508 509 #endif 509 510 -
trunk/src/opengl/mesa/api1.c
r2938 r3079 1 /* $Id: api1.c,v 1. 1 2000-02-29 00:49:57 sandervlExp $ */1 /* $Id: api1.c,v 1.2 2000-03-11 09:05:06 jeroen Exp $ */ 2 2 3 3 /* … … 54 54 #endif 55 55 56 #include <misc.h> 57 56 58 /* 57 59 * Part 1 of API functions … … 85 87 * function pointer. 86 88 */ 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 ); \ 97 99 } 98 100 … … 125 127 if (mode < GL_POINTS || mode > GL_POLYGON) { 126 128 gl_compile_error( CC, GL_INVALID_ENUM, "glBegin" ); 127 return; 129 return; 128 130 } 129 131 … … 251 253 * color-material and vertex arrays. 252 254 */ 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; \ 261 263 } 262 264 263 265 #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; \ 272 274 } 273 275 #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 ); \ 282 284 } 283 285 #endif … … 285 287 286 288 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); \ 292 294 } 293 295 … … 297 299 GET_IMMEDIATE; 298 300 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 ); 303 305 } 304 306 … … 339 341 GET_IMMEDIATE; 340 342 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); 344 346 } 345 347 … … 349 351 GET_IMMEDIATE; 350 352 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); 354 356 } 355 357 … … 366 368 GET_IMMEDIATE; 367 369 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 ); 371 373 } 372 374 … … 376 378 GET_IMMEDIATE; 377 379 COLOR( IM, USHORT_TO_UBYTE(red), USHORT_TO_UBYTE(green), 378 USHORT_TO_UBYTE(blue),379 255 );380 USHORT_TO_UBYTE(blue), 381 255 ); 380 382 } 381 383 … … 385 387 GET_IMMEDIATE; 386 388 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) ); 388 390 } 389 391 390 392 391 393 void GLAPIENTRY glColor4d(CTX_ARG GLdouble red, GLdouble green, GLdouble blue, 392 GLdouble alpha )394 GLdouble alpha ) 393 395 { 394 396 GLubyte col[4]; … … 426 428 GET_IMMEDIATE; 427 429 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) ); 429 431 } 430 432 … … 435 437 GET_IMMEDIATE; 436 438 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) ); 438 440 } 439 441 … … 450 452 GET_IMMEDIATE; 451 453 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) ); 453 455 } 454 456 … … 458 460 GET_IMMEDIATE; 459 461 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) ); 461 463 } 462 464 … … 466 468 GET_IMMEDIATE; 467 469 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 ); 469 471 } 470 472 … … 505 507 GET_IMMEDIATE; 506 508 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 ); 508 510 } 509 511 … … 513 515 GET_IMMEDIATE; 514 516 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 ); 516 518 } 517 519 … … 528 530 GET_IMMEDIATE; 529 531 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 ); 531 533 } 532 534 … … 536 538 GET_IMMEDIATE; 537 539 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 ); 539 541 540 542 } … … 545 547 GET_IMMEDIATE; 546 548 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]) ); 548 550 } 549 551 … … 585 587 GET_IMMEDIATE; 586 588 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]) ); 588 590 } 589 591 … … 593 595 GET_IMMEDIATE; 594 596 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]) ); 596 598 } 597 599 … … 608 610 GET_IMMEDIATE; 609 611 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]) ); 611 613 } 612 614 … … 616 618 GET_IMMEDIATE; 617 619 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]) ); 619 621 } 620 622 … … 833 835 state = IM->BeginState; 834 836 inflags = (~state) & (VERT_BEGIN_0|VERT_BEGIN_1); 835 state |= inflags << 2; /* errors */837 state |= inflags << 2; /* errors */ 836 838 837 839 if (MESA_VERBOSE&VERBOSE_API) { 838 840 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); 842 844 else 843 fprintf(stderr, ">");845 fprintf(stderr, ">"); 844 846 } 845 847 … … 857 859 858 860 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; 861 863 } 862 864 } … … 881 883 if (MESA_VERBOSE&VERBOSE_API) { 882 884 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); 886 888 else 887 fprintf(stderr, ">");889 fprintf(stderr, ">"); 888 890 } 889 891 890 state |= inflags << 2; /* errors */892 state |= inflags << 2; /* errors */ 891 893 892 894 if (inflags != (VERT_BEGIN_0|VERT_BEGIN_1)) … … 902 904 903 905 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; 906 908 } 907 909 } … … 950 952 951 953 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 ); \ 986 990 } 987 991 … … 1173 1177 case GL_FOG_END: 1174 1178 case GL_FOG_INDEX: 1175 p[0] = (GLfloat) *params;1176 break;1179 p[0] = (GLfloat) *params; 1180 break; 1177 1181 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; 1183 1187 default: 1184 1188 /* Error will be caught later in gl_Fogfv */ … … 1477 1481 1478 1482 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; \ 1486 1490 } 1487 1491 … … 1740 1744 1741 1745 for (i=0;i<16;i++) { 1742 fm[i] = (GLfloat) m[i];1746 fm[i] = (GLfloat) m[i]; 1743 1747 } 1744 1748 … … 1946 1950 1947 1951 for (i=0;i<16;i++) { 1948 fm[i] = (GLfloat) m[i];1952 fm[i] = (GLfloat) m[i]; 1949 1953 } 1950 1954 … … 1974 1978 * (ie shared) normals. 1975 1979 */ 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); \ 1985 1989 } 1986 1990 … … 1989 1993 { 1990 1994 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) ); 1993 1997 } 1994 1998 … … 2009 2013 { 2010 2014 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) ); 2013 2017 } 2014 2018 … … 2017 2021 { 2018 2022 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) ); 2021 2025 } 2022 2026 … … 2025 2029 { 2026 2030 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]) ); 2029 2033 } 2030 2034 … … 2045 2049 { 2046 2050 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]) ); 2049 2053 } 2050 2054 … … 2053 2057 { 2054 2058 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.
