Changeset 3597 for trunk/src/opengl
- Timestamp:
- May 23, 2000, 10:35:01 PM (25 years ago)
- Location:
- trunk/src/opengl/mesa
- Files:
-
- 6 added
- 45 edited
-
glthread.h (added)
-
hash.h (modified) (3 diffs)
-
hint.h (added)
-
image.h (modified) (5 diffs)
-
imaging.h (added)
-
interp_tmp.h (modified) (6 diffs)
-
light.h (modified) (3 diffs)
-
lines.h (modified) (2 diffs)
-
linetemp.h (modified) (33 diffs)
-
lnaatemp.h (modified) (10 diffs)
-
logic.h (modified) (2 diffs)
-
macros.h (modified) (14 diffs)
-
masking.h (modified) (2 diffs)
-
matrix.h (modified) (5 diffs)
-
mem.h (added)
-
mesa_extend.h (modified) (2 diffs)
-
mmath.h (modified) (11 diffs)
-
mmx.h (modified) (2 diffs)
-
norm_tmp.h (modified) (12 diffs)
-
os2thread.h (added)
-
pb.h (modified) (9 diffs)
-
pixel.h (modified) (2 diffs)
-
points.h (modified) (2 diffs)
-
polygon.h (modified) (2 diffs)
-
rastpos.h (modified) (2 diffs)
-
readpix.h (modified) (2 diffs)
-
rect.h (modified) (2 diffs)
-
render_tmp.h (modified) (18 diffs)
-
scissor.h (modified) (2 diffs)
-
shade_tmp.h (modified) (6 diffs)
-
span.h (modified) (4 diffs)
-
stages.h (modified) (2 diffs)
-
state.h (added)
-
stencil.h (modified) (2 diffs)
-
stereo.h (modified) (2 diffs)
-
teximage.h (modified) (2 diffs)
-
texobj.h (modified) (2 diffs)
-
texstate.h (modified) (3 diffs)
-
trans_tmp.h (modified) (12 diffs)
-
tritemp.h (modified) (33 diffs)
-
types.h (modified) (48 diffs)
-
varray.h (modified) (2 diffs)
-
vb.h (modified) (12 diffs)
-
vbfill.h (modified) (2 diffs)
-
vector.h (modified) (10 diffs)
-
vertices.h (modified) (5 diffs)
-
winpos.h (modified) (2 diffs)
-
wmesadef.h (modified) (9 diffs)
-
xform.h (modified) (8 diffs)
-
xform_tmp.h (modified) (38 diffs)
-
zoom.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/opengl/mesa/hash.h
r2938 r3597 1 /* $Id: hash.h,v 1. 1 2000-02-29 00:48:31 sandervlExp $ */1 /* $Id: hash.h,v 1.2 2000-05-23 20:34:51 jeroen Exp $ */ 2 2 3 3 /* 4 4 * Mesa 3-D graphics library 5 * Version: 3. 15 * Version: 3.3 6 6 * 7 7 * Copyright (C) 1999 Brian Paul All Rights Reserved. … … 26 26 27 27 28 29 30 31 28 #ifndef HASH_H 32 29 #define HASH_H 33 30 34 31 35 #include "gl .h"32 #include "glheader.h" 36 33 37 34 … … 40 37 41 38 42 extern struct HashTable *NewHashTable(void);39 extern struct _mesa_HashTable *_mesa_NewHashTable(void); 43 40 44 extern void DeleteHashTable(structHashTable *table);41 extern void _mesa_DeleteHashTable(struct _mesa_HashTable *table); 45 42 46 extern void * HashLookup(const structHashTable *table, GLuint key);43 extern void *_mesa_HashLookup(const struct _mesa_HashTable *table, GLuint key); 47 44 48 extern void HashInsert(structHashTable *table, GLuint key, void *data);45 extern void _mesa_HashInsert(struct _mesa_HashTable *table, GLuint key, void *data); 49 46 50 extern void HashRemove(structHashTable *table, GLuint key);47 extern void _mesa_HashRemove(struct _mesa_HashTable *table, GLuint key); 51 48 52 extern GLuint HashFirstEntry(const structHashTable *table);49 extern GLuint _mesa_HashFirstEntry(struct _mesa_HashTable *table); 53 50 54 extern void HashPrint(const structHashTable *table);51 extern void _mesa_HashPrint(const struct _mesa_HashTable *table); 55 52 56 extern GLuint HashFindFreeKeyBlock(const structHashTable *table, GLuint numKeys);53 extern GLuint _mesa_HashFindFreeKeyBlock(struct _mesa_HashTable *table, GLuint numKeys); 57 54 58 55 -
trunk/src/opengl/mesa/image.h
r2938 r3597 1 /* $Id: image.h,v 1. 1 2000-02-29 00:48:31 sandervlExp $ */1 /* $Id: image.h,v 1.2 2000-05-23 20:34:51 jeroen Exp $ */ 2 2 3 3 /* 4 4 * Mesa 3-D graphics library 5 * Version: 3. 15 * Version: 3.3 6 6 * 7 7 * Copyright (C) 1999 Brian Paul All Rights Reserved. … … 26 26 27 27 28 29 30 31 28 #ifndef IMAGE_H 32 29 #define IMAGE_H … … 36 33 37 34 38 extern void gl_flip_bytes( GLubyte *p, GLuint n );35 extern const struct gl_pixelstore_attrib _mesa_native_packing; 39 36 40 37 41 extern void gl_swap2( GLushort *p, GLuint n ); 38 extern void 39 _mesa_swap2( GLushort *p, GLuint n ); 42 40 43 extern void gl_swap4( GLuint *p, GLuint n ); 41 extern void 42 _mesa_swap4( GLuint *p, GLuint n ); 44 43 44 extern GLint 45 _mesa_sizeof_type( GLenum type ); 45 46 46 extern GLint gl_sizeof_type( GLenum type ); 47 extern GLint 48 _mesa_sizeof_packed_type( GLenum type ); 47 49 48 extern GLint gl_sizeof_packed_type( GLenum type ); 50 extern GLint 51 _mesa_components_in_format( GLenum format ); 49 52 50 extern GLint gl_components_in_format( GLenum format ); 53 extern GLint 54 _mesa_bytes_per_pixel( GLenum format, GLenum type ); 51 55 52 extern GLint gl_bytes_per_pixel( GLenum format, GLenum type ); 53 54 extern GLboolean gl_is_legal_format_and_type( GLenum format, GLenum type ); 56 extern GLboolean 57 _mesa_is_legal_format_and_type( GLenum format, GLenum type ); 55 58 56 59 57 60 extern GLvoid * 58 gl_pixel_addr_in_image( const struct gl_pixelstore_attrib *packing,59 const GLvoid *image, GLsizei width,60 GLsizei height, GLenum format, GLenum type,61 GLint img, GLint row, GLint column );61 _mesa_image_address( const struct gl_pixelstore_attrib *packing, 62 const GLvoid *image, GLsizei width, 63 GLsizei height, GLenum format, GLenum type, 64 GLint img, GLint row, GLint column ); 62 65 63 66 64 extern struct gl_image * 65 gl_unpack_bitmap( GLcontext *ctx, GLsizei width, GLsizei height, 66 const GLubyte *bitmap, 67 const struct gl_pixelstore_attrib *packing ); 68 69 70 extern void gl_unpack_polygon_stipple( const GLcontext *ctx, 71 const GLubyte *pattern, 72 GLuint dest[32] ); 73 74 75 extern void gl_pack_polygon_stipple( const GLcontext *ctx, 76 const GLuint pattern[32], 77 GLubyte *dest ); 78 79 80 extern struct gl_image * 81 gl_unpack_image( GLcontext *ctx, GLint width, GLint height, 82 GLenum srcFormat, GLenum srcType, const GLvoid *pixels, 83 const struct gl_pixelstore_attrib *packing ); 84 85 86 87 struct gl_image * 88 gl_unpack_image3D( GLcontext *ctx, GLint width, GLint height,GLint depth, 89 GLenum srcFormat, GLenum srcType, const GLvoid *pixels, 90 const struct gl_pixelstore_attrib *packing ); 67 extern GLint 68 _mesa_image_row_stride( const struct gl_pixelstore_attrib *packing, 69 GLint width, GLenum format, GLenum type ); 91 70 92 71 93 72 extern void 94 gl_pack_rgba_span( const GLcontext *ctx, 95 GLuint n, CONST GLubyte rgba[][4], 96 GLenum format, GLenum type, GLvoid *dest, 97 const struct gl_pixelstore_attrib *packing, 98 GLboolean applyTransferOps ); 73 _mesa_unpack_polygon_stipple( const GLubyte *pattern, GLuint dest[32], 74 const struct gl_pixelstore_attrib *unpacking ); 99 75 100 76 101 extern void gl_free_image( struct gl_image *image ); 77 extern void 78 _mesa_pack_polygon_stipple( const GLuint pattern[32], GLubyte *dest, 79 const struct gl_pixelstore_attrib *packing ); 102 80 103 81 104 extern GLboolean gl_image_error_test( GLcontext *ctx, 105 const struct gl_image *image, 106 const char *msg ); 107 108 109 /* 110 * New (3.3) functions 111 */ 82 extern void 83 _mesa_pack_rgba_span( const GLcontext *ctx, 84 GLuint n, CONST GLubyte rgba[][4], 85 GLenum format, GLenum type, GLvoid *dest, 86 const struct gl_pixelstore_attrib *packing, 87 GLboolean applyTransferOps ); 112 88 113 89 … … 128 104 GLboolean applyTransferOps ); 129 105 106 107 extern void 108 _mesa_unpack_stencil_span( const GLcontext *ctx, GLuint n, 109 GLenum dstType, GLvoid *dest, 110 GLenum srcType, const GLvoid *source, 111 const struct gl_pixelstore_attrib *unpacking, 112 GLboolean applyTransferOps ); 113 114 115 extern void 116 _mesa_unpack_depth_span( const GLcontext *ctx, GLuint n, GLdepth *dest, 117 GLenum srcType, const GLvoid *source, 118 const struct gl_pixelstore_attrib *unpacking, 119 GLboolean applyTransferOps ); 120 121 130 122 extern void * 131 123 _mesa_unpack_image( GLsizei width, GLsizei height, GLsizei depth, … … 134 126 135 127 128 extern GLvoid * 129 _mesa_unpack_bitmap( GLint width, GLint height, const GLubyte *pixels, 130 const struct gl_pixelstore_attrib *packing ); 131 132 extern void 133 _mesa_pack_bitmap( GLint width, GLint height, const GLubyte *source, 134 GLubyte *dest, const struct gl_pixelstore_attrib *packing ); 135 136 136 137 #endif -
trunk/src/opengl/mesa/interp_tmp.h
r2938 r3597 1 /* $Id: interp_tmp.h,v 1. 1 2000-02-29 00:48:32 sandervlExp $ */1 /* $Id: interp_tmp.h,v 1.2 2000-05-23 20:34:51 jeroen Exp $ */ 2 2 3 3 /* … … 25 25 */ 26 26 27 #define INTERP_UBYTE( out, t, a, b ) { \ 28 GLfloat fa = UBYTE_COLOR_TO_FLOAT_COLOR(a); \ 29 GLfloat fb = UBYTE_COLOR_TO_FLOAT_COLOR(b); \ 30 GLfloat fo = LINTERP(t, fa, fb); \ 31 FLOAT_COLOR_TO_UBYTE_COLOR(out, fo); \ 32 } 33 34 #if 1 35 36 #define INTERP_RGBA(nr, t, out, a, b) { \ 37 int i; \ 38 for (i = 0; i < nr; i++) { \ 39 GLfloat fa = UBYTE_COLOR_TO_FLOAT_COLOR(a[i]); \ 40 GLfloat fb = UBYTE_COLOR_TO_FLOAT_COLOR(b[i]); \ 41 GLfloat fo = LINTERP(t, fa, fb); \ 42 FLOAT_COLOR_TO_UBYTE_COLOR(out[i], fo); \ 43 } \ 44 } 45 #else 46 47 #define INTERP_RGBA(nr, t, out, a, b) { \ 48 int n; \ 49 const GLuint ti = FloatToInt(t*256.0F); \ 50 const GLubyte *Ib = (const GLubyte *)&a[0]; \ 51 const GLubyte *Jb = (const GLubyte *)&b[0]; \ 52 GLubyte *Ob = (GLubyte *)&out[0]; \ 53 \ 54 for (n = 0 ; n < nr ; n++) \ 55 Ob[n] = (GLubyte) (Ib[n] + ((ti * (Jb[n] - Ib[n]))/256)); \ 56 } 57 #endif 27 58 28 59 static void NAME( struct vertex_buffer *VB, 29 GLuint dst, GLfloat t, GLuint in, GLuint out )60 GLuint dst, GLfloat t, GLuint in, GLuint out ) 30 61 { 31 #if (IND & (CLIP_RGBA0|CLIP_FOG_COORD))32 GLfloat col[3][4];33 #endif34 35 62 (void) VB; 36 63 (void) dst; … … 40 67 41 68 #if (IND & CLIP_RGBA0) 42 UBYTE_RGBA_TO_FLOAT_RGBA(col[1], VB->Color[0]->data[in]);43 UBYTE_RGBA_TO_FLOAT_RGBA(col[2], VB->Color[0]->data[out]);44 INTERP_SZ( t, col, 0, 1, 2, 4 );45 FLOAT_RGBA_TO_UBYTE_RGBA(VB->Color[0]->data[dst], col[0]);69 INTERP_RGBA( 4, t, 70 VB->Color[0]->data[dst], 71 VB->Color[0]->data[in], 72 VB->Color[0]->data[out] ); 46 73 #endif 47 74 48 75 #if (IND & CLIP_RGBA1) 49 76 if (VB->ctx->TriangleCaps & DD_TRI_LIGHT_TWOSIDE) { 50 UBYTE_RGBA_TO_FLOAT_RGBA(col[1], VB->Color[1]->data[in]);51 UBYTE_RGBA_TO_FLOAT_RGBA(col[2], VB->Color[1]->data[out]);52 INTERP_SZ( t, col, 0, 1, 2, 4 );53 FLOAT_RGBA_TO_UBYTE_RGBA(VB->Color[1]->data[dst], col[0]);77 INTERP_RGBA( 4, t, 78 VB->Color[1]->data[dst], 79 VB->Color[1]->data[in], 80 VB->Color[1]->data[out] ); 54 81 } 55 82 56 83 if (VB->ctx->TriangleCaps & DD_SEPERATE_SPECULAR) 57 84 { 58 UBYTE_RGBA_TO_FLOAT_RGBA(col[1], VB->Spec[0][in]);59 UBYTE_RGBA_TO_FLOAT_RGBA(col[2], VB->Spec[0][out]);60 INTERP_SZ( t, col, 0, 1, 2, 3 );61 FLOAT_RGBA_TO_UBYTE_RGBA(VB->Spec[0][dst], col[0]);85 INTERP_RGBA( 3, t, 86 VB->Spec[0][dst], 87 VB->Spec[0][in], 88 VB->Spec[0][out] ); 62 89 63 90 if (VB->ctx->TriangleCaps & DD_TRI_LIGHT_TWOSIDE) { 64 UBYTE_RGBA_TO_FLOAT_RGBA(col[1], VB->Spec[1][in]); 65 UBYTE_RGBA_TO_FLOAT_RGBA(col[2], VB->Spec[1][out]); 66 INTERP_SZ( t, col, 0, 1, 2, 3 ); 67 FLOAT_RGBA_TO_UBYTE_RGBA(VB->Spec[1][dst], col[0]);91 INTERP_RGBA( 3, t, 92 VB->Spec[1][dst], 93 VB->Spec[1][in], 94 VB->Spec[1][out] ); 68 95 } 69 96 } … … 71 98 72 99 #if (IND & CLIP_FOG_COORD) 73 col[0][0] = UBYTE_COLOR_TO_FLOAT_COLOR( VB->Spec[0][in][3]);74 col[0][1] = UBYTE_COLOR_TO_FLOAT_COLOR( VB->Spec[0][out][3]);75 col[0][2] = LINTERP( t, col[0][0], col[0][1]);76 FLOAT_COLOR_TO_UBYTE_COLOR(VB->Spec[0][dst][3], col[0][2]);100 { 101 GLubyte a = VB->Spec[0][in][3], b = VB->Spec[0][out][3]; 102 INTERP_UBYTE( VB->Spec[0][dst][3], t, a, b ); 103 } 77 104 #endif 78 105 … … 81 108 VB->IndexPtr->data[dst] = (GLuint) (GLint) 82 109 LINTERP( t, 83 (GLfloat) VB->Index[0]->data[in],84 (GLfloat) VB->Index[0]->data[out] );110 (GLfloat) VB->Index[0]->data[in], 111 (GLfloat) VB->Index[0]->data[out] ); 85 112 #endif 86 113 … … 88 115 VB->Index[1]->data[dst] = (GLuint) (GLint) 89 116 LINTERP( t, 90 (GLfloat) VB->Index[1]->data[in],91 (GLfloat) VB->Index[1]->data[out] );117 (GLfloat) VB->Index[1]->data[in], 118 (GLfloat) VB->Index[1]->data[out] ); 92 119 #endif 93 120 94 121 #if (IND & CLIP_TEX0) 95 122 INTERP_SZ( t, 96 VB->TexCoordPtr[0]->data,97 dst, in, out,98 VB->TexCoordPtr[0]->size );123 VB->TexCoordPtr[0]->data, 124 dst, in, out, 125 VB->TexCoordPtr[0]->size ); 99 126 #endif 100 127 101 128 #if (IND & CLIP_TEX1) 102 129 INTERP_SZ( t, 103 VB->TexCoordPtr[1]->data,104 dst, in, out,105 VB->TexCoordPtr[1]->size );130 VB->TexCoordPtr[1]->data, 131 dst, in, out, 132 VB->TexCoordPtr[1]->size ); 106 133 #endif 107 134 } -
trunk/src/opengl/mesa/light.h
r2938 r3597 1 /* $Id: light.h,v 1. 1 2000-02-29 00:48:32 sandervlExp $ */1 /* $Id: light.h,v 1.2 2000-05-23 20:34:51 jeroen Exp $ */ 2 2 3 3 /* 4 4 * Mesa 3-D graphics library 5 * Version: 3. 15 * Version: 3.3 6 6 * 7 7 * Copyright (C) 1999 Brian Paul All Rights Reserved. … … 43 43 44 44 45 extern void gl_ShadeModel( GLcontext *ctx, GLenum mode ); 45 extern void 46 _mesa_ShadeModel( GLenum mode ); 46 47 47 extern void gl_ColorMaterial( GLcontext *ctx, GLenum face, GLenum mode ); 48 extern void 49 _mesa_ColorMaterial( GLenum face, GLenum mode ); 48 50 49 extern void gl_Lightfv( GLcontext *ctx, 50 GLenum light, GLenum pname, const GLfloat *params, 51 GLint nparams ); 51 extern void 52 _mesa_Lightf( GLenum light, GLenum pname, GLfloat param ); 52 53 53 extern void gl_LightModelfv( GLcontext *ctx, 54 GLenum pname, const GLfloat *params ); 54 extern void 55 _mesa_Lightfv( GLenum light, GLenum pname, const GLfloat *params ); 56 57 extern void 58 _mesa_Lightiv( GLenum light, GLenum pname, const GLint *params ); 59 60 extern void 61 _mesa_Lighti( GLenum light, GLenum pname, GLint param ); 62 63 extern void 64 _mesa_LightModelf( GLenum pname, GLfloat param ); 65 66 extern void 67 _mesa_LightModelfv( GLenum pname, const GLfloat *params ); 68 69 extern void 70 _mesa_LightModeli( GLenum pname, GLint param ); 71 72 extern void 73 _mesa_LightModeliv( GLenum pname, const GLint *params ); 74 75 extern void 76 _mesa_Materialf( GLenum face, GLenum pname, GLfloat param ); 77 78 extern void 79 _mesa_Materialfv( GLenum face, GLenum pname, const GLfloat *params ); 80 81 extern void 82 _mesa_Materiali( GLenum face, GLenum pname, GLint param ); 83 84 extern void 85 _mesa_Materialiv( GLenum face, GLenum pname, const GLint *params ); 86 87 extern void 88 _mesa_GetLightfv( GLenum light, GLenum pname, GLfloat *params ); 89 90 extern void 91 _mesa_GetLightiv( GLenum light, GLenum pname, GLint *params ); 92 93 extern void 94 _mesa_GetMaterialfv( GLenum face, GLenum pname, GLfloat *params ); 95 96 extern void 97 _mesa_GetMaterialiv( GLenum face, GLenum pname, GLint *params ); 98 55 99 56 100 57 101 extern GLuint gl_material_bitmask( GLcontext *ctx, 58 GLenum face, GLenum pname,59 GLuint legal,60 const char * );102 GLenum face, GLenum pname, 103 GLuint legal, 104 const char * ); 61 105 62 106 extern void gl_set_material( GLcontext *ctx, GLuint bitmask, 63 107 const GLfloat *params); 64 108 65 extern void gl_Materialfv( GLcontext *ctx,66 GLenum face, GLenum pname, const GLfloat *params );67 68 69 70 extern void gl_GetLightfv( GLcontext *ctx,71 GLenum light, GLenum pname, GLfloat *params );72 73 extern void gl_GetLightiv( GLcontext *ctx,74 GLenum light, GLenum pname, GLint *params );75 76 77 extern void gl_GetMaterialfv( GLcontext *ctx,78 GLenum face, GLenum pname, GLfloat *params );79 80 extern void gl_GetMaterialiv( GLcontext *ctx,81 GLenum face, GLenum pname, GLint *params );82 83 84 109 extern void gl_compute_spot_exp_table( struct gl_light *l ); 85 110 86 111 extern void gl_compute_shine_table( GLcontext *ctx, GLuint i, 87 GLfloat shininess );112 GLfloat shininess ); 88 113 89 114 extern void gl_update_lighting( GLcontext *ctx ); … … 94 119 95 120 extern void gl_update_material( GLcontext *ctx, 96 struct gl_material *m,97 GLuint bitmask );121 struct gl_material *m, 122 GLuint bitmask ); 98 123 99 124 extern void gl_update_color_material( GLcontext *ctx, const GLubyte rgba[4] ); 100 125 101 126 127 128 102 129 #endif 103 130 -
trunk/src/opengl/mesa/lines.h
r2938 r3597 1 /* $Id: lines.h,v 1. 1 2000-02-29 00:48:32 sandervlExp $ */1 /* $Id: lines.h,v 1.2 2000-05-23 20:34:52 jeroen Exp $ */ 2 2 3 3 /* 4 4 * Mesa 3-D graphics library 5 * Version: 3. 15 * Version: 3.3 6 6 * 7 7 * Copyright (C) 1999 Brian Paul All Rights Reserved. … … 36 36 37 37 38 extern void gl_LineWidth( GLcontext *ctx, GLfloat width ); 38 extern void 39 _mesa_LineWidth( GLfloat width ); 39 40 40 extern void gl_LineStipple( GLcontext *ctx, GLint factor, GLushort pattern ); 41 extern void 42 _mesa_LineStipple( GLint factor, GLushort pattern ); 41 43 42 extern void gl_set_line_function( GLcontext *ctx ); 44 extern void 45 gl_set_line_function( GLcontext *ctx ); 43 46 44 47 -
trunk/src/opengl/mesa/linetemp.h
r2938 r3597 1 /* $Id: linetemp.h,v 1. 1 2000-02-29 00:48:32 sandervlExp $ */1 /* $Id: linetemp.h,v 1.2 2000-05-23 20:34:52 jeroen Exp $ */ 2 2 3 3 /* … … 53 53 * Y==0 at bottom of screen and increases upward. 54 54 * 55 * Similarly, for direct depth buffer access, this type is used for depth 56 * buffer addressing: 57 * DEPTH_TYPE - either GLushort or GLuint 58 * 55 59 * Optionally, one may provide one-time setup code 56 60 * SETUP_CODE - code which is to be executed once per line … … 82 86 GLint y1 = (GLint) VB->Win.data[vert1][1]; 83 87 GLint dx, dy; 84 #if INTERP_XY88 #ifdef INTERP_XY 85 89 GLint xstep, ystep; 86 90 #endif 87 #if INTERP_Z 88 GLint z0, z1, dz, zPtrXstep, zPtrYstep; 89 GLdepth *zPtr; 90 #endif 91 #if INTERP_RGB 91 #ifdef INTERP_Z 92 GLint z0, z1, dz; 93 const GLint depthBits = ctx->Visual->DepthBits; 94 const GLint fixedToDepthShift = depthBits <= 16 ? FIXED_SHIFT : 0; 95 # define FixedToDepth(F) ((F) >> fixedToDepthShift) 96 # ifdef DEPTH_TYPE 97 GLint zPtrXstep, zPtrYstep; 98 DEPTH_TYPE *zPtr; 99 # endif 100 #endif 101 #ifdef INTERP_RGB 92 102 GLfixed r0 = IntToFixed(VB->ColorPtr->data[vert0][0]); 93 103 GLfixed dr = IntToFixed(VB->ColorPtr->data[vert1][0]) - r0; … … 97 107 GLfixed db = IntToFixed(VB->ColorPtr->data[vert1][2]) - b0; 98 108 #endif 99 #if INTERP_SPEC109 #ifdef INTERP_SPEC 100 110 GLfixed sr0 = VB->Specular ? IntToFixed(VB->Specular[vert0][0]) : 0; 101 111 GLfixed dsr = VB->Specular ? IntToFixed(VB->Specular[vert1][0]) - sr0 : 0; … … 105 115 GLfixed dsb = VB->Specular ? IntToFixed(VB->Specular[vert1][2]) - sb0 : 0; 106 116 #endif 107 #if INTERP_ALPHA117 #ifdef INTERP_ALPHA 108 118 GLfixed a0 = IntToFixed(VB->ColorPtr->data[vert0][3]); 109 119 GLfixed da = IntToFixed(VB->ColorPtr->data[vert1][3]) - a0; 110 120 #endif 111 #if INTERP_INDEX121 #ifdef INTERP_INDEX 112 122 GLint i0 = VB->IndexPtr->data[vert0] << 8; 113 GLint di = (GLint) (VB->IndexPtr->data[vert1] << 8) -i0;114 #endif 115 #if INTERP_ST123 GLint di = (GLint) (VB->IndexPtr->data[vert1] << 8) - i0; 124 #endif 125 #ifdef INTERP_ST 116 126 GLfixed s0 = FloatToFixed(VB->TexCoord[vert0][0] * S_SCALE); 117 127 GLfixed ds = FloatToFixed(VB->TexCoord[vert1][0] * S_SCALE) - s0; … … 119 129 GLfixed dt = FloatToFixed(VB->TexCoord[vert1][1] * T_SCALE) - t0; 120 130 #endif 121 #if INTERP_STUV0 || INTERP_STUV1131 #if defined(INTERP_STUV0) || defined(INTERP_STUV1) 122 132 GLfloat invw0 = VB->Win.data[vert0][3]; 123 133 GLfloat invw1 = VB->Win.data[vert1][3]; 124 134 #endif 125 #if INTERP_STUV0135 #ifdef INTERP_STUV0 126 136 /* h denotes hyperbolic */ 127 137 GLfloat hs0 = invw0 * VB->TexCoordPtr[0]->data[vert0][0]; … … 132 142 GLfloat hv0 = invw0, dhv = invw1 - invw0; 133 143 #endif 134 #if INTERP_STUV1144 #ifdef INTERP_STUV1 135 145 GLfloat hs01 = invw0 * VB->TexCoordPtr[1]->data[vert0][0]; 136 146 GLfloat dhs1 = invw1 * VB->TexCoordPtr[1]->data[vert1][0] - hs01; … … 144 154 GLint pixelXstep, pixelYstep; 145 155 #endif 146 #if WIDE156 #ifdef WIDE 147 157 /* for wide lines, draw all X in [x+min, x+max] or Y in [y+min, y+max] */ 148 158 GLint width, min, max; … … 151 161 max = min + width - 1; 152 162 #endif 153 #if INTERP_STUV0163 #ifdef INTERP_STUV0 154 164 if (VB->TexCoordPtr[0]->size > 2) { 155 165 hu0 = invw0 * VB->TexCoordPtr[0]->data[vert0][2]; 156 166 dhu = invw1 * VB->TexCoordPtr[0]->data[vert1][2] - hu0; 157 167 if (VB->TexCoordPtr[0]->size > 3) { 158 hv0 = invw0 * VB->TexCoordPtr[0]->data[vert0][3];159 dhv = invw1 * VB->TexCoordPtr[0]->data[vert1][3] - hv0;160 } 161 } 162 #endif 163 #if INTERP_STUV1168 hv0 = invw0 * VB->TexCoordPtr[0]->data[vert0][3]; 169 dhv = invw1 * VB->TexCoordPtr[0]->data[vert1][3] - hv0; 170 } 171 } 172 #endif 173 #ifdef INTERP_STUV1 164 174 if (VB->TexCoordPtr[1]->size > 2) { 165 175 hu01 = invw0 * VB->TexCoordPtr[1]->data[vert0][2]; 166 176 dhu1 = invw1 * VB->TexCoordPtr[1]->data[vert1][2] - hu01; 167 177 if (VB->TexCoordPtr[1]->size > 3) { 168 hv01 = invw0 * VB->TexCoordPtr[1]->data[vert0][3];169 dhv1 = invw1 * VB->TexCoordPtr[1]->data[vert1][3] - hv01;178 hv01 = invw0 * VB->TexCoordPtr[1]->data[vert0][3]; 179 dhv1 = invw1 * VB->TexCoordPtr[1]->data[vert1][3] - hv01; 170 180 } 171 181 } … … 179 189 * necessary. 180 190 */ 181 #if CLIP_HACK191 #ifdef CLIP_HACK 182 192 { 183 GLint w = ctx-> Buffer->Width;184 GLint h = ctx-> Buffer->Height;193 GLint w = ctx->DrawBuffer->Width; 194 GLint h = ctx->DrawBuffer->Height; 185 195 if ((x0==w) | (x1==w)) { 186 196 if ((x0==w) & (x1==w)) … … 210 220 #endif 211 221 212 #if INTERP_Z 213 zPtr = Z_ADDRESS(ctx,x0,y0); 214 # if DEPTH_BITS==16 222 #ifdef INTERP_Z 223 # ifdef DEPTH_TYPE 224 zPtr = (DEPTH_TYPE *) _mesa_zbuffer_address(ctx, x0, y0); 225 # endif 226 if (depthBits <= 16) { 215 227 z0 = FloatToFixed(VB->Win.data[vert0][2]); 216 228 z1 = FloatToFixed(VB->Win.data[vert1][2]); 217 # else 229 } 230 else { 218 231 z0 = (int) VB->Win.data[vert0][2]; 219 232 z1 = (int) VB->Win.data[vert1][2]; 220 # endif 233 } 221 234 #endif 222 235 #ifdef PIXEL_ADDRESS … … 225 238 226 239 if (dx<0) { 227 dx = -dx; /* make positive*/228 #if INTERP_XY240 dx = -dx; /* make positive*/ 241 #ifdef INTERP_XY 229 242 xstep = -1; 230 243 #endif 231 #if def INTERP_Z232 zPtrXstep = -((GLint)sizeof( GLdepth));244 #if defined(INTERP_Z) && defined(DEPTH_TYPE) 245 zPtrXstep = -((GLint)sizeof(DEPTH_TYPE)); 233 246 #endif 234 247 #ifdef PIXEL_ADDRESS … … 237 250 } 238 251 else { 239 #if INTERP_XY252 #ifdef INTERP_XY 240 253 xstep = 1; 241 254 #endif 242 #if INTERP_Z243 zPtrXstep = ((GLint)sizeof( GLdepth));255 #if defined(INTERP_Z) && defined(DEPTH_TYPE) 256 zPtrXstep = ((GLint)sizeof(DEPTH_TYPE)); 244 257 #endif 245 258 #ifdef PIXEL_ADDRESS … … 249 262 250 263 if (dy<0) { 251 dy = -dy; /* make positive*/252 #if INTERP_XY264 dy = -dy; /* make positive*/ 265 #ifdef INTERP_XY 253 266 ystep = -1; 254 267 #endif 255 #if INTERP_Z256 zPtrYstep = -ctx-> Buffer->Width * ((GLint)sizeof(GLdepth));268 #if defined(INTERP_Z) && defined(DEPTH_TYPE) 269 zPtrYstep = -ctx->DrawBuffer->Width * ((GLint)sizeof(DEPTH_TYPE)); 257 270 #endif 258 271 #ifdef PIXEL_ADDRESS … … 261 274 } 262 275 else { 263 #if INTERP_XY276 #ifdef INTERP_XY 264 277 ystep = 1; 265 278 #endif 266 #if INTERP_Z267 zPtrYstep = ctx-> Buffer->Width * ((GLint)sizeof(GLdepth));279 #if defined(INTERP_Z) && defined(DEPTH_TYPE) 280 zPtrYstep = ctx->DrawBuffer->Width * ((GLint)sizeof(DEPTH_TYPE)); 268 281 #endif 269 282 #ifdef PIXEL_ADDRESS … … 282 295 GLint error = errorInc-dx; 283 296 GLint errorDec = error-dx; 284 #if INTERP_Z297 #ifdef INTERP_Z 285 298 dz = (z1-z0) / dx; 286 299 #endif 287 #if INTERP_RGB288 dr /= dx; /* convert from whole line delta to per-pixel delta*/300 #ifdef INTERP_RGB 301 dr /= dx; /* convert from whole line delta to per-pixel delta*/ 289 302 dg /= dx; 290 303 db /= dx; 291 304 #endif 292 #if INTERP_SPEC293 dsr /= dx; /* convert from whole line delta to per-pixel delta*/305 #ifdef INTERP_SPEC 306 dsr /= dx; /* convert from whole line delta to per-pixel delta*/ 294 307 dsg /= dx; 295 308 dsb /= dx; 296 309 #endif 297 #if INTERP_ALPHA310 #ifdef INTERP_ALPHA 298 311 da /= dx; 299 312 #endif 300 #if INTERP_INDEX313 #ifdef INTERP_INDEX 301 314 di /= dx; 302 315 #endif 303 #if INTERP_ST316 #ifdef INTERP_ST 304 317 ds /= dx; 305 318 dt /= dx; 306 319 #endif 307 #if INTERP_STUV0320 #ifdef INTERP_STUV0 308 321 { 309 322 GLfloat invDx = 1.0F / (GLfloat) dx; … … 314 327 } 315 328 #endif 316 #if INTERP_STUV1329 #ifdef INTERP_STUV1 317 330 { 318 331 GLfloat invDx = 1.0F / (GLfloat) dx; … … 324 337 #endif 325 338 for (i=0;i<dx;i++) { 326 #if STIPPLE339 #ifdef STIPPLE 327 340 GLushort m; 328 341 m = 1 << ((ctx->StippleCounter/ctx->Line.StippleFactor) & 0xf); 329 342 if (ctx->Line.StipplePattern & m) { 330 343 #endif 331 #if INTERP_Z 332 # if DEPTH_BITS==16 333 GLdepth Z = FixedToInt(z0); 334 # else 335 GLdepth Z = z0; 336 # endif 337 #endif 338 #if INTERP_INDEX 344 #ifdef INTERP_Z 345 GLdepth Z = FixedToDepth(z0); 346 #endif 347 #ifdef INTERP_INDEX 339 348 GLint I = i0 >> 8; 340 349 #endif 341 #if INTERP_STUV0350 #ifdef INTERP_STUV0 342 351 GLfloat invQ = 1.0F / hv0; 343 352 GLfloat s = hs0 * invQ; … … 345 354 GLfloat u = hu0 * invQ; 346 355 #endif 347 #if INTERP_STUV1356 #ifdef INTERP_STUV1 348 357 GLfloat invQ1 = 1.0F / hv01; 349 358 GLfloat s1 = hs01 * invQ1; … … 351 360 GLfloat u1 = hu01 * invQ1; 352 361 #endif 353 #if WIDE362 #ifdef WIDE 354 363 GLint yy; 355 364 GLint ymin = y0 + min; … … 364 373 PLOT( x0, y0 ); 365 374 # endif 366 #endif /*WIDE*/367 #if STIPPLE375 #endif /* WIDE */ 376 #ifdef STIPPLE 368 377 } 369 ctx->StippleCounter++;370 #endif 371 #if INTERP_XY378 ctx->StippleCounter++; 379 #endif 380 #ifdef INTERP_XY 372 381 x0 += xstep; 373 382 #endif 374 #if INTERP_Z 375 zPtr = (GLdepth *) ((GLubyte*) zPtr + zPtrXstep); 383 #ifdef INTERP_Z 384 # ifdef DEPTH_TYPE 385 zPtr = (DEPTH_TYPE *) ((GLubyte*) zPtr + zPtrXstep); 386 # endif 376 387 z0 += dz; 377 388 #endif 378 #if INTERP_RGB389 #ifdef INTERP_RGB 379 390 r0 += dr; 380 391 g0 += dg; 381 392 b0 += db; 382 393 #endif 383 #if INTERP_SPEC394 #ifdef INTERP_SPEC 384 395 sr0 += dsr; 385 396 sg0 += dsg; 386 397 sb0 += dsb; 387 398 #endif 388 #if INTERP_ALPHA399 #ifdef INTERP_ALPHA 389 400 a0 += da; 390 401 #endif 391 #if INTERP_INDEX402 #ifdef INTERP_INDEX 392 403 i0 += di; 393 404 #endif 394 #if INTERP_ST405 #ifdef INTERP_ST 395 406 s0 += ds; 396 407 t0 += dt; 397 408 #endif 398 #if INTERP_STUV0409 #ifdef INTERP_STUV0 399 410 hs0 += dhs; 400 411 ht0 += dht; … … 402 413 hv0 += dhv; 403 414 #endif 404 #if INTERP_STUV1415 #ifdef INTERP_STUV1 405 416 hs01 += dhs1; 406 417 ht01 += dht1; … … 416 427 else { 417 428 error += errorDec; 418 #if INTERP_XY429 #ifdef INTERP_XY 419 430 y0 += ystep; 420 431 #endif 421 #if INTERP_Z422 zPtr = ( GLdepth*) ((GLubyte*) zPtr + zPtrYstep);432 #if defined(INTERP_Z) && defined(DEPTH_TYPE) 433 zPtr = (DEPTH_TYPE *) ((GLubyte*) zPtr + zPtrYstep); 423 434 #endif 424 435 #ifdef PIXEL_ADDRESS … … 434 445 GLint error = errorInc-dy; 435 446 GLint errorDec = error-dy; 436 #if INTERP_Z447 #ifdef INTERP_Z 437 448 dz = (z1-z0) / dy; 438 449 #endif 439 #if INTERP_RGB440 dr /= dy; /* convert from whole line delta to per-pixel delta*/450 #ifdef INTERP_RGB 451 dr /= dy; /* convert from whole line delta to per-pixel delta*/ 441 452 dg /= dy; 442 453 db /= dy; 443 454 #endif 444 #if INTERP_SPEC445 dsr /= dy; /* convert from whole line delta to per-pixel delta*/455 #ifdef INTERP_SPEC 456 dsr /= dy; /* convert from whole line delta to per-pixel delta*/ 446 457 dsg /= dy; 447 458 dsb /= dy; 448 459 #endif 449 #if INTERP_ALPHA460 #ifdef INTERP_ALPHA 450 461 da /= dy; 451 462 #endif 452 #if INTERP_INDEX463 #ifdef INTERP_INDEX 453 464 di /= dy; 454 465 #endif 455 #if INTERP_ST466 #ifdef INTERP_ST 456 467 ds /= dy; 457 468 dt /= dy; 458 469 #endif 459 #if INTERP_STUV0470 #ifdef INTERP_STUV0 460 471 { 461 472 GLfloat invDy = 1.0F / (GLfloat) dy; … … 466 477 } 467 478 #endif 468 #if INTERP_STUV1479 #ifdef INTERP_STUV1 469 480 { 470 481 GLfloat invDy = 1.0F / (GLfloat) dy; … … 476 487 #endif 477 488 for (i=0;i<dy;i++) { 478 #if STIPPLE489 #ifdef STIPPLE 479 490 GLushort m; 480 491 m = 1 << ((ctx->StippleCounter/ctx->Line.StippleFactor) & 0xf); 481 492 if (ctx->Line.StipplePattern & m) { 482 493 #endif 483 #if INTERP_Z 484 # if DEPTH_BITS==16 485 GLdepth Z = FixedToInt(z0); 486 # else 487 GLdepth Z = z0; 488 # endif 489 #endif 490 #if INTERP_INDEX 494 #ifdef INTERP_Z 495 GLdepth Z = FixedToDepth(z0); 496 #endif 497 #ifdef INTERP_INDEX 491 498 GLint I = i0 >> 8; 492 499 #endif 493 #if INTERP_STUV0500 #ifdef INTERP_STUV0 494 501 GLfloat invQ = 1.0F / hv0; 495 502 GLfloat s = hs0 * invQ; … … 497 504 GLfloat u = hu0 * invQ; 498 505 #endif 499 #if INTERP_STUV1506 #ifdef INTERP_STUV1 500 507 GLfloat invQ1 = 1.0F / hv01; 501 508 GLfloat s1 = hs01 * invQ1; … … 503 510 GLfloat u1 = hu01 * invQ1; 504 511 #endif 505 #if WIDE512 #ifdef WIDE 506 513 GLint xx; 507 514 GLint xmin = x0 + min; … … 516 523 PLOT( x0, y0 ); 517 524 # endif 518 #endif /*WIDE*/519 #if STIPPLE525 #endif /* WIDE */ 526 #ifdef STIPPLE 520 527 } 521 ctx->StippleCounter++;522 #endif 523 #if INTERP_XY528 ctx->StippleCounter++; 529 #endif 530 #ifdef INTERP_XY 524 531 y0 += ystep; 525 532 #endif 526 #if INTERP_Z 527 zPtr = (GLdepth *) ((GLubyte*) zPtr + zPtrYstep); 533 #ifdef INTERP_Z 534 # ifdef DEPTH_TYPE 535 zPtr = (DEPTH_TYPE *) ((GLubyte*) zPtr + zPtrYstep); 536 # endif 528 537 z0 += dz; 529 538 #endif 530 #if INTERP_RGB539 #ifdef INTERP_RGB 531 540 r0 += dr; 532 541 g0 += dg; 533 542 b0 += db; 534 543 #endif 535 #if INTERP_SPEC544 #ifdef INTERP_SPEC 536 545 sr0 += dsr; 537 546 sg0 += dsg; 538 547 sb0 += dsb; 539 548 #endif 540 #if INTERP_ALPHA549 #ifdef INTERP_ALPHA 541 550 a0 += da; 542 551 #endif 543 #if INTERP_INDEX552 #ifdef INTERP_INDEX 544 553 i0 += di; 545 554 #endif 546 #if INTERP_ST555 #ifdef INTERP_ST 547 556 s0 += ds; 548 557 t0 += dt; 549 558 #endif 550 #if INTERP_STUV0559 #ifdef INTERP_STUV0 551 560 hs0 += dhs; 552 561 ht0 += dht; … … 554 563 hv0 += dhv; 555 564 #endif 556 #if INTERP_STUV1565 #ifdef INTERP_STUV1 557 566 hs01 += dhs1; 558 567 ht01 += dht1; … … 568 577 else { 569 578 error += errorDec; 570 #if INTERP_XY579 #ifdef INTERP_XY 571 580 x0 += xstep; 572 581 #endif 573 #if INTERP_Z574 zPtr = ( GLdepth*) ((GLubyte*) zPtr + zPtrXstep);582 #if defined(INTERP_Z) && defined(DEPTH_TYPE) 583 zPtr = (DEPTH_TYPE *) ((GLubyte*) zPtr + zPtrXstep); 575 584 #endif 576 585 #ifdef PIXEL_ADDRESS … … 594 603 #undef PIXEL_ADDRESS 595 604 #undef PIXEL_TYPE 605 #undef DEPTH_TYPE 596 606 #undef BYTES_PER_ROW 597 607 #undef SETUP_CODE … … 602 612 #undef STIPPLE 603 613 #undef WIDE 614 #undef FixedToDepth -
trunk/src/opengl/mesa/lnaatemp.h
r2938 r3597 1 /* $Id: lnaatemp.h,v 1. 1 2000-02-29 00:48:32 sandervlExp $ */1 /* $Id: lnaatemp.h,v 1.2 2000-05-23 20:34:52 jeroen Exp $ */ 2 2 3 3 /* … … 53 53 const struct vertex_buffer *VB = ctx->VB; 54 54 struct pixel_buffer *pb = ctx->PB; 55 GLfloat halfWidth = 0.5F * ctx->Line.Width; /* 0.5 is a bit of a hack*/55 GLfloat halfWidth = 0.5F * ctx->Line.Width; /* 0.5 is a bit of a hack */ 56 56 GLboolean solid = !ctx->Line.StippleFlag; 57 57 GLint x0 = (GLint) VB->Win.data[vert0][0]; … … 63 63 GLint xStep, yStep; 64 64 GLint z0, z1; 65 const GLint depthBits = ctx->Visual->DepthBits; 66 const GLint fixedToDepthShift = depthBits <= 16 ? FIXED_SHIFT : 0; 67 #define FixedToDepth(F) ((F) >> fixedToDepthShift) 65 68 #if INTERP_RGBA 66 69 GLfixed fr, fg, fb, fa; /* fixed-pt RGBA */ … … 99 102 return; 100 103 101 #if DEPTH_BITS==16 102 z0 = FloatToFixed(VB->Win.data[vert0][2]); 103 z1 = FloatToFixed(VB->Win.data[vert1][2]); 104 #else 105 z0 = (int) VB->Win.data[vert0][2]; 106 z1 = (int) VB->Win.data[vert1][2]; 107 #endif 104 if (depthBits <= 16) { 105 z0 = FloatToFixed(VB->Win.data[vert0][2]); 106 z1 = FloatToFixed(VB->Win.data[vert1][2]); 107 } 108 else { 109 z0 = (int) VB->Win.data[vert0][2]; 110 z1 = (int) VB->Win.data[vert1][2]; 111 } 108 112 109 113 #if INTERP_STUV0 … … 195 199 GLint x = x0; 196 200 GLfloat y = VB->Win.data[vert0][1]; 197 GLfloat yStep = (VB->Win.data[vert1][1] - y) / (GLfloat) dx; 198 GLint dz = (z1 - z0) / dx; 199 GLfloat invDx = 1.0F / dx; 200 (void) invDx; 201 const GLfloat invDx = 1.0F / dx; 202 GLfloat yStep = (VB->Win.data[vert1][1] - y) * invDx; 203 GLint dz = (GLint) ((z1 - z0) * invDx); 201 204 #if INTERP_RGBA 202 205 if (ctx->Light.ShadeModel == GL_SMOOTH) { … … 226 229 dhv1 *= invDx; 227 230 #endif 231 #if INTERP_INDEX 232 if (ctx->Light.ShadeModel == GL_SMOOTH) { 233 dfi = (IntToFixed(VB->IndexPtr->data[vert1]) - fi) * invDx; 234 } 235 #endif 236 228 237 for (i = 0; i < dx; i++) { 229 238 if (solid || (ctx->Line.StipplePattern & (1 << ((ctx->StippleCounter/ctx->Line.StippleFactor) & 0xf)))) { … … 250 259 GLuint coverage; 251 260 #endif 252 #if DEPTH_BITS==16 253 GLdepth z = FixedToInt(z0); 254 #else 255 GLdepth z = z0; 256 #endif 261 GLdepth z = FixedToDepth(z0); 257 262 ASSERT(yBoti <= yTopi); 258 263 … … 345 350 GLint y = y0; 346 351 GLfloat x = VB->Win.data[vert0][0]; 347 GLfloat xStep = (VB->Win.data[vert1][0] - x) / (GLfloat) dy; 348 GLint dz = (z1 - z0) / dy; 349 GLfloat invDy = 1.0F / dy; 350 (void) invDy; 352 const GLfloat invDy = 1.0F / dy; 353 GLfloat xStep = (VB->Win.data[vert1][0] - x) * invDy; 354 GLint dz = (GLint) ((z1 - z0) * invDy); 351 355 #if INTERP_RGBA 352 356 if (ctx->Light.ShadeModel == GL_SMOOTH) { … … 378 382 #if INTERP_INDEX 379 383 if (ctx->Light.ShadeModel == GL_SMOOTH) { 380 dfi = (IntToFixed(VB->IndexPtr->data[vert1]) - fi) / dy;384 dfi = (IntToFixed(VB->IndexPtr->data[vert1]) - fi) * invDy; 381 385 } 382 386 #endif … … 404 408 GLuint coverage; 405 409 #endif 406 #if DEPTH_BITS==16 407 GLdepth z = FixedToInt(z0); 408 #else 409 GLdepth z = z0; 410 #endif 410 GLdepth z = FixedToDepth(z0); 411 411 412 412 ASSERT(xLefti < xRight); -
trunk/src/opengl/mesa/logic.h
r2938 r3597 1 /* $Id: logic.h,v 1. 1 2000-02-29 00:48:33 sandervlExp $ */1 /* $Id: logic.h,v 1.2 2000-05-23 20:34:52 jeroen Exp $ */ 2 2 3 3 /* 4 4 * Mesa 3-D graphics library 5 * Version: 3. 15 * Version: 3.3 6 6 * 7 7 * Copyright (C) 1999 Brian Paul All Rights Reserved. … … 36 36 37 37 38 extern void gl_LogicOp( GLcontext *ctx, GLenum opcode ); 38 extern void 39 _mesa_LogicOp( GLenum opcode ); 39 40 40 41 -
trunk/src/opengl/mesa/macros.h
r2938 r3597 1 /* $Id: macros.h,v 1. 1 2000-02-29 00:48:33 sandervlExp $ */1 /* $Id: macros.h,v 1.2 2000-05-23 20:34:52 jeroen Exp $ */ 2 2 3 3 /* 4 4 * Mesa 3-D graphics library 5 * Version: 3. 15 * Version: 3.3 6 6 * 7 7 * Copyright (C) 1999 Brian Paul All Rights Reserved. … … 25 25 */ 26 26 27 28 29 30 31 27 /* 32 28 * A collection of useful macros. … … 37 33 #define MACROS_H 38 34 39 #ifndef XFree86Server 40 #include <assert.h> 41 #include <math.h> 42 #include <string.h> 43 #else 44 #include <GL/glx_ansic.h> 45 #endif 46 47 48 #ifdef DEBUG 35 #if defined(DEBUG) 49 36 # define ASSERT(X) assert(X) 37 #define ABORT() abort() 38 #define EXIT(rc) exit(rc) 50 39 #else 51 40 # define ASSERT(X) 41 #define ABORT() abort() 42 #define EXIT(rc) exit(rc) 43 #endif 44 45 #if defined(__WIN32OS2__) 46 #ifdef DEBUG 47 #undef ASSERT 48 #undef ABORT 49 #undef EXIT 50 #define ASSERT(X) if(!(X)) { char msg[200]; sprintf(msg,"Assertion failed at line %d in %s",__LINE__,__FILE__); \ 51 MessageBox(0,msg,"Error",MB_OK); \ 52 } 53 #define ABORT() {char msg[200]; sprintf(msg,"ABORT at line %d in %s",__FILE__,__LINE__); \ 54 abort(); } 55 #define EXIT(rc) {char msg[200]; sprintf(msg,"EXIT at line %d in %s - rc %d",__FILE__,__LINE__,rc); \ 56 exit(rc); } 57 #else 58 #define ASSERT(X) 59 #define ABORT() abort() 60 #define EXIT(rc) exit(rc) 61 #endif 52 62 #endif 53 63 … … 62 72 63 73 74 /* Limits: */ 75 #define MAX_GLUSHORT 0xffff 76 #define MAX_GLUINT 0xffffffff 77 78 79 /* Some compilers don't like some of Mesa's const usage */ 80 #ifdef NO_CONST 81 # define CONST 82 #else 83 # define CONST const 84 #endif 85 86 87 /* Pi */ 88 #ifndef M_PI 89 #define M_PI (3.1415926) 90 #endif 91 92 93 /* Degrees to radians conversion: */ 94 #define DEG2RAD (M_PI/180.0) 95 96 97 #ifndef NULL 98 #define NULL 0 99 #endif 100 101 102 103 /* 104 * Bitmask helpers 105 */ 106 #define SET_BITS(WORD, BITS) (WORD) |= (BITS) 107 #define CLEAR_BITS(WORD, BITS) (WORD) &= ~(BITS) 108 #define TEST_BITS(WORD, BITS) ((WORD) & (BITS)) 109 110 64 111 /* Stepping a GLfloat pointer by a byte stride 65 112 */ … … 69 116 70 117 71 /* Limits: */72 #define MAX_GLUSHORT 0xffff73 #define MAX_GLUINT 0xffffffff74 75 76 118 #define ZERO_2V( DST ) (DST)[0] = (DST)[1] = 0 77 119 #define ZERO_3V( DST ) (DST)[0] = (DST)[1] = (DST)[2] = 0 … … 81 123 /* Copy short vectors: */ 82 124 #define COPY_2V( DST, SRC ) \ 83 /*do*/{ \125 do { \ 84 126 (DST)[0] = (SRC)[0]; \ 85 127 (DST)[1] = (SRC)[1]; \ 86 } /* while (0)*/128 } while (0) 87 129 88 130 89 131 #define COPY_3V( DST, SRC ) \ 90 /*do */{ \132 do { \ 91 133 (DST)[0] = (SRC)[0]; \ 92 134 (DST)[1] = (SRC)[1]; \ 93 135 (DST)[2] = (SRC)[2]; \ 94 } /* while (0)*/136 } while (0) 95 137 96 138 #define COPY_4V( DST, SRC ) \ 97 /*do */{ \139 do { \ 98 140 (DST)[0] = (SRC)[0]; \ 99 141 (DST)[1] = (SRC)[1]; \ 100 142 (DST)[2] = (SRC)[2]; \ 101 143 (DST)[3] = (SRC)[3]; \ 102 } /* while (0)*/144 } while (0) 103 145 104 146 105 147 #define COPY_2FV( DST, SRC ) \ 106 /*do*/{ \148 do { \ 107 149 const GLfloat *_tmp = (SRC); \ 108 150 (DST)[0] = _tmp[0]; \ 109 151 (DST)[1] = _tmp[1]; \ 110 } /* while (0)*/152 } while (0) 111 153 112 154 113 155 #define COPY_3FV( DST, SRC ) \ 114 /*do*/{ \156 do { \ 115 157 const GLfloat *_tmp = (SRC); \ 116 158 (DST)[0] = _tmp[0]; \ 117 159 (DST)[1] = _tmp[1]; \ 118 160 (DST)[2] = _tmp[2]; \ 119 } /* while (0)*/161 } while (0) 120 162 121 163 #define COPY_4FV( DST, SRC ) \ 122 /*do*/{ \164 do { \ 123 165 const GLfloat *_tmp = (SRC); \ 124 166 (DST)[0] = _tmp[0]; \ … … 126 168 (DST)[2] = _tmp[2]; \ 127 169 (DST)[3] = _tmp[3]; \ 128 } /* while (0)*/170 } while (0) 129 171 130 172 131 173 132 174 #define COPY_SZ_4V(DST, SZ, SRC) \ 133 /*do */{ \175 do { \ 134 176 switch (SZ) { \ 135 177 case 4: (DST)[3] = (SRC)[3]; \ … … 138 180 case 1: (DST)[0] = (SRC)[0]; \ 139 181 } \ 140 } /* while(0)*/182 } while(0) 141 183 142 184 #define SUB_4V( DST, SRCA, SRCB ) \ 143 /*do */{ \185 do { \ 144 186 (DST)[0] = (SRCA)[0] - (SRCB)[0]; \ 145 187 (DST)[1] = (SRCA)[1] - (SRCB)[1]; \ 146 188 (DST)[2] = (SRCA)[2] - (SRCB)[2]; \ 147 189 (DST)[3] = (SRCA)[3] - (SRCB)[3]; \ 148 } /* while (0)*/190 } while (0) 149 191 150 192 #define ADD_4V( DST, SRCA, SRCB ) \ 151 /*do*/{ \193 do { \ 152 194 (DST)[0] = (SRCA)[0] + (SRCB)[0]; \ 153 195 (DST)[1] = (SRCA)[1] + (SRCB)[1]; \ 154 196 (DST)[2] = (SRCA)[2] + (SRCB)[2]; \ 155 197 (DST)[3] = (SRCA)[3] + (SRCB)[3]; \ 156 } /* while (0)*/198 } while (0) 157 199 158 200 #define SCALE_4V( DST, SRCA, SRCB ) \ 159 /*do*/{ \201 do { \ 160 202 (DST)[0] = (SRCA)[0] * (SRCB)[0]; \ 161 203 (DST)[1] = (SRCA)[1] * (SRCB)[1]; \ 162 204 (DST)[2] = (SRCA)[2] * (SRCB)[2]; \ 163 205 (DST)[3] = (SRCA)[3] * (SRCB)[3]; \ 164 } /* while (0)*/206 } while (0) 165 207 166 208 #define ACC_4V( DST, SRC ) \ 167 /*do*/{ \168 (DST)[0] += (SRC)[0]; \169 (DST)[1] += (SRC)[1]; \170 (DST)[2] += (SRC)[2]; \171 (DST)[3] += (SRC)[3]; \172 } /* while (0)*/209 do { \ 210 (DST)[0] += (SRC)[0]; \ 211 (DST)[1] += (SRC)[1]; \ 212 (DST)[2] += (SRC)[2]; \ 213 (DST)[3] += (SRC)[3]; \ 214 } while (0) 173 215 174 216 #define ACC_SCALE_4V( DST, SRCA, SRCB ) \ 175 /*do*/{ \176 (DST)[0] += (SRCA)[0] * (SRCB)[0]; \177 (DST)[1] += (SRCA)[1] * (SRCB)[1]; \178 (DST)[2] += (SRCA)[2] * (SRCB)[2]; \179 (DST)[3] += (SRCA)[3] * (SRCB)[3]; \180 } /* while (0)*/217 do { \ 218 (DST)[0] += (SRCA)[0] * (SRCB)[0]; \ 219 (DST)[1] += (SRCA)[1] * (SRCB)[1]; \ 220 (DST)[2] += (SRCA)[2] * (SRCB)[2]; \ 221 (DST)[3] += (SRCA)[3] * (SRCB)[3]; \ 222 } while (0) 181 223 182 224 #define ACC_SCALE_SCALAR_4V( DST, S, SRCB ) \ 183 /*do*/{ \184 (DST)[0] += S * (SRCB)[0]; \185 (DST)[1] += S * (SRCB)[1]; \186 (DST)[2] += S * (SRCB)[2]; \187 (DST)[3] += S * (SRCB)[3]; \188 } /* while (0)*/225 do { \ 226 (DST)[0] += S * (SRCB)[0]; \ 227 (DST)[1] += S * (SRCB)[1]; \ 228 (DST)[2] += S * (SRCB)[2]; \ 229 (DST)[3] += S * (SRCB)[3]; \ 230 } while (0) 189 231 190 232 #define SCALE_SCALAR_4V( DST, S, SRCB ) \ 191 /*do*/{ \233 do { \ 192 234 (DST)[0] = S * (SRCB)[0]; \ 193 235 (DST)[1] = S * (SRCB)[1]; \ 194 236 (DST)[2] = S * (SRCB)[2]; \ 195 237 (DST)[3] = S * (SRCB)[3]; \ 196 } /* while (0)*/238 } while (0) 197 239 198 240 199 241 #define SELF_SCALE_SCALAR_4V( DST, S ) \ 200 /*do*/{ \242 do { \ 201 243 (DST)[0] *= S; \ 202 244 (DST)[1] *= S; \ 203 245 (DST)[2] *= S; \ 204 246 (DST)[3] *= S; \ 205 } /* while (0)*/247 } while (0) 206 248 207 249 … … 210 252 */ 211 253 #define SUB_3V( DST, SRCA, SRCB ) \ 212 /*do*/{ \254 do { \ 213 255 (DST)[0] = (SRCA)[0] - (SRCB)[0]; \ 214 256 (DST)[1] = (SRCA)[1] - (SRCB)[1]; \ 215 257 (DST)[2] = (SRCA)[2] - (SRCB)[2]; \ 216 } /* while (0)*/258 } while (0) 217 259 218 260 #define ADD_3V( DST, SRCA, SRCB ) \ 219 /*do*/{ \261 do { \ 220 262 (DST)[0] = (SRCA)[0] + (SRCB)[0]; \ 221 263 (DST)[1] = (SRCA)[1] + (SRCB)[1]; \ 222 264 (DST)[2] = (SRCA)[2] + (SRCB)[2]; \ 223 } /* while (0)*/265 } while (0) 224 266 225 267 #define SCALE_3V( DST, SRCA, SRCB ) \ 226 /*do*/{ \268 do { \ 227 269 (DST)[0] = (SRCA)[0] * (SRCB)[0]; \ 228 270 (DST)[1] = (SRCA)[1] * (SRCB)[1]; \ 229 271 (DST)[2] = (SRCA)[2] * (SRCB)[2]; \ 230 } /* while (0)*/272 } while (0) 231 273 232 274 #define ACC_3V( DST, SRC ) \ 233 /*do*/{ \275 do { \ 234 276 (DST)[0] += (SRC)[0]; \ 235 277 (DST)[1] += (SRC)[1]; \ 236 278 (DST)[2] += (SRC)[2]; \ 237 } /* while (0)*/279 } while (0) 238 280 239 281 #define ACC_SCALE_3V( DST, SRCA, SRCB ) \ 240 /*do*/{ \282 do { \ 241 283 (DST)[0] += (SRCA)[0] * (SRCB)[0]; \ 242 284 (DST)[1] += (SRCA)[1] * (SRCB)[1]; \ 243 285 (DST)[2] += (SRCA)[2] * (SRCB)[2]; \ 244 } /* while (0)*/286 } while (0) 245 287 246 288 #define SCALE_SCALAR_3V( DST, S, SRCB ) \ 247 /*do*/{ \289 do { \ 248 290 (DST)[0] = S * (SRCB)[0]; \ 249 291 (DST)[1] = S * (SRCB)[1]; \ 250 292 (DST)[2] = S * (SRCB)[2]; \ 251 } /* while (0)*/293 } while (0) 252 294 253 295 #define ACC_SCALE_SCALAR_3V( DST, S, SRCB ) \ 254 /*do*/{ \296 do { \ 255 297 (DST)[0] += S * (SRCB)[0]; \ 256 298 (DST)[1] += S * (SRCB)[1]; \ 257 299 (DST)[2] += S * (SRCB)[2]; \ 258 } /* while (0)*/300 } while (0) 259 301 260 302 #define SELF_SCALE_SCALAR_3V( DST, S ) \ 261 /*do*/{ \303 do { \ 262 304 (DST)[0] *= S; \ 263 305 (DST)[1] *= S; \ 264 306 (DST)[2] *= S; \ 265 } /* while (0)*/307 } while (0) 266 308 267 309 #define ACC_SCALAR_3V( DST, S ) \ 268 /*do*/{ \310 do { \ 269 311 (DST)[0] += S; \ 270 312 (DST)[1] += S; \ 271 313 (DST)[2] += S; \ 272 } /* while (0)*/314 } while (0) 273 315 274 316 /* And also for 2-vectors 275 317 */ 276 318 #define SUB_2V( DST, SRCA, SRCB ) \ 277 /*do*/{ \319 do { \ 278 320 (DST)[0] = (SRCA)[0] - (SRCB)[0]; \ 279 321 (DST)[1] = (SRCA)[1] - (SRCB)[1]; \ 280 } /* while (0)*/322 } while (0) 281 323 282 324 #define ADD_2V( DST, SRCA, SRCB ) \ 283 /*do*/{ \325 do { \ 284 326 (DST)[0] = (SRCA)[0] + (SRCB)[0]; \ 285 327 (DST)[1] = (SRCA)[1] + (SRCB)[1]; \ 286 } /* while (0)*/328 } while (0) 287 329 288 330 #define SCALE_2V( DST, SRCA, SRCB ) \ 289 /*do*/{ \331 do { \ 290 332 (DST)[0] = (SRCA)[0] * (SRCB)[0]; \ 291 333 (DST)[1] = (SRCA)[1] * (SRCB)[1]; \ 292 } /* while (0)*/334 } while (0) 293 335 294 336 #define ACC_2V( DST, SRC ) \ 295 /*do*/{ \337 do { \ 296 338 (DST)[0] += (SRC)[0]; \ 297 339 (DST)[1] += (SRC)[1]; \ 298 } /* while (0)*/340 } while (0) 299 341 300 342 #define ACC_SCALE_2V( DST, SRCA, SRCB ) \ 301 /*do*/{ \343 do { \ 302 344 (DST)[0] += (SRCA)[0] * (SRCB)[0]; \ 303 345 (DST)[1] += (SRCA)[1] * (SRCB)[1]; \ 304 } /* while (0)*/346 } while (0) 305 347 306 348 #define SCALE_SCALAR_2V( DST, S, SRCB ) \ 307 /*do*/{ \349 do { \ 308 350 (DST)[0] = S * (SRCB)[0]; \ 309 351 (DST)[1] = S * (SRCB)[1]; \ 310 } /* while (0)*/352 } while (0) 311 353 312 354 #define ACC_SCALE_SCALAR_2V( DST, S, SRCB ) \ 313 /*do*/{ \355 do { \ 314 356 (DST)[0] += S * (SRCB)[0]; \ 315 357 (DST)[1] += S * (SRCB)[1]; \ 316 } /* while (0)*/358 } while (0) 317 359 318 360 #define SELF_SCALE_SCALAR_2V( DST, S ) \ 319 /*do*/{ \361 do { \ 320 362 (DST)[0] *= S; \ 321 363 (DST)[1] *= S; \ 322 } /* while (0)*/364 } while (0) 323 365 324 366 #define ACC_SCALAR_2V( DST, S ) \ 325 /*do*/{ \367 do { \ 326 368 (DST)[0] += S; \ 327 369 (DST)[1] += S; \ 328 } /* while (0)*/370 } while (0) 329 371 330 372 … … 334 376 */ 335 377 #define COPY_4UBV(DST, SRC) \ 336 /*do*/ {\378 do { \ 337 379 if (sizeof(GLuint)==4*sizeof(GLubyte)) { \ 338 380 *((GLuint*)(DST)) = *((GLuint*)(SRC)); \ … … 344 386 (DST)[3] = (SRC)[3]; \ 345 387 } \ 346 } /* while (0)*/388 } while (0) 347 389 348 390 349 391 /* Assign scalers to short vectors: */ 350 392 #define ASSIGN_2V( V, V0, V1 ) \ 351 /*do*/ { V[0] = V0; V[1] = V1; } //while(0)393 do { V[0] = V0; V[1] = V1; } while(0) 352 394 353 395 #define ASSIGN_3V( V, V0, V1, V2 ) \ 354 /*do*/ { V[0] = V0; V[1] = V1; V[2] = V2; } //while(0)396 do { V[0] = V0; V[1] = V1; V[2] = V2; } while(0) 355 397 356 398 #define ASSIGN_4V( V, V0, V1, V2, V3 ) \ 357 /*do*/{ \399 do { \ 358 400 V[0] = V0; \ 359 401 V[1] = V1; \ 360 402 V[2] = V2; \ 361 403 V[3] = V3; \ 362 } /* while(0)*/404 } while(0) 363 405 364 406 … … 421 463 * Integer / float conversion for colors, normals, etc. 422 464 */ 423 424 425 426 465 427 466 #define BYTE_TO_UBYTE(b) (b < 0 ? 0 : (GLubyte) b) … … 430 469 #define INT_TO_UBYTE(i) (i < 0 ? 0 : (GLubyte) (i >> 23)) 431 470 #define UINT_TO_UBYTE(i) (GLubyte) (i >> 24) 432 433 434 435 471 436 472 /* Convert GLubyte in [0,255] to GLfloat in [0.0,1.0] */ … … 480 516 481 517 482 483 /*484 * Memory allocation485 * XXX these should probably go into a new glmemory.h file.486 */487 #ifdef DEBUG488 extern void *gl_malloc(size_t bytes);489 extern void *gl_calloc(size_t bytes);490 extern void gl_free(void *ptr);491 #define MALLOC(BYTES) gl_malloc(BYTES)492 #define CALLOC(BYTES) gl_calloc(BYTES)493 #define MALLOC_STRUCT(T) (struct T *) gl_malloc(sizeof(struct T))494 #define CALLOC_STRUCT(T) (struct T *) gl_calloc(sizeof(struct T))495 #define FREE(PTR) gl_free(PTR)496 #else497 #define MALLOC(BYTES) (void *) malloc(BYTES)498 #define CALLOC(BYTES) (void *) calloc(1, BYTES)499 #define MALLOC_STRUCT(T) (struct T *) malloc(sizeof(struct T))500 #define CALLOC_STRUCT(T) (struct T *) calloc(1,sizeof(struct T))501 #define FREE(PTR) free(PTR)502 #endif503 504 505 /* Memory copy: */506 #ifdef SUNOS4507 #define MEMCPY( DST, SRC, BYTES) \508 memcpy( (char *) (DST), (char *) (SRC), (int) (BYTES) )509 #else510 #define MEMCPY( DST, SRC, BYTES) \511 memcpy( (void *) (DST), (void *) (SRC), (size_t) (BYTES) )512 #endif513 514 515 /* Memory set: */516 #ifdef SUNOS4517 #define MEMSET( DST, VAL, N ) \518 memset( (char *) (DST), (int) (VAL), (int) (N) )519 #else520 #define MEMSET( DST, VAL, N ) \521 memset( (void *) (DST), (int) (VAL), (size_t) (N) )522 #endif523 524 525 /* MACs and BeOS don't support static larger than 32kb, so... */526 #if defined(macintosh) && !defined(__MRC__)527 extern char *AGLAlloc(int size);528 extern void AGLFree(char* ptr);529 # define DEFARRAY(TYPE,NAME,SIZE) TYPE *NAME = (TYPE*)AGLAlloc(sizeof(TYPE)*(SIZE))530 # define DEFMARRAY(TYPE,NAME,SIZE1,SIZE2) TYPE (*NAME)[SIZE2] = (TYPE(*)[SIZE2])AGLAlloc(sizeof(TYPE)*(SIZE1)*(SIZE2))531 # define CHECKARRAY(NAME,CMD) do {if (!(NAME)) {CMD;}} while (0)532 # define UNDEFARRAY(NAME) do {if ((NAME)) {AGLFree((char*)NAME);} }while (0)533 #elif defined(__BEOS__)534 # define DEFARRAY(TYPE,NAME,SIZE) TYPE *NAME = (TYPE*)malloc(sizeof(TYPE)*(SIZE))535 # define DEFMARRAY(TYPE,NAME,SIZE1,SIZE2) TYPE (*NAME)[SIZE2] = (TYPE(*)[SIZE2])malloc(sizeof(TYPE)*(SIZE1)*(SIZE2))536 # define CHECKARRAY(NAME,CMD) do {if (!(NAME)) {CMD;}} while (0)537 # define UNDEFARRAY(NAME) do {if ((NAME)) {free((char*)NAME);} }while (0)538 #else539 # define DEFARRAY(TYPE,NAME,SIZE) TYPE NAME[SIZE]540 # define DEFMARRAY(TYPE,NAME,SIZE1,SIZE2) TYPE NAME[SIZE1][SIZE2]541 # define CHECKARRAY(NAME,CMD) do {} while(0)542 # define UNDEFARRAY(NAME)543 #endif544 545 546 /* Some compilers don't like some of Mesa's const usage */547 #ifdef NO_CONST548 # define CONST549 #else550 # define CONST const551 #endif552 553 554 555 /* Pi */556 #ifndef M_PI557 #define M_PI (3.1415926)558 #endif559 560 561 /* Degrees to radians conversion: */562 #define DEG2RAD (M_PI/180.0)563 564 565 #ifndef NULL566 #define NULL 0567 #endif568 569 570 571 518 #endif /*MACROS_H*/ -
trunk/src/opengl/mesa/masking.h
r2938 r3597 1 /* $Id: masking.h,v 1. 1 2000-02-29 00:48:33 sandervlExp $ */1 /* $Id: masking.h,v 1.2 2000-05-23 20:34:52 jeroen Exp $ */ 2 2 3 3 /* 4 4 * Mesa 3-D graphics library 5 * Version: 3. 15 * Version: 3.3 6 6 * 7 7 * Copyright (C) 1999 Brian Paul All Rights Reserved. … … 37 37 38 38 39 extern void gl_IndexMask( GLcontext *ctx, GLuint mask ); 39 extern void 40 _mesa_IndexMask( GLuint mask ); 40 41 41 extern void gl_ColorMask( GLcontext *ctx, GLboolean red, GLboolean green, 42 GLboolean blue, GLboolean alpha ); 42 extern void 43 _mesa_ColorMask( GLboolean red, GLboolean green, 44 GLboolean blue, GLboolean alpha ); 43 45 44 46 -
trunk/src/opengl/mesa/matrix.h
r2938 r3597 1 /* $Id: matrix.h,v 1. 1 2000-02-29 00:48:33 sandervlExp $ */1 /* $Id: matrix.h,v 1.2 2000-05-23 20:34:52 jeroen Exp $ */ 2 2 3 3 /* 4 4 * Mesa 3-D graphics library 5 * Version: 3. 15 * Version: 3.3 6 6 * 7 7 * Copyright (C) 1999 Brian Paul All Rights Reserved. … … 33 33 34 34 35 #include "gl.h"36 35 #include "config.h" 37 36 38 37 typedef struct { 39 38 GLfloat m[16]; 40 GLfloat *inv; /* optional*/39 GLfloat *inv; /* optional*/ 41 40 GLuint flags; 42 41 GLuint type; 43 42 } GLmatrix; 43 44 44 45 45 #ifdef VMS … … 48 48 49 49 50 extern void gl_matrix_transposef( GLfloat to[16], const GLfloat from[16] ); 51 52 extern void gl_matrix_transposed( GLdouble to[16], const GLdouble from[16] ); 53 54 50 55 extern void gl_rotation_matrix( GLfloat angle, GLfloat x, GLfloat y, GLfloat z, 51 56 GLfloat m[] ); 52 57 53 58 59 extern void gl_mat_mul_floats( GLmatrix *mat, const GLfloat *m, GLuint flags ); 54 60 55 extern void gl_Frustum( GLcontext *ctx,56 GLdouble left, GLdouble right,57 GLdouble bottom, GLdouble top,58 GLdouble nearval, GLdouble farval );59 60 extern void gl_Ortho( GLcontext *ctx,61 GLdouble left, GLdouble right,62 GLdouble bottom, GLdouble top,63 GLdouble nearval, GLdouble farval );64 65 extern void gl_PushMatrix( GLcontext *ctx );66 67 extern void gl_PopMatrix( GLcontext *ctx );68 69 extern void gl_LoadIdentity( GLcontext *ctx );70 71 extern void gl_LoadMatrixf( GLcontext *ctx, const GLfloat *m );72 73 extern void gl_MatrixMode( GLcontext *ctx, GLenum mode );74 75 extern void gl_MultMatrixf( GLcontext *ctx, const GLfloat *m );76 77 extern void gl_mat_mul_floats( GLmatrix *mat, const GLfloat *m, GLuint flags );78 61 extern void gl_mat_mul_mat( GLmatrix *mat, const GLmatrix *mat2 ); 79 80 extern void gl_Rotatef( GLcontext *ctx,81 GLfloat angle, GLfloat x, GLfloat y, GLfloat z );82 83 extern void gl_Scalef( GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z );84 85 extern void gl_Translatef( GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z );86 87 extern void gl_Viewport( GLcontext *ctx,88 GLint x, GLint y, GLsizei width, GLsizei height );89 90 extern void gl_DepthRange( GLcontext* ctx, GLclampd nearval, GLclampd farval );91 92 93 94 95 62 96 63 extern void gl_calculate_model_project_matrix( GLcontext *ctx ); 97 64 65 extern void gl_matrix_copy( GLmatrix *to, const GLmatrix *from ); 98 66 99 67 extern void gl_matrix_ctr( GLmatrix *m ); … … 103 71 extern void gl_matrix_alloc_inv( GLmatrix *m ); 104 72 105 extern void gl_matrix_copy( GLmatrix *to, const GLmatrix *from );106 107 73 extern void gl_matrix_mul( GLmatrix *dest, 108 74 const GLmatrix *a, … … 111 77 extern void gl_matrix_analyze( GLmatrix *mat ); 112 78 79 extern GLboolean gl_matrix_invert( GLmatrix *mat ); 113 80 114 extern void gl_MultMatrixd( GLcontext *ctx, const GLdouble *m );115 extern GLboolean gl_matrix_invert( GLmatrix *mat );116 81 extern void gl_print_matrix( const GLmatrix *m ); 117 82 118 83 84 85 extern void 86 _mesa_Frustum( GLdouble left, GLdouble right, 87 GLdouble bottom, GLdouble top, 88 GLdouble nearval, GLdouble farval ); 89 90 extern void 91 _mesa_Ortho( GLdouble left, GLdouble right, 92 GLdouble bottom, GLdouble top, 93 GLdouble nearval, GLdouble farval ); 94 95 extern void 96 _mesa_PushMatrix( void ); 97 98 extern void 99 _mesa_PopMatrix( void ); 100 101 extern void 102 _mesa_LoadIdentity( void ); 103 104 extern void 105 _mesa_LoadMatrixf( const GLfloat *m ); 106 107 extern void 108 _mesa_LoadMatrixd( const GLdouble *m ); 109 110 extern void 111 _mesa_MatrixMode( GLenum mode ); 112 113 extern void 114 _mesa_MultMatrixf( const GLfloat *m ); 115 116 extern void 117 _mesa_MultMatrixd( const GLdouble *m ); 118 119 extern void 120 _mesa_Rotatef( GLfloat angle, GLfloat x, GLfloat y, GLfloat z ); 121 122 extern void 123 _mesa_Rotated( GLdouble angle, GLdouble x, GLdouble y, GLdouble z ); 124 125 extern void 126 _mesa_Scalef( GLfloat x, GLfloat y, GLfloat z ); 127 128 extern void 129 _mesa_Scaled( GLdouble x, GLdouble y, GLdouble z ); 130 131 extern void 132 _mesa_Translatef( GLfloat x, GLfloat y, GLfloat z ); 133 134 extern void 135 _mesa_Translated( GLdouble x, GLdouble y, GLdouble z ); 136 137 extern void 138 _mesa_LoadTransposeMatrixfARB( const GLfloat *m ); 139 140 extern void 141 _mesa_LoadTransposeMatrixdARB( const GLdouble *m ); 142 143 extern void 144 _mesa_MultTransposeMatrixfARB( const GLfloat *m ); 145 146 extern void 147 _mesa_MultTransposeMatrixdARB( const GLdouble *m ); 148 149 extern void 150 _mesa_Viewport( GLint x, GLint y, GLsizei width, GLsizei height ); 151 152 extern void 153 gl_Viewport( GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height ); 154 155 extern void 156 _mesa_DepthRange( GLclampd nearval, GLclampd farval ); 157 158 159 119 160 #endif -
trunk/src/opengl/mesa/mesa_extend.h
r2938 r3597 1 /* $Id: mesa_extend.h,v 1. 1 2000-02-29 00:48:33 sandervlExp $ */1 /* $Id: mesa_extend.h,v 1.2 2000-05-23 20:34:53 jeroen Exp $ */ 2 2 /* mesa_extend.h 3 3 * for wmesa-2.3 … … 9 9 * struct DisplayOptions defined for tk_ddmesa.c to read the initial file 10 10 */ 11 12 #include "gl.h"13 #include <stdlib.h>14 #ifdef __WIN32OS2__15 #include <os2win.h>16 #else17 #include <windows.h>18 #include <winbase.h>19 #endif20 11 21 12 typedef enum SHIFT{ SHIFT_NONE, SHIFT_LEFT,SHIFT_RIGHT,SHIFT_UP,SHIFT_DOWN,SHIFT_FAR,SHIFT_NEAR}; -
trunk/src/opengl/mesa/mmath.h
r2938 r3597 1 /* $Id: mmath.h,v 1. 1 2000-02-29 00:48:34 sandervlExp $ */1 /* $Id: mmath.h,v 1.2 2000-05-23 20:34:53 jeroen Exp $ */ 2 2 3 3 /* 4 4 * Mesa 3-D graphics library 5 * Version: 3. 15 * Version: 3.3 6 6 * 7 7 * Copyright (C) 1999 Brian Paul All Rights Reserved. … … 24 24 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 25 25 */ 26 /* $XFree86: xc/lib/GL/mesa/src/mmath.h,v 1.2 1999/04/04 00:20:28 dawes Exp $ */27 28 29 30 26 31 27 … … 40 36 #define MMATH_H 41 37 42 #ifdef HAVE_CONFIG_H 43 #include "conf.h" 44 #endif 45 46 #ifndef XFree86Server 47 #include <math.h> 48 #else 49 #include "GL/xf86glx.h" 50 #endif 38 39 #include "glheader.h" 40 51 41 52 42 /* … … 74 64 */ 75 65 #if !defined(NO_FAST_MATH) 76 #define START_FAST_MATH(x) \66 #define START_FAST_MATH(x) \ 77 67 { \ 78 68 static fpu_control_t mask = _FPU_SINGLE | _FPU_MASK_IM \ … … 98 88 } 99 89 90 #define HAVE_FAST_MATH 91 92 #elif defined(__WATCOMC__) && !defined(NO_FAST_MATH) 93 94 /* This is the watcom specific inline assembly version of setcw and getcw */ 95 96 void START_FAST_MATH2(unsigned short *x); 97 #pragma aux START_FAST_MATH2 = \ 98 "fstcw word ptr [esi]" \ 99 "or word ptr [esi], 0x3f" \ 100 "fldcw word ptr [esi]" \ 101 parm [esi] \ 102 modify exact []; 103 104 void END_FAST_MATH2(unsigned short *x); 105 #pragma aux END_FAST_MATH2 = \ 106 "fldcw word ptr [esi]" \ 107 parm [esi] \ 108 modify exact []; 109 110 #define START_FAST_MATH(x) START_FAST_MATH2(& x) 111 #define END_FAST_MATH(x) END_FAST_MATH2(& x) 112 113 /* 114 __inline START_FAST_MATH(unsigned short x) 115 { 116 _asm { 117 fstcw ax 118 mov x , ax 119 or ax, 0x3f 120 fldcw ax 121 } 122 } 123 124 __inline END_FAST_MATH(unsigned short x) 125 { 126 _asm { 127 fldcw x 128 } 129 } 130 */ 100 131 #define HAVE_FAST_MATH 101 132 … … 132 163 int r; 133 164 _asm { 134 fld f135 fistp r136 }165 fld f 166 fistp r 167 } 137 168 return r; 138 169 } 139 #elif defined(__WIN32OS2__) 170 #elif defined(__WATCOMC__) 171 long FloatToInt(float f); 172 #pragma aux FloatToInt = \ 173 "push eax" \ 174 "fistp dword ptr [esp]" \ 175 "pop eax" \ 176 parm [8087] \ 177 value [eax] \ 178 modify exact [eax]; 179 float asm_sqrt (float x); 180 #pragma aux asm_sqrt = \ 181 "fsqrt" \ 182 parm [8087] \ 183 value [8087] \ 184 modify exact []; 185 #else 140 186 #define FloatToInt(F) ((int) (F)) 141 187 #endif … … 145 191 146 192 147 148 149 150 193 /* 151 194 * Square root … … 155 198 156 199 #ifdef FAST_MATH 200 #if defined (__WATCOMC__) && defined(USE_X86_ASM) 201 # define GL_SQRT(X) asm_sqrt(X) 202 #else 157 203 # define GL_SQRT(X) gl_sqrt(X) 204 #endif 158 205 #else 159 206 # define GL_SQRT(X) sqrt(X) … … 161 208 162 209 163 164 210 /* 165 211 * Normalize a 3-element vector to unit length. 166 212 */ 167 #define NORMALIZE_3FV( V ) \168 do { \169 GLdouble len = LEN_SQUARED_3FV(V); \170 if (len > 1e-50) { \171 len = 1.0 / GL_SQRT(len); \172 V[0] = (GLfloat) (V[0] * len); \173 V[1] = (GLfloat) (V[1] * len); \174 V[2] = (GLfloat) (V[2] * len); \175 } \213 #define NORMALIZE_3FV( V ) \ 214 do { \ 215 GLdouble len = LEN_SQUARED_3FV(V); \ 216 if (len > 1e-50) { \ 217 len = 1.0 / GL_SQRT(len); \ 218 V[0] = (GLfloat) (V[0] * len); \ 219 V[1] = (GLfloat) (V[1] * len); \ 220 V[2] = (GLfloat) (V[2] * len); \ 221 } \ 176 222 } while(0) 177 223 … … 194 240 #define IEEE_ONE 0x3f7f0000 195 241 196 #define CLAMP_FLOAT_COLOR(f) \197 do {\198 if (*(GLuint *)&f >= IEEE_ONE)\199 f = (*(GLint *)&f < 0) ? 0 : 1;\200 } while(0)242 #define CLAMP_FLOAT_COLOR(f) \ 243 do { \ 244 if (*(GLuint *)&f >= IEEE_ONE) \ 245 f = (*(GLint *)&f < 0) ? 0 : 1; \ 246 } while(0) 201 247 202 248 #define CLAMP_FLOAT_COLOR_VALUE(f) \ … … 283 329 284 330 285 extern void gl_init_math(void);286 287 288 #endif 331 extern void _mesa_init_math(void); 332 333 334 #endif -
trunk/src/opengl/mesa/mmx.h
r2962 r3597 1 /* $Id: mmx.h,v 1. 2 2000-03-01 18:49:32jeroen Exp $ */1 /* $Id: mmx.h,v 1.3 2000-05-23 20:34:53 jeroen Exp $ */ 2 2 3 3 /* … … 33 33 34 34 35 extern void _ _cdecl35 extern void _ASMAPI 36 36 gl_mmx_blend_transparency( GLcontext *ctx, GLuint n, const GLubyte mask[], 37 37 GLubyte rgba[][4], const GLubyte dest[][4] ); -
trunk/src/opengl/mesa/norm_tmp.h
r2938 r3597 1 /* $Id: norm_tmp.h,v 1. 1 2000-02-29 00:48:34 sandervlExp $ */1 /* $Id: norm_tmp.h,v 1.2 2000-05-23 20:34:53 jeroen Exp $ */ 2 2 3 3 /* … … 30 30 31 31 32 static void TAG(transform_normalize_normals)( const GLmatrix *mat,33 GLfloat scale,34 const GLvector3f *in,35 const GLfloat *lengths,36 const GLubyte mask[],37 GLvector3f *dest )32 static void _XFORMAPI TAG(transform_normalize_normals)( const GLmatrix *mat, 33 GLfloat scale, 34 const GLvector3f *in, 35 const GLfloat *lengths, 36 const GLubyte mask[], 37 GLvector3f *dest ) 38 38 { 39 39 GLuint i; … … 50 50 if (!lengths) { 51 51 STRIDE_LOOP { 52 CULL_CHECK {53 GLfloat tx, ty, tz;54 {55 const GLfloat ux = from[0], uy = from[1], uz = from[2];56 tx = ux * m0 + uy * m1 + uz * m2;57 ty = ux * m4 + uy * m5 + uz * m6;58 tz = ux * m8 + uy * m9 + uz * m10;59 }60 {61 GLdouble len = tx*tx + ty*ty + tz*tz;62 if (len > 1e-20) {63 GLdouble scale = 1.0 / GL_SQRT(len);64 out[i][0] = (GLfloat) (tx * scale);65 out[i][1] = (GLfloat) (ty * scale);66 out[i][2] = (GLfloat) (tz * scale);67 }68 else69 {70 out[i][0] = out[i][1] = out[i][2] = 0;71 }72 }73 }52 CULL_CHECK { 53 GLfloat tx, ty, tz; 54 { 55 const GLfloat ux = from[0], uy = from[1], uz = from[2]; 56 tx = ux * m0 + uy * m1 + uz * m2; 57 ty = ux * m4 + uy * m5 + uz * m6; 58 tz = ux * m8 + uy * m9 + uz * m10; 59 } 60 { 61 GLdouble len = tx*tx + ty*ty + tz*tz; 62 if (len > 1e-20) { 63 GLdouble scale = 1.0 / GL_SQRT(len); 64 out[i][0] = (GLfloat) (tx * scale); 65 out[i][1] = (GLfloat) (ty * scale); 66 out[i][2] = (GLfloat) (tz * scale); 67 } 68 else 69 { 70 out[i][0] = out[i][1] = out[i][2] = 0; 71 } 72 } 73 } 74 74 } 75 75 } else { … … 78 78 */ 79 79 if (scale != 1.0) { 80 m0 *= scale, m4 *= scale, m8 *= scale;81 m1 *= scale, m5 *= scale, m9 *= scale;82 m2 *= scale, m6 *= scale, m10 *= scale;83 } 84 85 STRIDE_LOOP { 86 CULL_CHECK {87 GLfloat tx, ty, tz;88 {89 const GLfloat ux = from[0], uy = from[1], uz = from[2];90 tx = ux * m0 + uy * m1 + uz * m2;91 ty = ux * m4 + uy * m5 + uz * m6;92 tz = ux * m8 + uy * m9 + uz * m10;93 }94 {95 GLfloat len = lengths[i];96 out[i][0] = tx * len;97 out[i][1] = ty * len;98 out[i][2] = tz * len;99 }100 }101 } 102 } 103 dest->count = in->count; 104 } 105 106 static void TAG(transform_normalize_normals_no_rot)( const GLmatrix *mat,107 GLfloat scale,108 const GLvector3f *in,109 const GLfloat *lengths,110 const GLubyte mask[],111 GLvector3f *dest )80 m0 *= scale, m4 *= scale, m8 *= scale; 81 m1 *= scale, m5 *= scale, m9 *= scale; 82 m2 *= scale, m6 *= scale, m10 *= scale; 83 } 84 85 STRIDE_LOOP { 86 CULL_CHECK { 87 GLfloat tx, ty, tz; 88 { 89 const GLfloat ux = from[0], uy = from[1], uz = from[2]; 90 tx = ux * m0 + uy * m1 + uz * m2; 91 ty = ux * m4 + uy * m5 + uz * m6; 92 tz = ux * m8 + uy * m9 + uz * m10; 93 } 94 { 95 GLfloat len = lengths[i]; 96 out[i][0] = tx * len; 97 out[i][1] = ty * len; 98 out[i][2] = tz * len; 99 } 100 } 101 } 102 } 103 dest->count = in->count; 104 } 105 106 static void _XFORMAPI TAG(transform_normalize_normals_no_rot)( const GLmatrix *mat, 107 GLfloat scale, 108 const GLvector3f *in, 109 const GLfloat *lengths, 110 const GLubyte mask[], 111 GLvector3f *dest ) 112 112 { 113 113 GLuint i; … … 123 123 if (!lengths) { 124 124 STRIDE_LOOP { 125 CULL_CHECK {126 GLfloat tx, ty, tz;127 {128 const GLfloat ux = from[0], uy = from[1], uz = from[2];129 tx = ux * m0 ;130 ty = uy * m5 ;131 tz = uz * m10;132 }133 {134 GLdouble len = tx*tx + ty*ty + tz*tz;135 if (len > 1e-20) {136 GLdouble scale = 1.0 / GL_SQRT(len);137 out[i][0] = (GLfloat) (tx * scale);138 out[i][1] = (GLfloat) (ty * scale);139 out[i][2] = (GLfloat) (tz * scale);140 }141 else142 {143 out[i][0] = out[i][1] = out[i][2] = 0;144 }145 }146 }125 CULL_CHECK { 126 GLfloat tx, ty, tz; 127 { 128 const GLfloat ux = from[0], uy = from[1], uz = from[2]; 129 tx = ux * m0 ; 130 ty = uy * m5 ; 131 tz = uz * m10; 132 } 133 { 134 GLdouble len = tx*tx + ty*ty + tz*tz; 135 if (len > 1e-20) { 136 GLdouble scale = 1.0 / GL_SQRT(len); 137 out[i][0] = (GLfloat) (tx * scale); 138 out[i][1] = (GLfloat) (ty * scale); 139 out[i][2] = (GLfloat) (tz * scale); 140 } 141 else 142 { 143 out[i][0] = out[i][1] = out[i][2] = 0; 144 } 145 } 146 } 147 147 } 148 148 } else { … … 150 150 */ 151 151 if (scale != 1.0) { 152 m0 *= scale;153 m5 *= scale;154 m10 *= scale;155 } 156 157 STRIDE_LOOP { 158 CULL_CHECK {159 GLfloat tx, ty, tz;160 {161 const GLfloat ux = from[0], uy = from[1], uz = from[2];162 tx = ux * m0 ;163 ty = uy * m5 ;164 tz = uz * m10;165 }166 {167 GLfloat len = lengths[i];168 out[i][0] = tx * len;169 out[i][1] = ty * len;170 out[i][2] = tz * len;171 }172 }173 } 174 } 175 dest->count = in->count; 176 } 177 178 179 static void TAG(transform_rescale_normals_no_rot)( const GLmatrix *mat,180 GLfloat scale,181 const GLvector3f *in,182 const GLfloat *lengths,183 const GLubyte mask[],184 GLvector3f *dest )152 m0 *= scale; 153 m5 *= scale; 154 m10 *= scale; 155 } 156 157 STRIDE_LOOP { 158 CULL_CHECK { 159 GLfloat tx, ty, tz; 160 { 161 const GLfloat ux = from[0], uy = from[1], uz = from[2]; 162 tx = ux * m0 ; 163 ty = uy * m5 ; 164 tz = uz * m10; 165 } 166 { 167 GLfloat len = lengths[i]; 168 out[i][0] = tx * len; 169 out[i][1] = ty * len; 170 out[i][2] = tz * len; 171 } 172 } 173 } 174 } 175 dest->count = in->count; 176 } 177 178 179 static void _XFORMAPI TAG(transform_rescale_normals_no_rot)( const GLmatrix *mat, 180 GLfloat scale, 181 const GLvector3f *in, 182 const GLfloat *lengths, 183 const GLubyte mask[], 184 GLvector3f *dest ) 185 185 { 186 186 GLuint i; … … 197 197 STRIDE_LOOP { 198 198 CULL_CHECK { 199 GLfloat ux = from[0], uy = from[1], uz = from[2];200 out[i][0] = ux * m0;201 out[i][1] = uy * m5;202 out[i][2] = uz * m10;203 } 204 } 205 dest->count = in->count; 206 } 207 208 static void TAG(transform_rescale_normals)( const GLmatrix *mat,209 GLfloat scale,210 const GLvector3f *in,211 const GLfloat *lengths,212 const GLubyte mask[],213 GLvector3f *dest )199 GLfloat ux = from[0], uy = from[1], uz = from[2]; 200 out[i][0] = ux * m0; 201 out[i][1] = uy * m5; 202 out[i][2] = uz * m10; 203 } 204 } 205 dest->count = in->count; 206 } 207 208 static void _XFORMAPI TAG(transform_rescale_normals)( const GLmatrix *mat, 209 GLfloat scale, 210 const GLvector3f *in, 211 const GLfloat *lengths, 212 const GLubyte mask[], 213 GLvector3f *dest ) 214 214 { 215 215 GLuint i; … … 229 229 STRIDE_LOOP { 230 230 CULL_CHECK { 231 GLfloat ux = from[0], uy = from[1], uz = from[2];232 out[i][0] = ux * m0 + uy * m1 + uz * m2;233 out[i][1] = ux * m4 + uy * m5 + uz * m6;234 out[i][2] = ux * m8 + uy * m9 + uz * m10;235 } 236 } 237 dest->count = in->count; 238 } 239 240 241 static void TAG(transform_normals_no_rot)(const GLmatrix *mat,242 GLfloat scale,243 const GLvector3f *in,244 const GLfloat *lengths,245 const GLubyte mask[],246 GLvector3f *dest )231 GLfloat ux = from[0], uy = from[1], uz = from[2]; 232 out[i][0] = ux * m0 + uy * m1 + uz * m2; 233 out[i][1] = ux * m4 + uy * m5 + uz * m6; 234 out[i][2] = ux * m8 + uy * m9 + uz * m10; 235 } 236 } 237 dest->count = in->count; 238 } 239 240 241 static void _XFORMAPI TAG(transform_normals_no_rot)(const GLmatrix *mat, 242 GLfloat scale, 243 const GLvector3f *in, 244 const GLfloat *lengths, 245 const GLubyte mask[], 246 GLvector3f *dest ) 247 247 { 248 248 GLuint i; … … 260 260 STRIDE_LOOP { 261 261 CULL_CHECK { 262 GLfloat ux = from[0], uy = from[1], uz = from[2];263 out[i][0] = ux * m0;264 out[i][1] = uy * m5;265 out[i][2] = uz * m10;266 } 267 } 268 dest->count = in->count; 269 } 270 271 static void TAG(transform_normals)( const GLmatrix *mat,272 GLfloat scale,273 const GLvector3f *in,274 const GLfloat *lengths,275 const GLubyte mask[],276 GLvector3f *dest )262 GLfloat ux = from[0], uy = from[1], uz = from[2]; 263 out[i][0] = ux * m0; 264 out[i][1] = uy * m5; 265 out[i][2] = uz * m10; 266 } 267 } 268 dest->count = in->count; 269 } 270 271 static void _XFORMAPI TAG(transform_normals)( const GLmatrix *mat, 272 GLfloat scale, 273 const GLvector3f *in, 274 const GLfloat *lengths, 275 const GLubyte mask[], 276 GLvector3f *dest ) 277 277 { 278 278 GLuint i; … … 290 290 STRIDE_LOOP { 291 291 CULL_CHECK { 292 GLfloat ux = from[0], uy = from[1], uz = from[2];293 out[i][0] = ux * m0 + uy * m1 + uz * m2;294 out[i][1] = ux * m4 + uy * m5 + uz * m6;295 out[i][2] = ux * m8 + uy * m9 + uz * m10;296 } 297 } 298 dest->count = in->count; 299 } 300 301 302 static void TAG(normalize_normals)( const GLmatrix *mat,303 GLfloat scale,304 const GLvector3f *in,305 const GLfloat *lengths,306 const GLubyte mask[],307 GLvector3f *dest )292 GLfloat ux = from[0], uy = from[1], uz = from[2]; 293 out[i][0] = ux * m0 + uy * m1 + uz * m2; 294 out[i][1] = ux * m4 + uy * m5 + uz * m6; 295 out[i][2] = ux * m8 + uy * m9 + uz * m10; 296 } 297 } 298 dest->count = in->count; 299 } 300 301 302 static void _XFORMAPI TAG(normalize_normals)( const GLmatrix *mat, 303 GLfloat scale, 304 const GLvector3f *in, 305 const GLfloat *lengths, 306 const GLubyte mask[], 307 GLvector3f *dest ) 308 308 { 309 309 GLuint i; … … 317 317 if (lengths) { 318 318 STRIDE_LOOP { 319 CULL_CHECK {320 const GLfloat x = from[0], y = from[1], z = from[2];321 GLfloat invlen = lengths[i];322 out[i][0] = x * invlen;323 out[i][1] = y * invlen;324 out[i][2] = z * invlen;325 } 319 CULL_CHECK { 320 const GLfloat x = from[0], y = from[1], z = from[2]; 321 GLfloat invlen = lengths[i]; 322 out[i][0] = x * invlen; 323 out[i][1] = y * invlen; 324 out[i][2] = z * invlen; 325 } 326 326 } 327 327 } 328 328 else { 329 329 STRIDE_LOOP { 330 CULL_CHECK {331 const GLfloat x = from[0], y = from[1], z = from[2];332 GLdouble len = x * x + y * y + z * z;333 if (len > 1e-50) {334 len = 1.0 / GL_SQRT(len);335 out[i][0] = (GLfloat) (x * len);336 out[i][1] = (GLfloat) (y * len);337 out[i][2] = (GLfloat) (z * len);338 }339 else {340 out[i][0] = x;341 out[i][1] = y;342 out[i][2] = z;343 }344 } 345 } 346 } 347 dest->count = in->count; 348 } 349 350 351 static void TAG(rescale_normals)( const GLmatrix *mat,352 GLfloat scale,353 const GLvector3f *in,354 const GLfloat *lengths,355 const GLubyte mask[],356 GLvector3f *dest )330 CULL_CHECK { 331 const GLfloat x = from[0], y = from[1], z = from[2]; 332 GLdouble len = x * x + y * y + z * z; 333 if (len > 1e-50) { 334 len = 1.0 / GL_SQRT(len); 335 out[i][0] = (GLfloat) (x * len); 336 out[i][1] = (GLfloat) (y * len); 337 out[i][2] = (GLfloat) (z * len); 338 } 339 else { 340 out[i][0] = x; 341 out[i][1] = y; 342 out[i][2] = z; 343 } 344 } 345 } 346 } 347 dest->count = in->count; 348 } 349 350 351 static void _XFORMAPI TAG(rescale_normals)( const GLmatrix *mat, 352 GLfloat scale, 353 const GLvector3f *in, 354 const GLfloat *lengths, 355 const GLubyte mask[], 356 GLvector3f *dest ) 357 357 { 358 358 GLuint i; … … 367 367 STRIDE_LOOP { 368 368 CULL_CHECK { 369 SCALE_SCALAR_3V( out[i], scale, from );370 } 371 } 372 dest->count = in->count; 373 } 374 375 376 static void TAG(init_c_norm_transform)( void )369 SCALE_SCALAR_3V( out[i], scale, from ); 370 } 371 } 372 dest->count = in->count; 373 } 374 375 376 static void _XFORMAPI TAG(init_c_norm_transform)( void ) 377 377 { 378 378 gl_normal_tab[NORM_TRANSFORM_NO_ROT][IDX] = -
trunk/src/opengl/mesa/pb.h
r2938 r3597 1 /* $Id: pb.h,v 1. 1 2000-02-29 00:48:35 sandervlExp $ */1 /* $Id: pb.h,v 1.2 2000-05-23 20:34:54 jeroen Exp $ */ 2 2 3 3 /* 4 4 * Mesa 3-D graphics library 5 * Version: 3. 15 * Version: 3.3 6 6 * 7 7 * Copyright (C) 1999 Brian Paul All Rights Reserved. … … 36 36 37 37 38 39 38 /* 40 39 * Pixel buffer size, must be larger than MAX_WIDTH. … … 44 43 45 44 struct pixel_buffer { 46 GLint x[PB_SIZE]; /* X window coord in [0,MAX_WIDTH) */47 GLint y[PB_SIZE]; /* Y window coord in [0,MAX_HEIGHT) */48 GLdepth z[PB_SIZE]; /* Z window coord in [0,MAX_DEPTH] */49 GLubyte rgba[PB_SIZE][4]; /* Colors */50 GLubyte spec[PB_SIZE][3]; /* Separate specular colors */51 GLuint i[PB_SIZE]; /* Index */52 GLfloat s[MAX_TEXTURE_UNITS][PB_SIZE];/* Texture S coordinates */53 GLfloat t[MAX_TEXTURE_UNITS][PB_SIZE];/* Texture T coordinates */54 GLfloat u[MAX_TEXTURE_UNITS][PB_SIZE];/* Texture R coordinates */55 GLfloat lambda[MAX_TEXTURE_UNITS][PB_SIZE];/* Texture lambda values */56 GLint color[4];/* Mono color, integers! */57 GLuint index;/* Mono index */58 GLuint count;/* Number of pixels in buffer */59 GLboolean mono;/* Same color or index for all pixels? */60 GLenum primitive;/* GL_POINT, GL_LINE, GL_POLYGON or GL_BITMAP*/45 GLint x[PB_SIZE]; /* X window coord in [0,MAX_WIDTH) */ 46 GLint y[PB_SIZE]; /* Y window coord in [0,MAX_HEIGHT) */ 47 GLdepth z[PB_SIZE]; /* Z window coord in [0,Visual.MaxDepth] */ 48 GLubyte rgba[PB_SIZE][4]; /* Colors */ 49 GLubyte spec[PB_SIZE][3]; /* Separate specular colors */ 50 GLuint i[PB_SIZE]; /* Index */ 51 GLfloat s[MAX_TEXTURE_UNITS][PB_SIZE]; /* Texture S coordinates */ 52 GLfloat t[MAX_TEXTURE_UNITS][PB_SIZE]; /* Texture T coordinates */ 53 GLfloat u[MAX_TEXTURE_UNITS][PB_SIZE]; /* Texture R coordinates */ 54 GLfloat lambda[MAX_TEXTURE_UNITS][PB_SIZE];/* Texture lambda values */ 55 GLint color[4]; /* Mono color, integers! */ 56 GLuint index; /* Mono index */ 57 GLuint count; /* Number of pixels in buffer */ 58 GLboolean mono; /* Same color or index for all pixels? */ 59 GLenum primitive; /* GL_POINT, GL_LINE, GL_POLYGON or GL_BITMAP*/ 61 60 }; 62 63 64 61 65 62 … … 68 65 * Set the color used for all subsequent pixels in the buffer. 69 66 */ 70 #define PB_SET_COLOR( CTX, PB, R, G, B, A ) \71 if ((PB)->color[RCOMP]!=(R) || (PB)->color[GCOMP]!=(G)\72 || (PB)->color[BCOMP]!=(B) || (PB)->color[ACOMP]!=(A)\73 || !(PB)->mono) {\74 gl_flush_pb( ctx );\75 }\76 (PB)->color[RCOMP] = R;\77 (PB)->color[GCOMP] = G;\78 (PB)->color[BCOMP] = B;\79 (PB)->color[ACOMP] = A;\80 (PB)->mono = GL_TRUE;67 #define PB_SET_COLOR( CTX, PB, R, G, B, A ) \ 68 if ((PB)->color[RCOMP]!=(R) || (PB)->color[GCOMP]!=(G) \ 69 || (PB)->color[BCOMP]!=(B) || (PB)->color[ACOMP]!=(A) \ 70 || !(PB)->mono) { \ 71 gl_flush_pb( ctx ); \ 72 } \ 73 (PB)->color[RCOMP] = R; \ 74 (PB)->color[GCOMP] = G; \ 75 (PB)->color[BCOMP] = B; \ 76 (PB)->color[ACOMP] = A; \ 77 (PB)->mono = GL_TRUE; 81 78 82 79 … … 84 81 * Set the color index used for all subsequent pixels in the buffer. 85 82 */ 86 #define PB_SET_INDEX( CTX, PB, I ) \87 if ((PB)->index!=(I) || !(PB)->mono) {\88 gl_flush_pb( CTX );\89 }\90 (PB)->index = I;\91 (PB)->mono = GL_TRUE;83 #define PB_SET_INDEX( CTX, PB, I ) \ 84 if ((PB)->index!=(I) || !(PB)->mono) { \ 85 gl_flush_pb( CTX ); \ 86 } \ 87 (PB)->index = I; \ 88 (PB)->mono = GL_TRUE; 92 89 93 90 … … 95 92 * "write" a pixel using current color or index 96 93 */ 97 #define PB_WRITE_PIXEL( PB, X, Y, Z ) \98 (PB)->x[(PB)->count] = X;\99 (PB)->y[(PB)->count] = Y;\100 (PB)->z[(PB)->count] = Z;\101 (PB)->count++;94 #define PB_WRITE_PIXEL( PB, X, Y, Z ) \ 95 (PB)->x[(PB)->count] = X; \ 96 (PB)->y[(PB)->count] = Y; \ 97 (PB)->z[(PB)->count] = Z; \ 98 (PB)->count++; 102 99 103 100 … … 105 102 * "write" an RGBA pixel 106 103 */ 107 #define PB_WRITE_RGBA_PIXEL( PB, X, Y, Z, R, G, B, A ) \108 (PB)->x[(PB)->count] = X;\109 (PB)->y[(PB)->count] = Y;\110 (PB)->z[(PB)->count] = Z;\111 (PB)->rgba[(PB)->count][RCOMP] = R;\112 (PB)->rgba[(PB)->count][GCOMP] = G;\113 (PB)->rgba[(PB)->count][BCOMP] = B;\114 (PB)->rgba[(PB)->count][ACOMP] = A;\115 (PB)->count++;104 #define PB_WRITE_RGBA_PIXEL( PB, X, Y, Z, R, G, B, A ) \ 105 (PB)->x[(PB)->count] = X; \ 106 (PB)->y[(PB)->count] = Y; \ 107 (PB)->z[(PB)->count] = Z; \ 108 (PB)->rgba[(PB)->count][RCOMP] = R; \ 109 (PB)->rgba[(PB)->count][GCOMP] = G; \ 110 (PB)->rgba[(PB)->count][BCOMP] = B; \ 111 (PB)->rgba[(PB)->count][ACOMP] = A; \ 112 (PB)->count++; 116 113 117 114 /* 118 115 * "write" a color-index pixel 119 116 */ 120 #define PB_WRITE_CI_PIXEL( PB, X, Y, Z, I ) \121 (PB)->x[(PB)->count] = X;\122 (PB)->y[(PB)->count] = Y;\123 (PB)->z[(PB)->count] = Z;\124 (PB)->i[(PB)->count] = I;\125 (PB)->count++;117 #define PB_WRITE_CI_PIXEL( PB, X, Y, Z, I ) \ 118 (PB)->x[(PB)->count] = X; \ 119 (PB)->y[(PB)->count] = Y; \ 120 (PB)->z[(PB)->count] = Z; \ 121 (PB)->i[(PB)->count] = I; \ 122 (PB)->count++; 126 123 127 124 … … 129 126 * "write" an RGBA pixel with texture coordinates 130 127 */ 131 #define PB_WRITE_TEX_PIXEL( PB, X, Y, Z, R, G, B, A, S, T, U ) \132 (PB)->x[(PB)->count] = X;\133 (PB)->y[(PB)->count] = Y;\134 (PB)->z[(PB)->count] = Z;\135 (PB)->rgba[(PB)->count][RCOMP] = R;\136 (PB)->rgba[(PB)->count][GCOMP] = G;\137 (PB)->rgba[(PB)->count][BCOMP] = B;\138 (PB)->rgba[(PB)->count][ACOMP] = A;\139 (PB)->s[0][(PB)->count] = S;\140 (PB)->t[0][(PB)->count] = T;\141 (PB)->u[0][(PB)->count] = U;\142 (PB)->count++;128 #define PB_WRITE_TEX_PIXEL( PB, X, Y, Z, R, G, B, A, S, T, U ) \ 129 (PB)->x[(PB)->count] = X; \ 130 (PB)->y[(PB)->count] = Y; \ 131 (PB)->z[(PB)->count] = Z; \ 132 (PB)->rgba[(PB)->count][RCOMP] = R; \ 133 (PB)->rgba[(PB)->count][GCOMP] = G; \ 134 (PB)->rgba[(PB)->count][BCOMP] = B; \ 135 (PB)->rgba[(PB)->count][ACOMP] = A; \ 136 (PB)->s[0][(PB)->count] = S; \ 137 (PB)->t[0][(PB)->count] = T; \ 138 (PB)->u[0][(PB)->count] = U; \ 139 (PB)->count++; 143 140 144 141 /* 145 142 * "write" an RGBA pixel with multiple texture coordinates 146 143 */ 147 #define PB_WRITE_MULTITEX_PIXEL( PB, X, Y, Z, R, G, B, A, S, T, U, S1, T1, U1 ) \148 (PB)->x[(PB)->count] = X;\149 (PB)->y[(PB)->count] = Y;\150 (PB)->z[(PB)->count] = Z;\151 (PB)->rgba[(PB)->count][RCOMP] = R;\152 (PB)->rgba[(PB)->count][GCOMP] = G;\153 (PB)->rgba[(PB)->count][BCOMP] = B;\154 (PB)->rgba[(PB)->count][ACOMP] = A;\155 (PB)->s[0][(PB)->count] = S;\156 (PB)->t[0][(PB)->count] = T;\157 (PB)->u[0][(PB)->count] = U;\158 (PB)->s[1][(PB)->count] = S1;\159 (PB)->t[1][(PB)->count] = T1;\160 (PB)->u[1][(PB)->count] = U1;\161 (PB)->count++;144 #define PB_WRITE_MULTITEX_PIXEL( PB, X, Y, Z, R, G, B, A, S, T, U, S1, T1, U1 ) \ 145 (PB)->x[(PB)->count] = X; \ 146 (PB)->y[(PB)->count] = Y; \ 147 (PB)->z[(PB)->count] = Z; \ 148 (PB)->rgba[(PB)->count][RCOMP] = R; \ 149 (PB)->rgba[(PB)->count][GCOMP] = G; \ 150 (PB)->rgba[(PB)->count][BCOMP] = B; \ 151 (PB)->rgba[(PB)->count][ACOMP] = A; \ 152 (PB)->s[0][(PB)->count] = S; \ 153 (PB)->t[0][(PB)->count] = T; \ 154 (PB)->u[0][(PB)->count] = U; \ 155 (PB)->s[1][(PB)->count] = S1; \ 156 (PB)->t[1][(PB)->count] = T1; \ 157 (PB)->u[1][(PB)->count] = U1; \ 158 (PB)->count++; 162 159 163 160 /* 164 161 * "write" an RGBA pixel with multiple texture coordinates and specular color 165 162 */ 166 #define PB_WRITE_MULTITEX_SPEC_PIXEL( PB, X, Y, Z, R, G, B, A, \167 SR, SG, SB, S, T, U, S1, T1, U1 )\168 (PB)->x[(PB)->count] = X;\169 (PB)->y[(PB)->count] = Y;\170 (PB)->z[(PB)->count] = Z;\171 (PB)->rgba[(PB)->count][RCOMP] = R;\172 (PB)->rgba[(PB)->count][GCOMP] = G;\173 (PB)->rgba[(PB)->count][BCOMP] = B;\174 (PB)->rgba[(PB)->count][ACOMP] = A;\175 (PB)->spec[(PB)->count][RCOMP] = SR;\176 (PB)->spec[(PB)->count][GCOMP] = SG;\177 (PB)->spec[(PB)->count][BCOMP] = SB;\178 (PB)->s[0][(PB)->count] = S;\179 (PB)->t[0][(PB)->count] = T;\180 (PB)->u[0][(PB)->count] = U;\181 (PB)->s[1][(PB)->count] = S1;\182 (PB)->t[1][(PB)->count] = T1;\183 (PB)->u[1][(PB)->count] = U1;\184 (PB)->count++;163 #define PB_WRITE_MULTITEX_SPEC_PIXEL( PB, X, Y, Z, R, G, B, A, \ 164 SR, SG, SB, S, T, U, S1, T1, U1 ) \ 165 (PB)->x[(PB)->count] = X; \ 166 (PB)->y[(PB)->count] = Y; \ 167 (PB)->z[(PB)->count] = Z; \ 168 (PB)->rgba[(PB)->count][RCOMP] = R; \ 169 (PB)->rgba[(PB)->count][GCOMP] = G; \ 170 (PB)->rgba[(PB)->count][BCOMP] = B; \ 171 (PB)->rgba[(PB)->count][ACOMP] = A; \ 172 (PB)->spec[(PB)->count][RCOMP] = SR; \ 173 (PB)->spec[(PB)->count][GCOMP] = SG; \ 174 (PB)->spec[(PB)->count][BCOMP] = SB; \ 175 (PB)->s[0][(PB)->count] = S; \ 176 (PB)->t[0][(PB)->count] = T; \ 177 (PB)->u[0][(PB)->count] = U; \ 178 (PB)->s[1][(PB)->count] = S1; \ 179 (PB)->t[1][(PB)->count] = T1; \ 180 (PB)->u[1][(PB)->count] = U1; \ 181 (PB)->count++; 185 182 186 183 … … 189 186 * Call this function at least every MAX_WIDTH pixels: 190 187 */ 191 #define PB_CHECK_FLUSH( CTX, PB ) \192 do { \193 if ((PB)->count>=PB_SIZE-MAX_WIDTH) {\194 gl_flush_pb( CTX );\195 }\188 #define PB_CHECK_FLUSH( CTX, PB ) \ 189 do { \ 190 if ((PB)->count>=PB_SIZE-MAX_WIDTH) { \ 191 gl_flush_pb( CTX ); \ 192 } \ 196 193 } while(0) 197 194 -
trunk/src/opengl/mesa/pixel.h
r2938 r3597 1 /* $Id: pixel.h,v 1. 1 2000-02-29 00:48:35 sandervlExp $ */1 /* $Id: pixel.h,v 1.2 2000-05-23 20:34:54 jeroen Exp $ */ 2 2 3 3 /* 4 4 * Mesa 3-D graphics library 5 * Version: 3. 15 * Version: 3.3 6 6 * 7 7 * Copyright (C) 1999 Brian Paul All Rights Reserved. … … 41 41 42 42 43 extern void gl_GetPixelMapfv( GLcontext *ctx, GLenum map, GLfloat *values ); 43 extern void 44 _mesa_GetPixelMapfv( GLenum map, GLfloat *values ); 44 45 45 extern void gl_GetPixelMapuiv( GLcontext *ctx, GLenum map, GLuint *values ); 46 extern void 47 _mesa_GetPixelMapuiv( GLenum map, GLuint *values ); 46 48 47 extern void gl_GetPixelMapusv( GLcontext *ctx, GLenum map, GLushort *values ); 49 extern void 50 _mesa_GetPixelMapusv( GLenum map, GLushort *values ); 48 51 52 extern void 53 _mesa_PixelMapfv( GLenum map, GLint mapsize, const GLfloat *values ); 49 54 50 extern void gl_PixelMapfv( GLcontext *ctx,51 GLenum map, GLint mapsize, const GLfloat *values );55 extern void 56 _mesa_PixelMapuiv(GLenum map, GLint mapsize, const GLuint *values ); 52 57 53 extern void gl_PixelStorei( GLcontext *ctx, GLenum pname, GLint param ); 58 extern void 59 _mesa_PixelMapusv(GLenum map, GLint mapsize, const GLushort *values ); 54 60 55 extern void gl_PixelTransferf( GLcontext *ctx, GLenum pname, GLfloat param ); 61 extern void 62 _mesa_PixelStoref( GLenum pname, GLfloat param ); 56 63 57 extern void gl_PixelZoom( GLcontext *ctx, GLfloat xfactor, GLfloat yfactor ); 64 extern void 65 _mesa_PixelStorei( GLenum pname, GLint param ); 66 67 extern void 68 _mesa_PixelTransferf( GLenum pname, GLfloat param ); 69 70 extern void 71 _mesa_PixelTransferi( GLenum pname, GLint param ); 72 73 extern void 74 _mesa_PixelZoom( GLfloat xfactor, GLfloat yfactor ); 75 58 76 59 77 -
trunk/src/opengl/mesa/points.h
r2938 r3597 1 /* $Id: points.h,v 1. 1 2000-02-29 00:48:35 sandervlExp $ */1 /* $Id: points.h,v 1.2 2000-05-23 20:34:54 jeroen Exp $ */ 2 2 3 3 /* 4 4 * Mesa 3-D graphics library 5 * Version: 3. 15 * Version: 3.3 6 6 * 7 7 * Copyright (C) 1999 Brian Paul All Rights Reserved. … … 36 36 37 37 38 extern void gl_PointSize( GLcontext *ctx, GLfloat size ); 38 extern void 39 _mesa_PointSize( GLfloat size ); 40 41 42 extern void 43 _mesa_PointParameterfEXT( GLenum pname, GLfloat param); 44 45 46 extern void 47 _mesa_PointParameterfvEXT( GLenum pname, const GLfloat *params ); 48 39 49 40 50 extern void gl_set_point_function( GLcontext *ctx ); 41 51 42 extern void gl_PointParameterfvEXT( GLcontext *ctx, GLenum pname,43 const GLfloat *params );44 52 45 53 #endif -
trunk/src/opengl/mesa/polygon.h
r2938 r3597 1 /* $Id: polygon.h,v 1. 1 2000-02-29 00:48:36 sandervlExp $ */1 /* $Id: polygon.h,v 1.2 2000-05-23 20:34:54 jeroen Exp $ */ 2 2 3 3 /* 4 4 * Mesa 3-D graphics library 5 * Version: 3. 15 * Version: 3.3 6 6 * 7 7 * Copyright (C) 1999 Brian Paul All Rights Reserved. … … 36 36 37 37 38 extern void gl_CullFace( GLcontext *ctx, GLenum mode ); 38 extern void 39 _mesa_CullFace( GLenum mode ); 39 40 40 extern void gl_FrontFace( GLcontext *ctx, GLenum mode ); 41 extern void 42 _mesa_FrontFace( GLenum mode ); 41 43 42 extern void gl_PolygonMode( GLcontext *ctx, GLenum face, GLenum mode ); 44 extern void 45 _mesa_PolygonMode( GLenum face, GLenum mode ); 43 46 44 extern void gl_PolygonOffset( GLcontext *ctx,45 GLfloat factor, GLfloat units );47 extern void 48 _mesa_PolygonOffset( GLfloat factor, GLfloat units ); 46 49 47 extern void gl_PolygonStipple( GLcontext *ctx, const GLuint pattern[32] ); 50 extern void 51 _mesa_PolygonOffsetEXT( GLfloat factor, GLfloat bias ); 48 52 49 extern void gl_GetPolygonStipple( GLcontext *ctx, GLubyte *mask ); 53 extern void 54 _mesa_PolygonStipple( const GLubyte *mask ); 55 56 extern void 57 _mesa_GetPolygonStipple( GLubyte *mask ); 50 58 51 59 -
trunk/src/opengl/mesa/rastpos.h
r2938 r3597 1 /* $Id: rastpos.h,v 1. 1 2000-02-29 00:48:36 sandervlExp $ */1 /* $Id: rastpos.h,v 1.2 2000-05-23 20:34:54 jeroen Exp $ */ 2 2 3 3 /* 4 4 * Mesa 3-D graphics library 5 * Version: 3. 15 * Version: 3.3 6 6 * 7 7 * Copyright (C) 1999 Brian Paul All Rights Reserved. … … 36 36 37 37 38 extern void gl_RasterPos4f( GLcontext *ctx,39 GLfloat x, GLfloat y, GLfloat z, GLfloat w);38 extern void 39 _mesa_RasterPos2d(GLdouble x, GLdouble y); 40 40 41 extern void 42 _mesa_RasterPos2f(GLfloat x, GLfloat y); 41 43 42 extern void gl_windowpos( GLcontext *ctx,43 GLfloat x, GLfloat y, GLfloat z, GLfloat w);44 extern void 45 _mesa_RasterPos2i(GLint x, GLint y); 44 46 47 extern void 48 _mesa_RasterPos2s(GLshort x, GLshort y); 49 50 extern void 51 _mesa_RasterPos3d(GLdouble x, GLdouble y, GLdouble z); 52 53 extern void 54 _mesa_RasterPos3f(GLfloat x, GLfloat y, GLfloat z); 55 56 extern void 57 _mesa_RasterPos3i(GLint x, GLint y, GLint z); 58 59 extern void 60 _mesa_RasterPos3s(GLshort x, GLshort y, GLshort z); 61 62 extern void 63 _mesa_RasterPos4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w); 64 65 extern void 66 _mesa_RasterPos4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w); 67 68 extern void 69 _mesa_RasterPos4i(GLint x, GLint y, GLint z, GLint w); 70 71 extern void 72 _mesa_RasterPos4s(GLshort x, GLshort y, GLshort z, GLshort w); 73 74 extern void 75 _mesa_RasterPos2dv(const GLdouble *v); 76 77 extern void 78 _mesa_RasterPos2fv(const GLfloat *v); 79 80 extern void 81 _mesa_RasterPos2iv(const GLint *v); 82 83 extern void 84 _mesa_RasterPos2sv(const GLshort *v); 85 86 extern void 87 _mesa_RasterPos3dv(const GLdouble *v); 88 89 extern void 90 _mesa_RasterPos3fv(const GLfloat *v); 91 92 extern void 93 _mesa_RasterPos3iv(const GLint *v); 94 95 extern void 96 _mesa_RasterPos3sv(const GLshort *v); 97 98 extern void 99 _mesa_RasterPos4dv(const GLdouble *v); 100 101 extern void 102 _mesa_RasterPos4fv(const GLfloat *v); 103 104 extern void 105 _mesa_RasterPos4iv(const GLint *v); 106 107 extern void 108 _mesa_RasterPos4sv(const GLshort *v); 45 109 46 110 -
trunk/src/opengl/mesa/readpix.h
r2938 r3597 1 /* $Id: readpix.h,v 1. 1 2000-02-29 00:48:36 sandervlExp $ */1 /* $Id: readpix.h,v 1.2 2000-05-23 20:34:55 jeroen Exp $ */ 2 2 3 3 /* 4 4 * Mesa 3-D graphics library 5 * Version: 3. 15 * Version: 3.3 6 6 * 7 7 * Copyright (C) 1999 Brian Paul All Rights Reserved. … … 35 35 #include "types.h" 36 36 37 38 extern void gl_ReadPixels( GLcontext *ctx, 39 GLint x, GLint y, GLsizei width, GLsizei height, 40 GLenum format, GLenum type, GLvoid *pixels ); 37 extern void 38 _mesa_ReadPixels( GLint x, GLint y, GLsizei width, GLsizei height, 39 GLenum format, GLenum type, GLvoid *pixels ); 41 40 42 41 -
trunk/src/opengl/mesa/rect.h
r2938 r3597 1 /* $Id: rect.h,v 1. 1 2000-02-29 00:48:36 sandervlExp $ */1 /* $Id: rect.h,v 1.2 2000-05-23 20:34:55 jeroen Exp $ */ 2 2 3 3 /* 4 4 * Mesa 3-D graphics library 5 * Version: 3. 15 * Version: 3.3 6 6 * 7 7 * Copyright (C) 1999 Brian Paul All Rights Reserved. … … 33 33 34 34 35 #include " types.h"35 #include "glheader.h" 36 36 37 37 38 extern void gl_Rectf( GLcontext *ctx, 39 GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 ); 38 extern void 39 _mesa_Rectd(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2); 40 41 extern void 42 _mesa_Rectdv(const GLdouble *v1, const GLdouble *v2); 43 44 extern void 45 _mesa_Rectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2); 46 47 extern void 48 _mesa_Rectfv(const GLfloat *v1, const GLfloat *v2); 49 50 extern void 51 _mesa_Recti(GLint x1, GLint y1, GLint x2, GLint y2); 52 53 extern void 54 _mesa_Rectiv(const GLint *v1, const GLint *v2); 55 56 extern void 57 _mesa_Rects(GLshort x1, GLshort y1, GLshort x2, GLshort y2); 58 59 extern void 60 _mesa_Rectsv(const GLshort *v1, const GLshort *v2); 61 40 62 41 63 -
trunk/src/opengl/mesa/render_tmp.h
r2938 r3597 1 /* $Id: render_tmp.h,v 1. 1 2000-02-29 00:48:37 sandervlExp $ */1 /* $Id: render_tmp.h,v 1.2 2000-05-23 20:34:55 jeroen Exp $ */ 2 2 3 3 /* … … 40 40 #define NEED_EDGEFLAG_SETUP 0 41 41 #define EDGEFLAG_TRI(a,b,c,d,e) 42 #define EDGEFLAG_POLY_TRI_PRE(a,b,c,d) 43 #define EDGEFLAG_POLY_TRI_POST(a,b,c,d) 42 44 #define EDGEFLAG_QUAD(a,b,c,d,e) 43 45 #endif … … 49 51 50 52 static void TAG(render_vb_points)( struct vertex_buffer *VB, 51 GLuint start,52 GLuint count,53 GLuint parity )53 GLuint start, 54 GLuint count, 55 GLuint parity ) 54 56 { 55 57 LOCAL_VARS; … … 61 63 62 64 static void TAG(render_vb_lines)( struct vertex_buffer *VB, 63 GLuint start,64 GLuint count,65 GLuint parity )65 GLuint start, 66 GLuint count, 67 GLuint parity ) 66 68 { 67 69 GLuint j; … … 79 81 80 82 static void TAG(render_vb_line_strip)( struct vertex_buffer *VB, 81 GLuint start,82 GLuint count,83 GLuint parity )83 GLuint start, 84 GLuint count, 85 GLuint parity ) 84 86 { 85 87 GLuint j; … … 91 93 RENDER_LINE( j-1, j ); 92 94 } 93 RESET_STIPPLE; 95 96 if (VB->Flag[count] & VERT_END) { 97 RESET_STIPPLE; 98 } 94 99 POSTFIX; 95 100 } … … 97 102 98 103 static void TAG(render_vb_line_loop)( struct vertex_buffer *VB, 99 GLuint start,100 GLuint count,101 GLuint parity )102 { 103 GLuint i = start < VB->Start ? VB->Start : start + 1; 104 GLuint start, 105 GLuint count, 106 GLuint parity ) 107 { 108 GLuint i = start < VB->Start ? VB->Start : start + 1; 104 109 LOCAL_VARS; 105 110 (void) parity; … … 112 117 if (VB->Flag[count] & VERT_END) { 113 118 RENDER_LINE( i-1, start ); 114 }115 116 RESET_STIPPLE; 119 RESET_STIPPLE; 120 } 121 117 122 POSTFIX; 118 123 } … … 120 125 121 126 static void TAG(render_vb_triangles)( struct vertex_buffer *VB, 122 GLuint start,123 GLuint count,124 GLuint parity )127 GLuint start, 128 GLuint count, 129 GLuint parity ) 125 130 { 126 131 GLuint j; … … 139 144 140 145 static void TAG(render_vb_tri_strip)( struct vertex_buffer *VB, 141 GLuint start,142 GLuint count,143 GLuint parity )146 GLuint start, 147 GLuint count, 148 GLuint parity ) 144 149 { 145 150 GLuint j; … … 149 154 if (NEED_EDGEFLAG_SETUP) { 150 155 for (j=start+2;j<count;j++,parity^=1) { 151 EDGEFLAG_TRI( j-2, j-1, j, j, parity );152 RENDER_TRI( j-2, j-1, j, j, parity );153 RESET_STIPPLE;156 EDGEFLAG_TRI( j-2, j-1, j, j, parity ); 157 RENDER_TRI( j-2, j-1, j, j, parity ); 158 RESET_STIPPLE; 154 159 } 155 160 } else { 156 161 for (j=start+2;j<count;j++,parity^=1) { 157 RENDER_TRI( j-2, j-1, j, j, parity );162 RENDER_TRI( j-2, j-1, j, j, parity ); 158 163 } 159 164 } … … 163 168 164 169 static void TAG(render_vb_tri_fan)( struct vertex_buffer *VB, 165 GLuint start,166 GLuint count,167 GLuint parity )170 GLuint start, 171 GLuint count, 172 GLuint parity ) 168 173 { 169 174 GLuint j; … … 173 178 if (NEED_EDGEFLAG_SETUP) { 174 179 for (j=start+2;j<count;j++) { 175 EDGEFLAG_TRI( start, j-1, j, j, 0 );176 RENDER_TRI( start, j-1, j, j, 0 );177 RESET_STIPPLE;180 EDGEFLAG_TRI( start, j-1, j, j, 0 ); 181 RENDER_TRI( start, j-1, j, j, 0 ); 182 RESET_STIPPLE; 178 183 } 179 184 } else { 180 185 for (j=start+2;j<count;j++) { 181 RENDER_TRI( start, j-1, j, j, 0 );186 RENDER_TRI( start, j-1, j, j, 0 ); 182 187 } 183 188 } … … 188 193 189 194 static void TAG(render_vb_poly)( struct vertex_buffer *VB, 190 GLuint start, 191 GLuint count, 192 GLuint parity ) 193 { 194 GLuint j; 195 LOCAL_VARS; 196 (void) parity; 197 INIT(GL_POLYGON); 198 for (j=start+2;j<count;j++) { 199 RENDER_TRI( start, j-1, j, start, 0 ); 195 GLuint start, 196 GLuint count, 197 GLuint parity ) 198 { 199 GLuint j; 200 LOCAL_VARS; 201 (void) parity; 202 INIT(GL_POLYGON); 203 if (NEED_EDGEFLAG_SETUP) { 204 for (j=start+2;j<count;j++) { 205 EDGEFLAG_POLY_TRI_PRE( start, j-1, j, start ); 206 RENDER_TRI( start, j-1, j, start, 0 ); 207 EDGEFLAG_POLY_TRI_POST( start, j-1, j, start ); 208 } 209 } 210 else { 211 for (j=start+2;j<count;j++) { 212 RENDER_TRI( start, j-1, j, start, 0 ); 213 } 200 214 } 201 215 RESET_STIPPLE; … … 205 219 206 220 static void TAG(render_vb_quads)( struct vertex_buffer *VB, 207 GLuint start,208 GLuint count,209 GLuint parity )221 GLuint start, 222 GLuint count, 223 GLuint parity ) 210 224 { 211 225 GLuint j; … … 221 235 222 236 static void TAG(render_vb_quad_strip)( struct vertex_buffer *VB, 223 GLuint start,224 GLuint count,225 GLuint parity )237 GLuint start, 238 GLuint count, 239 GLuint parity ) 226 240 { 227 241 GLuint j; … … 231 245 if (NEED_EDGEFLAG_SETUP) { 232 246 for (j=start+3;j<count;j+=2) { 233 EDGEFLAG_QUAD( j-3, j-2, j, j-1, j );234 RENDER_QUAD( j-3, j-2, j, j-1, j );235 RESET_STIPPLE;247 EDGEFLAG_QUAD( j-3, j-2, j, j-1, j ); 248 RENDER_QUAD( j-3, j-2, j, j-1, j ); 249 RESET_STIPPLE; 236 250 } 237 251 } else { 238 252 for (j=start+3;j<count;j+=2) { 239 RENDER_QUAD( j-3, j-2, j, j-1, j );253 RENDER_QUAD( j-3, j-2, j, j-1, j ); 240 254 } 241 255 } … … 244 258 245 259 static void TAG(render_vb_noop)( struct vertex_buffer *VB, 246 GLuint start,247 GLuint count,248 GLuint parity )260 GLuint start, 261 GLuint count, 262 GLuint parity ) 249 263 { 250 264 (void) VB; -
trunk/src/opengl/mesa/scissor.h
r2938 r3597 1 /* $Id: scissor.h,v 1. 1 2000-02-29 00:48:37 sandervlExp $ */1 /* $Id: scissor.h,v 1.2 2000-05-23 20:34:55 jeroen Exp $ */ 2 2 3 3 /* 4 4 * Mesa 3-D graphics library 5 * Version: 3. 15 * Version: 3.3 6 6 * 7 7 * Copyright (C) 1999 Brian Paul All Rights Reserved. … … 36 36 37 37 38 extern void gl_Scissor( GLcontext *ctx,39 GLint x, GLint y, GLsizei width, GLsizei height );38 extern void 39 _mesa_Scissor( GLint x, GLint y, GLsizei width, GLsizei height ); 40 40 41 41 42 extern GLint gl_scissor_span( GLcontext *ctx,43 GLuint n, GLint x, GLint y, GLubyte mask[] );42 extern GLint 43 gl_scissor_span( GLcontext *ctx, GLuint n, GLint x, GLint y, GLubyte mask[] ); 44 44 45 45 46 extern GLuint gl_scissor_pixels( GLcontext *ctx,47 GLuint n, const GLint x[], const GLint y[],48 GLubyte mask[] );46 extern GLuint 47 gl_scissor_pixels( GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], 48 GLubyte mask[] ); 49 49 50 50 -
trunk/src/opengl/mesa/shade_tmp.h
r2938 r3597 1 /* $Id: shade_tmp.h,v 1. 1 2000-02-29 00:48:37 sandervlExp $ */1 /* $Id: shade_tmp.h,v 1.2 2000-05-23 20:34:55 jeroen Exp $ */ 2 2 3 3 /* … … 29 29 */ 30 30 31 #ifdef __WIN32OS2__32 #include <misc.h>33 #endif34 35 31 static void TAG(shade_rgba_spec)( struct vertex_buffer *VB ) 36 32 { … … 139 135 } 140 136 141 d = LEN_3FV( VP );137 d = (GLfloat) LEN_3FV( VP ); 142 138 143 139 if (d > 1e-6) { … … 161 157 double x = PV_dot_dir * (EXP_TABLE_SIZE-1); 162 158 int k = (int) x; 163 GLfloat spot = ( light->SpotExpTable[k][0]159 GLfloat spot = (GLfloat) (light->SpotExpTable[k][0] 164 160 + (x-k)*light->SpotExpTable[k][1]); 165 161 attenuation *= spot; … … 238 234 239 235 if (n_dot_h>1.0) { 240 spec_coef = pow( n_dot_h, tab->shininess );236 spec_coef = (GLfloat) pow( n_dot_h, tab->shininess ); 241 237 } else 242 238 GET_SHINE_TAB_ENTRY( tab, n_dot_h, spec_coef ); … … 558 554 if (NR_SIDES == 2) COPY_3V(sum[1], base[1]); 559 555 560 #ifdef __WIN32OS2__ 561 dprintf(("light normal %d/%d, %f %f %f\n", 562 j, VB->Start, normal[0], normal[1], normal[2])); 563 #else 564 if (0) 565 /* if (ctx->Light.ShadeModel == GL_SMOOTH) */ 556 if (MESA_VERBOSE&VERBOSE_LIGHTING) 566 557 fprintf(stderr, "light normal %d/%d, %f %f %f\n", 567 558 j, VB->Start, normal[0], normal[1], normal[2]); 568 #endif 559 569 560 570 561 foreach (light, &ctx->Light.EnabledList) { -
trunk/src/opengl/mesa/span.h
r2938 r3597 1 /* $Id: span.h,v 1. 1 2000-02-29 00:48:38 sandervlExp $ */1 /* $Id: span.h,v 1.2 2000-05-23 20:34:56 jeroen Exp $ */ 2 2 3 3 /* … … 38 38 extern void gl_write_index_span( GLcontext *ctx, 39 39 GLuint n, GLint x, GLint y, const GLdepth z[], 40 GLuint index[], GLenum primitive );40 GLuint index[], GLenum primitive ); 41 41 42 42 … … 44 44 GLuint n, GLint x, GLint y, 45 45 const GLdepth z[], 46 GLuint index, GLenum primitive );46 GLuint index, GLenum primitive ); 47 47 48 48 … … 61 61 GLuint n, GLint x, GLint y, 62 62 const GLdepth z[], 63 const GLfloat s[], const GLfloat t[],63 const GLfloat s[], const GLfloat t[], 64 64 const GLfloat u[], GLfloat lambda[], 65 GLubyte rgba[][4], CONST GLubyte spec[][4],65 GLubyte rgba[][4], CONST GLubyte spec[][4], 66 66 GLenum primitive ); 67 67 68 68 69 extern void gl_write_multitexture_span( GLcontext *ctx, GLuint texSets, 70 GLuint n, GLint x, GLint y, 71 const GLdepth z[], 72 CONST GLfloat s[][MAX_WIDTH], 73 CONST GLfloat t[][MAX_WIDTH], 74 CONST GLfloat u[][MAX_WIDTH], 75 GLfloat lambda[][MAX_WIDTH], 76 GLubyte rgba[][4], 77 CONST GLubyte spec[][4], 78 GLenum primitive ); 69 extern void 70 gl_write_multitexture_span( GLcontext *ctx, GLuint texSets, 71 GLuint n, GLint x, GLint y, 72 const GLdepth z[], 73 CONST GLfloat s[MAX_TEXTURE_UNITS][MAX_WIDTH], 74 CONST GLfloat t[MAX_TEXTURE_UNITS][MAX_WIDTH], 75 CONST GLfloat u[MAX_TEXTURE_UNITS][MAX_WIDTH], 76 GLfloat lambda[MAX_TEXTURE_UNITS][MAX_WIDTH], 77 GLubyte rgba[][4], 78 CONST GLubyte spec[][4], 79 GLenum primitive ); 79 80 80 81 81 extern void gl_read_rgba_span( GLcontext *ctx, 82 extern void gl_read_rgba_span( GLcontext *ctx, GLframebuffer *buffer, 82 83 GLuint n, GLint x, GLint y, 83 84 GLubyte rgba[][4] ); 84 85 85 86 86 extern void gl_read_index_span( GLcontext *ctx, 87 extern void gl_read_index_span( GLcontext *ctx, GLframebuffer *buffer, 87 88 GLuint n, GLint x, GLint y, GLuint indx[] ); 88 89 -
trunk/src/opengl/mesa/stages.h
r2938 r3597 1 /* $Id: stages.h,v 1. 1 2000-02-29 00:48:38 sandervlExp $ */1 /* $Id: stages.h,v 1.2 2000-05-23 20:34:56 jeroen Exp $ */ 2 2 3 3 /* 4 4 * Mesa 3-D graphics library 5 * Version: 3. 15 * Version: 3.3 6 6 * 7 7 * Copyright (C) 1999 Brian Paul All Rights Reserved. … … 35 35 36 36 extern void gl_import_client_data( struct vertex_buffer *VB, 37 GLuint required,38 GLuint vec_flags );37 GLuint required, 38 GLuint vec_flags ); 39 39 40 40 #endif -
trunk/src/opengl/mesa/stencil.h
r2938 r3597 1 /* $Id: stencil.h,v 1. 1 2000-02-29 00:48:38 sandervlExp $ */1 /* $Id: stencil.h,v 1.2 2000-05-23 20:34:57 jeroen Exp $ */ 2 2 3 3 /* 4 4 * Mesa 3-D graphics library 5 * Version: 3. 15 * Version: 3.3 6 6 * 7 7 * Copyright (C) 1999 Brian Paul All Rights Reserved. … … 36 36 37 37 38 extern void gl_ClearStencil( GLcontext *ctx, GLint s ); 38 extern void 39 _mesa_ClearStencil( GLint s ); 39 40 40 41 41 extern void gl_StencilFunc( GLcontext *ctx, GLenum func,42 GLint ref, GLuint mask );42 extern void 43 _mesa_StencilFunc( GLenum func, GLint ref, GLuint mask ); 43 44 44 45 45 extern void gl_StencilMask( GLcontext *ctx, GLuint mask ); 46 extern void 47 _mesa_StencilMask( GLuint mask ); 46 48 47 49 48 extern void gl_StencilOp( GLcontext *ctx, GLenum fail,49 GLenum zfail, GLenum zpass );50 extern void 51 _mesa_StencilOp( GLenum fail, GLenum zfail, GLenum zpass ); 50 52 51 53 52 54 53 extern GLint gl_stencil_span( GLcontext *ctx, 54 GLuint n, GLint x, GLint y, GLubyte mask[] ); 55 extern GLboolean 56 gl_stencil_and_depth_test_span( GLcontext *ctx, GLuint n, GLint x, GLint y, 57 const GLdepth z[], GLubyte mask[] ); 58 59 #ifdef VMS /* VMS allows externals of 31 characters maximum */ 60 #define gl_stencil_and_depth_test_pixels gl_stencil_and_depth_test_pixel 61 #endif 62 extern GLboolean 63 gl_stencil_and_depth_test_pixels( GLcontext *ctx, GLuint n, 64 const GLint x[], const GLint y[], 65 const GLdepth z[], GLubyte mask[] ); 55 66 56 67 57 extern void gl_depth_stencil_span( GLcontext *ctx, GLuint n, GLint x, GLint y, 58 const GLdepth z[], GLubyte mask[] ); 68 69 extern void 70 gl_read_stencil_span( GLcontext *ctx, GLint n, GLint x, GLint y, 71 GLstencil stencil[] ); 59 72 60 73 61 extern GLint gl_stencil_pixels( GLcontext *ctx, 62 GLuint n, const GLint x[], const GLint y[], 63 GLubyte mask[] ); 64 65 66 extern void gl_depth_stencil_pixels( GLcontext *ctx, 67 GLuint n, const GLint x[], 68 const GLint y[], const GLdepth z[], 69 GLubyte mask[] ); 70 71 72 extern void gl_read_stencil_span( GLcontext *ctx, 73 GLuint n, GLint x, GLint y, 74 GLstencil stencil[] ); 75 76 77 extern void gl_write_stencil_span( GLcontext *ctx, 78 GLuint n, GLint x, GLint y, 79 const GLstencil stencil[] ); 74 extern void 75 gl_write_stencil_span( GLcontext *ctx, GLint n, GLint x, GLint y, 76 const GLstencil stencil[] ); 80 77 81 78 -
trunk/src/opengl/mesa/stereo.h
r2938 r3597 1 /* $Id: stereo.h,v 1. 1 2000-02-29 00:48:38 sandervlExp $ */1 /* $Id: stereo.h,v 1.2 2000-05-23 20:34:57 jeroen Exp $ */ 2 2 /* File name stereov.h 3 3 header file for stereo display driver … … 17 17 18 18 */ 19 #if defined( __WIN32__) || defined (WIN32)20 #include <windows.h>21 #endif22 23 #if defined(__WIN32OS2__)24 #include <os2win.h>25 #endif26 19 27 20 typedef enum VIEW_INDICATOR { FIRST, SECOND}; -
trunk/src/opengl/mesa/teximage.h
r2938 r3597 1 /* $Id: teximage.h,v 1. 1 2000-02-29 00:48:39 sandervlExp $ */1 /* $Id: teximage.h,v 1.2 2000-05-23 20:34:57 jeroen Exp $ */ 2 2 3 3 /* 4 4 * Mesa 3-D graphics library 5 * Version: 3. 15 * Version: 3.3 6 6 * 7 7 * Copyright (C) 1999 Brian Paul All Rights Reserved. … … 36 36 37 37 38 extern struct gl_texture_image *gl_alloc_texture_image( void ); 38 extern GLint 39 _mesa_base_tex_format( GLint format ); 39 40 40 41 41 extern void gl_free_texture_image( struct gl_texture_image *teximage ); 42 extern struct gl_texture_image * 43 gl_alloc_texture_image( void ); 44 45 46 extern void 47 gl_free_texture_image( struct gl_texture_image *teximage ); 42 48 43 49 44 50 45 46 /*** API entry points ***/ 51 /*** API entry point functions ***/ 47 52 48 53 49 extern void gl_TexImage1D( GLcontext *ctx,50 GLenum target, GLint level, GLint internalformat,51 GLsizei width, GLint border, GLenum format,52 GLenum type, const GLvoid *pixels );54 extern void 55 _mesa_TexImage1D( GLenum target, GLint level, GLint internalformat, 56 GLsizei width, GLint border, 57 GLenum format, GLenum type, const GLvoid *pixels ); 53 58 54 59 55 extern void gl_TexImage2D( GLcontext *ctx, 56 GLenum target, GLint level, GLint internalformat, 57 GLsizei width, GLsizei height, GLint border, 58 GLenum format, GLenum type, 59 const GLvoid *pixels ); 60 extern void 61 _mesa_TexImage2D( GLenum target, GLint level, GLint internalformat, 62 GLsizei width, GLsizei height, GLint border, 63 GLenum format, GLenum type, const GLvoid *pixels ); 60 64 61 65 62 extern void gl_TexImage3D( GLcontext *ctx, 63 GLenum target, GLint level, GLint internalformat, 64 GLsizei width, GLsizei height, GLsizei depth, 65 GLint border, GLenum format, GLenum type, 66 const GLvoid *pixels ); 66 extern void 67 _mesa_TexImage3D( GLenum target, GLint level, GLint internalformat, 68 GLsizei width, GLsizei height, GLsizei depth, GLint border, 69 GLenum format, GLenum type, const GLvoid *pixels ); 67 70 68 71 69 extern void gl_GetTexImage( GLcontext *ctx, GLenum target, GLint level, 70 GLenum format, GLenum type, GLvoid *pixels ); 72 extern void 73 _mesa_TexImage3DEXT( GLenum target, GLint level, GLenum internalformat, 74 GLsizei width, GLsizei height, GLsizei depth, 75 GLint border, GLenum format, GLenum type, 76 const GLvoid *pixels ); 71 77 72 78 73 74 extern void gl_TexSubImage1D( GLcontext *ctx, 75 GLenum target, GLint level, GLint xoffset, 76 GLsizei width, GLenum format, GLenum type, 77 const GLvoid *pixels ); 79 extern void 80 _mesa_GetTexImage( GLenum target, GLint level, 81 GLenum format, GLenum type, GLvoid *pixels ); 78 82 79 83 80 extern void gl_TexSubImage2D( GLcontext *ctx, 81 GLenum target, GLint level, 82 GLint xoffset, GLint yoffset, 83 GLsizei width, GLsizei height, 84 GLenum format, GLenum type, 85 const GLvoid *pixels ); 84 extern void 85 _mesa_TexSubImage1D( GLenum target, GLint level, GLint xoffset, 86 GLsizei width, 87 GLenum format, GLenum type, 88 const GLvoid *pixels ); 86 89 87 90 88 extern void gl_TexSubImage3D( GLcontext *ctx,89 GLenum target, GLint level,90 GLint xoffset, GLint yoffset, GLint zoffset,91 GLsizei width, GLsizei height, GLsizei depth,92 GLenum format, GLenum type,93 const GLvoid *pixels );91 extern void 92 _mesa_TexSubImage2D( GLenum target, GLint level, 93 GLint xoffset, GLint yoffset, 94 GLsizei width, GLsizei height, 95 GLenum format, GLenum type, 96 const GLvoid *pixels ); 94 97 95 98 96 extern void gl_CopyTexImage1D( GLcontext *ctx, 97 GLenum target, GLint level, 98 GLenum internalformat, 99 GLint x, GLint y, 100 GLsizei width, GLint border ); 99 extern void 100 _mesa_TexSubImage3D( GLenum target, GLint level, 101 GLint xoffset, GLint yoffset, GLint zoffset, 102 GLsizei width, GLsizei height, GLsizei depth, 103 GLenum format, GLenum type, 104 const GLvoid *pixels ); 101 105 102 106 103 extern void gl_CopyTexImage2D( GLcontext *ctx, 104 GLenum target, GLint level, 105 GLenum internalformat, GLint x, GLint y, 106 GLsizei width, GLsizei height, 107 GLint border ); 107 extern void 108 _mesa_CopyTexImage1D( GLenum target, GLint level, GLenum internalformat, 109 GLint x, GLint y, GLsizei width, GLint border ); 108 110 109 111 110 extern void gl_CopyTexSubImage1D( GLcontext *ctx,111 GLenum target, GLint level,112 GLint xoffset, GLint x, GLint y,113 GLsizei width);112 extern void 113 _mesa_CopyTexImage2D( GLenum target, GLint level, 114 GLenum internalformat, GLint x, GLint y, 115 GLsizei width, GLsizei height, GLint border ); 114 116 115 117 116 extern void gl_CopyTexSubImage2D( GLcontext *ctx, 117 GLenum target, GLint level, 118 GLint xoffset, GLint yoffset, 119 GLint x, GLint y, 120 GLsizei width, GLsizei height ); 118 extern void 119 _mesa_CopyTexSubImage1D( GLenum target, GLint level, GLint xoffset, 120 GLint x, GLint y, GLsizei width ); 121 121 122 122 123 extern void gl_CopyTexSubImage3D( GLcontext *ctx, 124 GLenum target, GLint level, 125 GLint xoffset, GLint yoffset, 126 GLint zoffset, 127 GLint x, GLint y, 128 GLsizei width, GLsizei height ); 123 extern void 124 _mesa_CopyTexSubImage2D( GLenum target, GLint level, 125 GLint xoffset, GLint yoffset, 126 GLint x, GLint y, GLsizei width, GLsizei height ); 127 128 129 extern void 130 _mesa_CopyTexSubImage3D( GLenum target, GLint level, 131 GLint xoffset, GLint yoffset, GLint zoffset, 132 GLint x, GLint y, GLsizei width, GLsizei height ); 129 133 130 134 #endif -
trunk/src/opengl/mesa/texobj.h
r2938 r3597 1 /* $Id: texobj.h,v 1. 1 2000-02-29 00:48:39 sandervlExp $ */1 /* $Id: texobj.h,v 1.2 2000-05-23 20:34:57 jeroen Exp $ */ 2 2 3 3 /* 4 4 * Mesa 3-D graphics library 5 * Version: 3. 15 * Version: 3.3 6 6 * 7 7 * Copyright (C) 1999 Brian Paul All Rights Reserved. … … 60 60 */ 61 61 62 extern void gl_GenTextures( GLcontext *ctx, GLsizei n, GLuint *textures ); 62 extern void 63 _mesa_GenTextures( GLsizei n, GLuint *textures ); 63 64 64 65 65 extern void gl_DeleteTextures( GLcontext *ctx,66 GLsizei n, const GLuint *textures);66 extern void 67 _mesa_DeleteTextures( GLsizei n, const GLuint *textures); 67 68 68 69 69 extern void gl_BindTexture( GLcontext *ctx, GLenum target, GLuint texture ); 70 extern void 71 _mesa_BindTexture( GLenum target, GLuint texture ); 70 72 71 73 72 extern void gl_PrioritizeTextures( GLcontext *ctx,73 GLsizei n, const GLuint *textures,74 const GLclampf *priorities );74 extern void 75 _mesa_PrioritizeTextures( GLsizei n, const GLuint *textures, 76 const GLclampf *priorities ); 75 77 76 78 77 extern GLboolean gl_AreTexturesResident( GLcontext *ctx, GLsizei n,78 const GLuint *textures,79 GLboolean *residences );79 extern GLboolean 80 _mesa_AreTexturesResident( GLsizei n, const GLuint *textures, 81 GLboolean *residences ); 80 82 81 83 82 extern GLboolean gl_IsTexture( GLcontext *ctx, GLuint texture ); 84 extern GLboolean 85 _mesa_IsTexture( GLuint texture ); 83 86 84 87 -
trunk/src/opengl/mesa/texstate.h
r2938 r3597 1 /* $Id: texstate.h,v 1. 1 2000-02-29 00:48:39 sandervlExp $ */1 /* $Id: texstate.h,v 1.2 2000-05-23 20:34:58 jeroen Exp $ */ 2 2 3 3 /* … … 38 38 /*** Called from API ***/ 39 39 40 extern void gl_GetTexEnvfv( GLcontext *ctx,41 GLenum target, GLenum pname, GLfloat *params );40 extern void 41 _mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params ); 42 42 43 extern void gl_GetTexEnviv( GLcontext *ctx,44 GLenum target, GLenum pname, GLint *params );43 extern void 44 _mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params ); 45 45 46 extern void gl_GetTexGendv( GLcontext *ctx,47 GLenum coord, GLenum pname, GLdouble *params );46 extern void 47 _mesa_GetTexGendv( GLenum coord, GLenum pname, GLdouble *params ); 48 48 49 extern void gl_GetTexGenfv( GLcontext *ctx,50 GLenum coord, GLenum pname, GLfloat *params );49 extern void 50 _mesa_GetTexGenfv( GLenum coord, GLenum pname, GLfloat *params ); 51 51 52 extern void gl_GetTexGeniv( GLcontext *ctx,53 GLenum coord, GLenum pname, GLint *params );52 extern void 53 _mesa_GetTexGeniv( GLenum coord, GLenum pname, GLint *params ); 54 54 55 extern void gl_GetTexLevelParameterfv( GLcontext *ctx,56 GLenum target, GLint level,57 GLenum pname, GLfloat *params );55 extern void 56 _mesa_GetTexLevelParameterfv( GLenum target, GLint level, 57 GLenum pname, GLfloat *params ); 58 58 59 extern void gl_GetTexLevelParameteriv( GLcontext *ctx,60 GLenum target, GLint level,61 GLenum pname, GLint *params );59 extern void 60 _mesa_GetTexLevelParameteriv( GLenum target, GLint level, 61 GLenum pname, GLint *params ); 62 62 63 extern void gl_GetTexParameterfv( GLcontext *ctx, GLenum target,64 GLenum pname, GLfloat *params );63 extern void 64 _mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params ); 65 65 66 extern void gl_GetTexParameteriv( GLcontext *ctx,67 GLenum target, GLenum pname, GLint *params );66 extern void 67 _mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params ); 68 68 69 69 70 extern void gl_TexEnvfv( GLcontext *ctx, 71 GLenum target, GLenum pname, const GLfloat *param ); 70 extern void 71 _mesa_TexEnvf( GLenum target, GLenum pname, GLfloat param ); 72 73 extern void 74 _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param ); 75 76 extern void 77 _mesa_TexEnvi( GLenum target, GLenum pname, GLint param ); 78 79 extern void 80 _mesa_TexEnviv( GLenum target, GLenum pname, const GLint *param ); 72 81 73 82 74 extern void gl_TexParameterfv( GLcontext *ctx, GLenum target, GLenum pname, 75 const GLfloat *params ); 83 extern void 84 _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params ); 85 86 extern void 87 _mesa_TexParameterf( GLenum target, GLenum pname, GLfloat param ); 76 88 77 89 78 extern void gl_TexGenfv( GLcontext *ctx, 79 GLenum coord, GLenum pname, const GLfloat *params ); 90 extern void 91 _mesa_TexParameteri( GLenum target, GLenum pname, const GLint param ); 92 93 extern void 94 _mesa_TexParameteriv( GLenum target, GLenum pname, const GLint *params ); 95 96 97 extern void 98 _mesa_TexGend( GLenum coord, GLenum pname, GLdouble param ); 99 100 extern void 101 _mesa_TexGendv( GLenum coord, GLenum pname, const GLdouble *params ); 102 103 extern void 104 _mesa_TexGenf( GLenum coord, GLenum pname, GLfloat param ); 105 106 extern void 107 _mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params ); 108 109 extern void 110 _mesa_TexGeni( GLenum coord, GLenum pname, GLint param ); 111 112 extern void 113 _mesa_TexGeniv( GLenum coord, GLenum pname, const GLint *params ); 80 114 81 115 … … 87 121 * GL_ARB_multitexture 88 122 */ 89 extern void gl_ActiveTexture( GLcontext *ctx, GLenum target ); 123 extern void 124 _mesa_ActiveTextureARB( GLenum target ); 90 125 91 extern void gl_ClientActiveTexture( GLcontext *ctx, GLenum target ); 126 extern void 127 _mesa_ClientActiveTextureARB( GLenum target ); 92 128 93 129 -
trunk/src/opengl/mesa/trans_tmp.h
r2938 r3597 1 /* $Id: trans_tmp.h,v 1. 1 2000-02-29 00:48:40 sandervlExp $ */1 /* $Id: trans_tmp.h,v 1.2 2000-05-23 20:34:58 jeroen Exp $ */ 2 2 3 3 /* … … 37 37 #ifdef DEST_4F 38 38 static void DEST_4F( GLfloat (*t)[4], 39 const struct gl_client_array *from,40 ARGS)39 const struct gl_client_array *from, 40 ARGS) 41 41 { 42 42 GLuint stride = from->StrideB; … … 50 50 CHECK { 51 51 NEXT_F2; 52 if (SZ >= 1) t[i][0] = TRX_4F(f, 0);53 if (SZ >= 2) t[i][1] = TRX_4F(f, 1);54 if (SZ >= 3) t[i][2] = TRX_4F(f, 2);55 if (SZ == 4) t[i][3] = TRX_4F(f, 3);52 if (SZ >= 1) t[i][0] = TRX_4F(f, 0); 53 if (SZ >= 2) t[i][1] = TRX_4F(f, 1); 54 if (SZ >= 3) t[i][2] = TRX_4F(f, 2); 55 if (SZ == 4) t[i][3] = TRX_4F(f, 3); 56 56 } 57 57 } … … 62 62 #ifdef DEST_3F 63 63 static void DEST_3F( GLfloat (*t)[3], 64 const struct gl_client_array *from,65 ARGS)64 const struct gl_client_array *from, 65 ARGS) 66 66 { 67 67 GLuint stride = from->StrideB; … … 74 74 CHECK { 75 75 NEXT_F2; 76 t[i][0] = TRX_3F(f, 0);77 t[i][1] = TRX_3F(f, 1);78 t[i][2] = TRX_3F(f, 2);76 t[i][0] = TRX_3F(f, 0); 77 t[i][1] = TRX_3F(f, 1); 78 t[i][2] = TRX_3F(f, 2); 79 79 } 80 80 } … … 84 84 #ifdef DEST_4UB 85 85 static void DEST_4UB( GLubyte (*t)[4], 86 const struct gl_client_array *from,87 ARGS)86 const struct gl_client_array *from, 87 ARGS) 88 88 { 89 89 GLuint stride = from->StrideB; … … 96 96 CHECK { 97 97 NEXT_F2; 98 if (SZ >= 1) TRX_UB(t[i][0], f, 0);99 if (SZ >= 2) TRX_UB(t[i][1], f, 1);100 if (SZ >= 3) TRX_UB(t[i][2], f, 2);101 if (SZ == 4) TRX_UB(t[i][3], f, 3); else t[i][3] = 255;98 if (SZ >= 1) TRX_UB(t[i][0], f, 0); 99 if (SZ >= 2) TRX_UB(t[i][1], f, 1); 100 if (SZ >= 3) TRX_UB(t[i][2], f, 2); 101 if (SZ == 4) TRX_UB(t[i][3], f, 3); else t[i][3] = 255; 102 102 } 103 103 } … … 108 108 #ifdef DEST_1UB 109 109 static void DEST_1UB( GLubyte *t, 110 const struct gl_client_array *from,111 ARGS)110 const struct gl_client_array *from, 111 ARGS) 112 112 { 113 113 GLuint stride = from->StrideB; … … 120 120 CHECK { 121 121 NEXT_F2; 122 TRX_UB(t[i], f, 0);122 TRX_UB(t[i], f, 0); 123 123 } 124 124 } … … 129 129 #ifdef DEST_1UI 130 130 static void DEST_1UI( GLuint *t, 131 const struct gl_client_array *from,132 ARGS)131 const struct gl_client_array *from, 132 ARGS) 133 133 { 134 134 GLuint stride = from->StrideB; … … 142 142 CHECK { 143 143 NEXT_F2; 144 t[i] = TRX_UI(f, 0);144 t[i] = TRX_UI(f, 0); 145 145 } 146 146 } … … 153 153 #ifdef DEST_1UI 154 154 ASSERT(SZ == 1); 155 TAB( 1ui)[SRC_IDX] = DEST_1UI;155 TAB(_1ui)[SRC_IDX] = DEST_1UI; 156 156 #endif 157 157 #ifdef DEST_1UB 158 158 ASSERT(SZ == 1); 159 TAB( 1ub)[SRC_IDX] = DEST_1UB;159 TAB(_1ub)[SRC_IDX] = DEST_1UB; 160 160 #endif 161 161 #ifdef DEST_3F 162 162 ASSERT(SZ == 3); 163 TAB( 3f)[SRC_IDX] = DEST_3F;163 TAB(_3f)[SRC_IDX] = DEST_3F; 164 164 #endif 165 165 #ifdef DEST_4UB 166 TAB( 4ub)[SZ][SRC_IDX] = DEST_4UB;166 TAB(_4ub)[SZ][SRC_IDX] = DEST_4UB; 167 167 #endif 168 168 #ifdef DEST_4F 169 TAB( 4f)[SZ][SRC_IDX] = DEST_4F;169 TAB(_4f)[SZ][SRC_IDX] = DEST_4F; 170 170 #endif 171 171 -
trunk/src/opengl/mesa/tritemp.h
r2938 r3597 1 /* $Id: tritemp.h,v 1. 1 2000-02-29 00:48:40 sandervlExp $ */1 /* $Id: tritemp.h,v 1.2 2000-05-23 20:34:58 jeroen Exp $ */ 2 2 3 3 /* 4 4 * Mesa 3-D graphics library 5 * Version: 3. 15 * Version: 3.3 6 6 * 7 7 * Copyright (C) 1999 Brian Paul All Rights Reserved. … … 51 51 * PIXEL_ADDRESS(X,Y) - returns the address of pixel at (X,Y) where 52 52 * Y==0 at bottom of screen and increases upward. 53 * 54 * Similarly, for direct depth buffer access, this type is used for depth 55 * buffer addressing: 56 * DEPTH_TYPE - either GLushort or GLuint 53 57 * 54 58 * Optionally, one may provide one-time setup code per triangle: … … 84 88 } EdgeT; 85 89 86 struct vertex_buffer *VB = ctx->VB; 90 #ifdef INTERP_Z 91 const GLint depthBits = ctx->Visual->DepthBits; 92 const GLint fixedToDepthShift = depthBits <= 16 ? FIXED_SHIFT : 0; 93 const GLfloat maxDepth = ctx->Visual->DepthMaxF; 94 #define FixedToDepth(F) ((F) >> fixedToDepthShift) 95 #endif 96 const struct vertex_buffer *VB = ctx->VB; 87 97 EdgeT eMaj, eTop, eBot; 88 98 GLfloat oneOverArea; … … 135 145 /* compute oneOverArea */ 136 146 { 137 GLfloat area = eMaj.dx * eBot.dy - eBot.dx * eMaj.dy;147 const GLfloat area = eMaj.dx * eBot.dy - eBot.dx * eMaj.dy; 138 148 139 149 /* Do backface culling */ 140 if ( 141 area * bf < 0 || 142 area * area < .0025 143 ) 150 if (area * bf < 0 || area * area < .0025) 144 151 return; 145 146 152 147 153 oneOverArea = 1.0F / area; … … 227 233 { 228 234 GLint ltor; /* true if scanning left-to-right */ 229 #if INTERP_Z235 #ifdef INTERP_Z 230 236 GLfloat dzdx, dzdy; GLfixed fdzdx; 231 237 #endif 232 #if INTERP_RGB238 #ifdef INTERP_RGB 233 239 GLfloat drdx, drdy; GLfixed fdrdx; 234 240 GLfloat dgdx, dgdy; GLfixed fdgdx; 235 241 GLfloat dbdx, dbdy; GLfixed fdbdx; 236 242 #endif 237 #if INTERP_SPEC243 #ifdef INTERP_SPEC 238 244 GLfloat dsrdx, dsrdy; GLfixed fdsrdx; 239 245 GLfloat dsgdx, dsgdy; GLfixed fdsgdx; 240 246 GLfloat dsbdx, dsbdy; GLfixed fdsbdx; 241 247 #endif 242 #if INTERP_ALPHA248 #ifdef INTERP_ALPHA 243 249 GLfloat dadx, dady; GLfixed fdadx; 244 250 #endif 245 #if INTERP_INDEX251 #ifdef INTERP_INDEX 246 252 GLfloat didx, didy; GLfixed fdidx; 247 253 #endif 248 #if INTERP_INT_ST254 #ifdef INTERP_INT_ST 249 255 GLfloat dsdx, dsdy; GLfixed fdsdx; 250 256 GLfloat dtdx, dtdy; GLfixed fdtdx; 251 257 #endif 252 #if INTERP_STUV258 #ifdef INTERP_STUV 253 259 GLfloat dsdx, dsdy; 254 260 GLfloat dtdx, dtdy; … … 256 262 GLfloat dvdx, dvdy; 257 263 #endif 258 #if INTERP_STUV1264 #ifdef INTERP_STUV1 259 265 GLfloat ds1dx, ds1dy; 260 266 GLfloat dt1dx, dt1dy; … … 273 279 274 280 /* compute d?/dx and d?/dy derivatives */ 275 #if INTERP_Z281 #ifdef INTERP_Z 276 282 { 277 283 GLfloat eMaj_dz, eBot_dz; … … 279 285 eBot_dz = VB->Win.data[vMid][2] - VB->Win.data[vMin][2]; 280 286 dzdx = oneOverArea * (eMaj_dz * eBot.dy - eMaj.dy * eBot_dz); 281 if (dzdx >DEPTH_SCALE || dzdx<-DEPTH_SCALE) {287 if (dzdx > maxDepth || dzdx < -maxDepth) { 282 288 /* probably a sliver triangle */ 283 289 dzdx = 0.0; … … 287 293 dzdy = oneOverArea * (eMaj.dx * eBot_dz - eMaj_dz * eBot.dx); 288 294 } 289 #if DEPTH_BITS==16 290 fdzdx = SignedFloatToFixed(dzdx); 291 #else 292 fdzdx = (GLint) dzdx; 293 #endif 294 } 295 #endif 296 #if INTERP_RGB 295 if (depthBits <= 16) 296 fdzdx = SignedFloatToFixed(dzdx); 297 else 298 fdzdx = (GLint) dzdx; 299 } 300 #endif 301 #ifdef INTERP_RGB 297 302 { 298 303 GLfloat eMaj_dr, eBot_dr; … … 320 325 } 321 326 #endif 322 #if INTERP_SPEC327 #ifdef INTERP_SPEC 323 328 { 324 329 GLfloat eMaj_dsr, eBot_dsr; … … 346 351 } 347 352 #endif 348 #if INTERP_ALPHA353 #ifdef INTERP_ALPHA 349 354 { 350 355 GLfloat eMaj_da, eBot_da; … … 356 361 } 357 362 #endif 358 #if INTERP_INDEX363 #ifdef INTERP_INDEX 359 364 { 360 365 GLfloat eMaj_di, eBot_di; … … 366 371 } 367 372 #endif 368 #if INTERP_INT_ST373 #ifdef INTERP_INT_ST 369 374 { 370 375 GLfloat eMaj_ds, eBot_ds; … … 390 395 391 396 #endif 392 #if INTERP_STUV397 #ifdef INTERP_STUV 393 398 { 394 399 GLfloat wMax = VB->Win.data[vMax][3]; … … 442 447 } 443 448 #endif 444 #if INTERP_STUV1449 #ifdef INTERP_STUV1 445 450 { 446 451 GLfloat wMax = VB->Win.data[vMax][3]; … … 461 466 eBot_dt = VB->TexCoordPtr[1]->data[vMid][1]*wMid - VB->TexCoordPtr[1]->data[vMin][1]*wMin; 462 467 dt1dx = oneOverArea * (eMaj_dt * eBot.dy - eMaj.dy * eBot_dt); 463 dt1dy = oneOverArea * (eMaj.dx * eBot_dt - eMaj_dt * eBot.dx);464 }465 else466 {467 dt1dx = 0;468 dt1dy = 0;469 }470 471 if (VB->TexCoordPtr[1]->size > 2)472 {473 eMaj_du = VB->TexCoordPtr[1]->data[vMax][2]*wMax - VB->TexCoordPtr[1]->data[vMin][2]*wMin;474 eBot_du = VB->TexCoordPtr[1]->data[vMid][2]*wMid - VB->TexCoordPtr[1]->data[vMin][2]*wMin;475 du1dx = oneOverArea * (eMaj_du * eBot.dy - eMaj.dy * eBot_du);476 du1dy = oneOverArea * (eMaj.dx * eBot_du - eMaj_du * eBot.dx);477 }478 else479 {480 du1dx = 0;481 du1dy = 0;482 }483 484 if (VB->TexCoordPtr[1]->size > 3)485 {486 eMaj_dv = VB->TexCoordPtr[1]->data[vMax][3]*wMax - VB->TexCoordPtr[1]->data[vMin][3]*wMin;487 eBot_dv = VB->TexCoordPtr[1]->data[vMid][3]*wMid - VB->TexCoordPtr[1]->data[vMin][3]*wMin;488 dv1dx = oneOverArea * (eMaj_dv * eBot.dy - eMaj.dy * eBot_dv);489 dv1dy = oneOverArea * (eMaj.dx * eBot_dv - eMaj_dv * eBot.dx);490 }491 else492 {493 eMaj_dv = wMax - wMin;494 eBot_dv = wMid - wMin;495 dv1dx = oneOverArea * (eMaj_dv * eBot.dy - eMaj.dy * eBot_dv);496 dv1dy = oneOverArea * (eMaj.dx * eBot_dv - eMaj_dv * eBot.dx);497 }468 dt1dy = oneOverArea * (eMaj.dx * eBot_dt - eMaj_dt * eBot.dx); 469 } 470 else 471 { 472 dt1dx = 0; 473 dt1dy = 0; 474 } 475 476 if (VB->TexCoordPtr[1]->size > 2) 477 { 478 eMaj_du = VB->TexCoordPtr[1]->data[vMax][2]*wMax - VB->TexCoordPtr[1]->data[vMin][2]*wMin; 479 eBot_du = VB->TexCoordPtr[1]->data[vMid][2]*wMid - VB->TexCoordPtr[1]->data[vMin][2]*wMin; 480 du1dx = oneOverArea * (eMaj_du * eBot.dy - eMaj.dy * eBot_du); 481 du1dy = oneOverArea * (eMaj.dx * eBot_du - eMaj_du * eBot.dx); 482 } 483 else 484 { 485 du1dx = 0; 486 du1dy = 0; 487 } 488 489 if (VB->TexCoordPtr[1]->size > 3) 490 { 491 eMaj_dv = VB->TexCoordPtr[1]->data[vMax][3]*wMax - VB->TexCoordPtr[1]->data[vMin][3]*wMin; 492 eBot_dv = VB->TexCoordPtr[1]->data[vMid][3]*wMid - VB->TexCoordPtr[1]->data[vMin][3]*wMin; 493 dv1dx = oneOverArea * (eMaj_dv * eBot.dy - eMaj.dy * eBot_dv); 494 dv1dy = oneOverArea * (eMaj.dx * eBot_dv - eMaj_dv * eBot.dx); 495 } 496 else 497 { 498 eMaj_dv = wMax - wMin; 499 eBot_dv = wMid - wMin; 500 dv1dx = oneOverArea * (eMaj_dv * eBot.dy - eMaj.dy * eBot_dv); 501 dv1dy = oneOverArea * (eMaj.dx * eBot_dv - eMaj_dv * eBot.dx); 502 } 498 503 } 499 504 #endif … … 560 565 int dPRowOuter, dPRowInner; /* offset in bytes */ 561 566 #endif 562 #if INTERP_Z 563 GLdepth *zRow; 567 #ifdef INTERP_Z 568 # ifdef DEPTH_TYPE 569 DEPTH_TYPE *zRow; 564 570 int dZRowOuter, dZRowInner; /* offset in bytes */ 571 # endif 565 572 GLfixed fz, fdzOuter, fdzInner; 566 573 #endif 567 #if INTERP_RGB574 #ifdef INTERP_RGB 568 575 GLfixed fr, fdrOuter, fdrInner; 569 576 GLfixed fg, fdgOuter, fdgInner; 570 577 GLfixed fb, fdbOuter, fdbInner; 571 578 #endif 572 #if INTERP_SPEC579 #ifdef INTERP_SPEC 573 580 GLfixed fsr, fdsrOuter, fdsrInner; 574 581 GLfixed fsg, fdsgOuter, fdsgInner; 575 582 GLfixed fsb, fdsbOuter, fdsbInner; 576 583 #endif 577 #if INTERP_ALPHA584 #ifdef INTERP_ALPHA 578 585 GLfixed fa, fdaOuter, fdaInner; 579 586 #endif 580 #if INTERP_INDEX587 #ifdef INTERP_INDEX 581 588 GLfixed fi, fdiOuter, fdiInner; 582 589 #endif 583 #if INTERP_INT_ST590 #ifdef INTERP_INT_ST 584 591 GLfixed fs, fdsOuter, fdsInner; 585 592 GLfixed ft, fdtOuter, fdtInner; 586 593 #endif 587 #if INTERP_STUV594 #ifdef INTERP_STUV 588 595 GLfloat sLeft, dsOuter, dsInner; 589 596 GLfloat tLeft, dtOuter, dtInner; … … 591 598 GLfloat vLeft, dvOuter, dvInner; 592 599 #endif 593 #if INTERP_STUV1600 #ifdef INTERP_STUV1 594 601 GLfloat s1Left, ds1Outer, ds1Inner; 595 602 GLfloat t1Left, dt1Outer, dt1Inner; … … 665 672 #ifdef PIXEL_ADDRESS 666 673 { 667 pRow = (PIXEL_TYPE *) PIXEL_ADDRESS( FixedToInt(fxLeftEdge), iy );674 pRow = (PIXEL_TYPE *)PIXEL_ADDRESS( FixedToInt(fxLeftEdge), iy ); 668 675 dPRowOuter = -((int)BYTES_PER_ROW) + idxOuter * sizeof(PIXEL_TYPE); 669 676 /* negative because Y=0 at bottom and increases upward */ … … 680 687 */ 681 688 682 #if INTERP_Z689 #ifdef INTERP_Z 683 690 { 684 GLfloat z0, tmp; 685 z0 = VB->Win.data[vLower][2] + ctx->PolygonZoffset; 686 #if DEPTH_BITS==16 687 /* interpolate fixed-pt values */ 688 tmp = (z0 * FIXED_SCALE + dzdx * adjx + dzdy * adjy) + FIXED_HALF; 689 if (tmp < MAX_GLUINT/2) 690 fz = (GLfixed) tmp; 691 else 692 fz = MAX_GLUINT/2; 693 fdzOuter = SignedFloatToFixed(dzdy + dxOuter * dzdx); 694 #else 695 (void) tmp; 696 /* interpolate depth values exactly */ 697 fz = (GLint) (z0 + dzdx*FixedToFloat(adjx) + dzdy*FixedToFloat(adjy)); 698 fdzOuter = (GLint) (dzdy + dxOuter * dzdx); 699 #endif 700 zRow = Z_ADDRESS( ctx, FixedToInt(fxLeftEdge), iy ); 701 dZRowOuter = (ctx->Buffer->Width + idxOuter) * sizeof(GLdepth); 702 } 703 #endif 704 #if INTERP_RGB 691 GLfloat z0 = VB->Win.data[vLower][2] + ctx->PolygonZoffset; 692 if (depthBits <= 16) { 693 /* interpolate fixed-pt values */ 694 GLfloat tmp = (z0 * FIXED_SCALE + dzdx * adjx + dzdy * adjy) + FIXED_HALF; 695 if (tmp < MAX_GLUINT / 2) 696 fz = (GLfixed) tmp; 697 else 698 fz = MAX_GLUINT / 2; 699 fdzOuter = SignedFloatToFixed(dzdy + dxOuter * dzdx); 700 } 701 else { 702 /* interpolate depth values exactly */ 703 fz = (GLint) (z0 + dzdx*FixedToFloat(adjx) + dzdy*FixedToFloat(adjy)); 704 fdzOuter = (GLint) (dzdy + dxOuter * dzdx); 705 } 706 # ifdef DEPTH_TYPE 707 zRow = (DEPTH_TYPE *) _mesa_zbuffer_address(ctx, FixedToInt(fxLeftEdge), iy); 708 dZRowOuter = (ctx->DrawBuffer->Width + idxOuter) * sizeof(DEPTH_TYPE); 709 # endif 710 } 711 #endif 712 #ifdef INTERP_RGB 705 713 fr = (GLfixed)(IntToFixed(VB->ColorPtr->data[vLower][0]) + drdx * adjx + drdy * adjy) 706 714 + FIXED_HALF; … … 715 723 fdbOuter = SignedFloatToFixed(dbdy + dxOuter * dbdx); 716 724 #endif 717 #if INTERP_SPEC725 #ifdef INTERP_SPEC 718 726 fsr = (GLfixed)(IntToFixed(VB->Specular[vLower][0]) + dsrdx * adjx + dsrdy * adjy) 719 727 + FIXED_HALF; … … 728 736 fdsbOuter = SignedFloatToFixed(dsbdy + dxOuter * dsbdx); 729 737 #endif 730 #if INTERP_ALPHA738 #ifdef INTERP_ALPHA 731 739 fa = (GLfixed)(IntToFixed(VB->ColorPtr->data[vLower][3]) + dadx * adjx + dady * adjy) 732 740 + FIXED_HALF; 733 741 fdaOuter = SignedFloatToFixed(dady + dxOuter * dadx); 734 742 #endif 735 #if INTERP_INDEX743 #ifdef INTERP_INDEX 736 744 fi = (GLfixed)(VB->IndexPtr->data[vLower] * FIXED_SCALE + didx * adjx 737 745 + didy * adjy) + FIXED_HALF; 738 746 fdiOuter = SignedFloatToFixed(didy + dxOuter * didx); 739 747 #endif 740 #if INTERP_INT_ST748 #ifdef INTERP_INT_ST 741 749 { 742 750 GLfloat s0, t0; … … 745 753 fdsOuter = SignedFloatToFixed(dsdy + dxOuter * dsdx); 746 754 747 if (VB->TexCoordPtr[0]->size > 1)748 {749 t0 = VB->TexCoordPtr[0]->data[vLower][1] * T_SCALE;750 ft = (GLfixed)(t0 * FIXED_SCALE + dtdx * adjx + dtdy * adjy) + FIXED_HALF;751 fdtOuter = SignedFloatToFixed(dtdy + dxOuter * dtdx);752 }753 else754 {755 t0 = 0;756 ft = (GLfixed) FIXED_HALF;757 fdtOuter = SignedFloatToFixed(0);758 }759 }760 #endif 761 #if INTERP_STUV755 if (VB->TexCoordPtr[0]->size > 1) 756 { 757 t0 = VB->TexCoordPtr[0]->data[vLower][1] * T_SCALE; 758 ft = (GLfixed)(t0 * FIXED_SCALE + dtdx * adjx + dtdy * adjy) + FIXED_HALF; 759 fdtOuter = SignedFloatToFixed(dtdy + dxOuter * dtdx); 760 } 761 else 762 { 763 t0 = 0; 764 ft = (GLfixed) FIXED_HALF; 765 fdtOuter = SignedFloatToFixed(0); 766 } 767 } 768 #endif 769 #ifdef INTERP_STUV 762 770 { 763 771 GLfloat invW = VB->Win.data[vLower][3]; … … 766 774 sLeft = s0 + (dsdx * adjx + dsdy * adjy) * (1.0F/FIXED_SCALE); 767 775 dsOuter = dsdy + dxOuter * dsdx; 768 if (VB->TexCoordPtr[0]->size > 1)769 { 770 t0 = VB->TexCoordPtr[0]->data[vLower][1] * invW;771 tLeft = t0 + (dtdx * adjx + dtdy * adjy) * (1.0F/FIXED_SCALE);772 dtOuter = dtdy + dxOuter * dtdx;773 } else {774 tLeft = dtOuter = 0;775 }776 if (VB->TexCoordPtr[0]->size > 2)777 { 778 u0 = VB->TexCoordPtr[0]->data[vLower][2] * invW;779 uLeft = u0 + (dudx * adjx + dudy * adjy) * (1.0F/FIXED_SCALE);780 duOuter = dudy + dxOuter * dudx;781 } else {782 uLeft = duOuter = 0;783 }784 if (VB->TexCoordPtr[0]->size > 3)785 { 786 v0 = VB->TexCoordPtr[0]->data[vLower][3] * invW;787 } else {788 v0 = invW;789 }790 vLeft = v0 + (dvdx * adjx + dvdy * adjy) * (1.0F/FIXED_SCALE);791 dvOuter = dvdy + dxOuter * dvdx;792 } 793 #endif 794 #if INTERP_STUV1776 if (VB->TexCoordPtr[0]->size > 1) 777 { 778 t0 = VB->TexCoordPtr[0]->data[vLower][1] * invW; 779 tLeft = t0 + (dtdx * adjx + dtdy * adjy) * (1.0F/FIXED_SCALE); 780 dtOuter = dtdy + dxOuter * dtdx; 781 } else { 782 tLeft = dtOuter = 0; 783 } 784 if (VB->TexCoordPtr[0]->size > 2) 785 { 786 u0 = VB->TexCoordPtr[0]->data[vLower][2] * invW; 787 uLeft = u0 + (dudx * adjx + dudy * adjy) * (1.0F/FIXED_SCALE); 788 duOuter = dudy + dxOuter * dudx; 789 } else { 790 uLeft = duOuter = 0; 791 } 792 if (VB->TexCoordPtr[0]->size > 3) 793 { 794 v0 = VB->TexCoordPtr[0]->data[vLower][3] * invW; 795 } else { 796 v0 = invW; 797 } 798 vLeft = v0 + (dvdx * adjx + dvdy * adjy) * (1.0F/FIXED_SCALE); 799 dvOuter = dvdy + dxOuter * dvdx; 800 } 801 #endif 802 #ifdef INTERP_STUV1 795 803 { 796 804 GLfloat invW = VB->Win.data[vLower][3]; … … 799 807 s1Left = s0 + (ds1dx * adjx + ds1dy * adjy) * (1.0F/FIXED_SCALE); 800 808 ds1Outer = ds1dy + dxOuter * ds1dx; 801 if (VB->TexCoordPtr[0]->size > 1)802 { 803 t0 = VB->TexCoordPtr[1]->data[vLower][1] * invW;804 t1Left = t0 + (dt1dx * adjx + dt1dy * adjy) * (1.0F/FIXED_SCALE);805 dt1Outer = dt1dy + dxOuter * dt1dx;806 } else {807 t1Left = dt1Outer = 0;808 }809 if (VB->TexCoordPtr[0]->size > 2)810 { 811 u0 = VB->TexCoordPtr[1]->data[vLower][2] * invW;812 u1Left = u0 + (du1dx * adjx + du1dy * adjy) * (1.0F/FIXED_SCALE);813 du1Outer = du1dy + dxOuter * du1dx;814 } else {815 u1Left = du1Outer = 0;816 }817 if (VB->TexCoordPtr[0]->size > 3)818 { 819 v0 = VB->TexCoordPtr[1]->data[vLower][3] * invW;820 } else {821 v0 = invW;822 }823 v1Left = v0 + (dv1dx * adjx + dv1dy * adjy) * (1.0F/FIXED_SCALE);824 dv1Outer = dv1dy + dxOuter * dv1dx;809 if (VB->TexCoordPtr[0]->size > 1) 810 { 811 t0 = VB->TexCoordPtr[1]->data[vLower][1] * invW; 812 t1Left = t0 + (dt1dx * adjx + dt1dy * adjy) * (1.0F/FIXED_SCALE); 813 dt1Outer = dt1dy + dxOuter * dt1dx; 814 } else { 815 t1Left = dt1Outer = 0; 816 } 817 if (VB->TexCoordPtr[0]->size > 2) 818 { 819 u0 = VB->TexCoordPtr[1]->data[vLower][2] * invW; 820 u1Left = u0 + (du1dx * adjx + du1dy * adjy) * (1.0F/FIXED_SCALE); 821 du1Outer = du1dy + dxOuter * du1dx; 822 } else { 823 u1Left = du1Outer = 0; 824 } 825 if (VB->TexCoordPtr[0]->size > 3) 826 { 827 v0 = VB->TexCoordPtr[1]->data[vLower][3] * invW; 828 } else { 829 v0 = invW; 830 } 831 v1Left = v0 + (dv1dx * adjx + dv1dy * adjy) * (1.0F/FIXED_SCALE); 832 dv1Outer = dv1dy + dxOuter * dv1dx; 825 833 } 826 834 #endif … … 843 851 dPRowInner = dPRowOuter + sizeof(PIXEL_TYPE); 844 852 #endif 845 #if INTERP_Z 846 dZRowInner = dZRowOuter + sizeof(GLdepth); 853 #ifdef INTERP_Z 854 # ifdef DEPTH_TYPE 855 dZRowInner = dZRowOuter + sizeof(DEPTH_TYPE); 856 # endif 847 857 fdzInner = fdzOuter + fdzdx; 848 858 #endif 849 #if INTERP_RGB859 #ifdef INTERP_RGB 850 860 fdrInner = fdrOuter + fdrdx; 851 861 fdgInner = fdgOuter + fdgdx; 852 862 fdbInner = fdbOuter + fdbdx; 853 863 #endif 854 #if INTERP_SPEC864 #ifdef INTERP_SPEC 855 865 fdsrInner = fdsrOuter + fdsrdx; 856 866 fdsgInner = fdsgOuter + fdsgdx; 857 867 fdsbInner = fdsbOuter + fdsbdx; 858 868 #endif 859 #if INTERP_ALPHA869 #ifdef INTERP_ALPHA 860 870 fdaInner = fdaOuter + fdadx; 861 871 #endif 862 #if INTERP_INDEX872 #ifdef INTERP_INDEX 863 873 fdiInner = fdiOuter + fdidx; 864 874 #endif 865 #if INTERP_INT_ST875 #ifdef INTERP_INT_ST 866 876 fdsInner = fdsOuter + fdsdx; 867 877 fdtInner = fdtOuter + fdtdx; 868 878 #endif 869 #if INTERP_STUV870 dsInner = dsOuter + dsdx;871 dtInner = dtOuter + dtdx;872 duInner = duOuter + dudx;873 dvInner = dvOuter + dvdx;874 #endif 875 #if INTERP_STUV1876 ds1Inner = ds1Outer + ds1dx;877 dt1Inner = dt1Outer + dt1dx;878 du1Inner = du1Outer + du1dx;879 dv1Inner = dv1Outer + dv1dx;879 #ifdef INTERP_STUV 880 dsInner = dsOuter + dsdx; 881 dtInner = dtOuter + dtdx; 882 duInner = duOuter + dudx; 883 dvInner = dvOuter + dvdx; 884 #endif 885 #ifdef INTERP_STUV1 886 ds1Inner = ds1Outer + ds1dx; 887 dt1Inner = dt1Outer + dt1dx; 888 du1Inner = du1Outer + du1dx; 889 dv1Inner = dv1Outer + dv1dx; 880 890 #endif 881 891 … … 883 893 /* initialize the span interpolants to the leftmost value */ 884 894 /* ff = fixed-pt fragment */ 885 #if INTERP_Z895 #ifdef INTERP_Z 886 896 GLfixed ffz = fz; 887 /*GLdepth *zp = zRow;*/ 888 #endif 889 #if INTERP_RGB 897 #endif 898 #ifdef INTERP_RGB 890 899 GLfixed ffr = fr, ffg = fg, ffb = fb; 891 900 #endif 892 #if INTERP_SPEC901 #ifdef INTERP_SPEC 893 902 GLfixed ffsr = fsr, ffsg = fsg, ffsb = fsb; 894 903 #endif 895 #if INTERP_ALPHA904 #ifdef INTERP_ALPHA 896 905 GLfixed ffa = fa; 897 906 #endif 898 #if INTERP_INDEX907 #ifdef INTERP_INDEX 899 908 GLfixed ffi = fi; 900 909 #endif 901 #if INTERP_INT_ST910 #ifdef INTERP_INT_ST 902 911 GLfixed ffs = fs, fft = ft; 903 912 #endif 904 #if INTERP_STUV913 #ifdef INTERP_STUV 905 914 GLfloat ss = sLeft, tt = tLeft, uu = uLeft, vv = vLeft; 906 915 #endif 907 #if INTERP_STUV1916 #ifdef INTERP_STUV1 908 917 GLfloat ss1 = s1Left, tt1 = t1Left, uu1 = u1Left, vv1 = v1Left; 909 918 #endif … … 911 920 GLint right = FixedToInt(fxRightEdge); 912 921 913 #if INTERP_RGB922 #ifdef INTERP_RGB 914 923 { 915 924 /* need this to accomodate round-off errors */ … … 925 934 } 926 935 #endif 927 #if INTERP_SPEC936 #ifdef INTERP_SPEC 928 937 { 929 938 /* need this to accomodate round-off errors */ … … 939 948 } 940 949 #endif 941 #if INTERP_ALPHA950 #ifdef INTERP_ALPHA 942 951 { 943 952 GLfixed ffaend = ffa+(right-left-1)*fdadx; … … 946 955 } 947 956 #endif 948 #if INTERP_INDEX957 #ifdef INTERP_INDEX 949 958 if (ffi<0) ffi = 0; 950 959 #endif … … 969 978 fError -= FIXED_ONE; 970 979 #ifdef PIXEL_ADDRESS 971 pRow = (PIXEL_TYPE*) ((GLubyte*)pRow + dPRowOuter); 972 #endif 973 #if INTERP_Z 974 zRow = (GLdepth*) ((GLubyte*)zRow + dZRowOuter); 980 pRow = (PIXEL_TYPE *) ((GLubyte*)pRow + dPRowOuter); 981 #endif 982 #ifdef INTERP_Z 983 # ifdef DEPTH_TYPE 984 zRow = (DEPTH_TYPE *) ((GLubyte*)zRow + dZRowOuter); 985 # endif 975 986 fz += fdzOuter; 976 987 #endif 977 #if INTERP_RGB988 #ifdef INTERP_RGB 978 989 fr += fdrOuter; fg += fdgOuter; fb += fdbOuter; 979 990 #endif 980 #if INTERP_SPEC991 #ifdef INTERP_SPEC 981 992 fsr += fdsrOuter; fsg += fdsgOuter; fsb += fdsbOuter; 982 993 #endif 983 #if INTERP_ALPHA994 #ifdef INTERP_ALPHA 984 995 fa += fdaOuter; 985 996 #endif 986 #if INTERP_INDEX997 #ifdef INTERP_INDEX 987 998 fi += fdiOuter; 988 999 #endif 989 #if INTERP_INT_ST1000 #ifdef INTERP_INT_ST 990 1001 fs += fdsOuter; ft += fdtOuter; 991 1002 #endif 992 #if INTERP_STUV993 sLeft += dsOuter;994 tLeft += dtOuter;995 uLeft += duOuter;996 vLeft += dvOuter;997 #endif 998 #if INTERP_STUV1999 s1Left += ds1Outer;1000 t1Left += dt1Outer;1001 u1Left += du1Outer;1002 v1Left += dv1Outer;1003 #ifdef INTERP_STUV 1004 sLeft += dsOuter; 1005 tLeft += dtOuter; 1006 uLeft += duOuter; 1007 vLeft += dvOuter; 1008 #endif 1009 #ifdef INTERP_STUV1 1010 s1Left += ds1Outer; 1011 t1Left += dt1Outer; 1012 u1Left += du1Outer; 1013 v1Left += dv1Outer; 1003 1014 #endif 1004 1015 } 1005 1016 else { 1006 1017 #ifdef PIXEL_ADDRESS 1007 pRow = (PIXEL_TYPE*) ((GLubyte*)pRow + dPRowInner); 1008 #endif 1009 #if INTERP_Z 1010 zRow = (GLdepth*) ((GLubyte*)zRow + dZRowInner); 1018 pRow = (PIXEL_TYPE *) ((GLubyte*)pRow + dPRowInner); 1019 #endif 1020 #ifdef INTERP_Z 1021 # ifdef DEPTH_TYPE 1022 zRow = (DEPTH_TYPE *) ((GLubyte*)zRow + dZRowInner); 1023 # endif 1011 1024 fz += fdzInner; 1012 1025 #endif 1013 #if INTERP_RGB1026 #ifdef INTERP_RGB 1014 1027 fr += fdrInner; fg += fdgInner; fb += fdbInner; 1015 1028 #endif 1016 #if INTERP_SPEC1029 #ifdef INTERP_SPEC 1017 1030 fsr += fdsrInner; fsg += fdsgInner; fsb += fdsbInner; 1018 1031 #endif 1019 #if INTERP_ALPHA1032 #ifdef INTERP_ALPHA 1020 1033 fa += fdaInner; 1021 1034 #endif 1022 #if INTERP_INDEX1035 #ifdef INTERP_INDEX 1023 1036 fi += fdiInner; 1024 1037 #endif 1025 #if INTERP_INT_ST1038 #ifdef INTERP_INT_ST 1026 1039 fs += fdsInner; ft += fdtInner; 1027 1040 #endif 1028 #if INTERP_STUV1029 sLeft += dsInner;1030 tLeft += dtInner;1031 uLeft += duInner;1032 vLeft += dvInner;1033 #endif 1034 #if INTERP_STUV11035 s1Left += ds1Inner;1036 t1Left += dt1Inner;1037 u1Left += du1Inner;1038 v1Left += dv1Inner;1041 #ifdef INTERP_STUV 1042 sLeft += dsInner; 1043 tLeft += dtInner; 1044 uLeft += duInner; 1045 vLeft += dvInner; 1046 #endif 1047 #ifdef INTERP_STUV1 1048 s1Left += ds1Inner; 1049 t1Left += dt1Inner; 1050 u1Left += du1Inner; 1051 v1Left += dv1Inner; 1039 1052 #endif 1040 1053 } … … 1065 1078 #undef S_SCALE 1066 1079 #undef T_SCALE 1080 1081 #undef FixedToDepth -
trunk/src/opengl/mesa/types.h
r2962 r3597 1 /* $Id: types.h,v 1. 2 2000-03-01 18:49:38 jeroen Exp $ */1 /* $Id: types.h,v 1.3 2000-05-23 20:34:58 jeroen Exp $ */ 2 2 3 3 /* 4 4 * Mesa 3-D graphics library 5 * Version: 3. 15 * Version: 3.3 6 6 * 7 7 * Copyright (C) 1999 Brian Paul All Rights Reserved. … … 30 30 31 31 32 #include "gl.h" 33 #ifdef HAVE_CONFIG_H 34 #include "conf.h" 35 #endif 32 #include "glheader.h" 36 33 #include "config.h" 34 #include "glthread.h" 35 #include "glapitable.h" 37 36 #include "macros.h" 38 37 #include "fixed.h" … … 104 103 # define STENCIL_MAX 0xff 105 104 #elif STENCIL_BITS==16 106 typedef GLushort GLstencil 105 typedef GLushort GLstencil; 107 106 # define STENCIL_MAX 0xffff 108 107 #else … … 115 114 * Depth buffer data type: 116 115 */ 117 #if DEPTH_BITS==16 118 typedef GLushort GLdepth; 119 #elif DEPTH_BITS==32 120 typedef GLint GLdepth; 121 #else 122 # error "illegal number of depth bits" 123 #endif 116 typedef GLuint GLdepth; /* Must be 32-bits! */ 124 117 125 118 … … 128 121 * Some forward type declarations 129 122 */ 130 struct HashTable;123 struct _mesa_HashTable; 131 124 132 125 typedef struct gl_visual GLvisual; … … 134 127 typedef struct gl_frame_buffer GLframebuffer; 135 128 136 struct gl_pixelstore_attrib;137 138 129 139 130 /* 140 131 * Functions for transformation of normals in the VB. 141 132 */ 142 typedef void ( *normal_func)( const GLmatrix *mat,133 typedef void (_NORMAPIP normal_func)( const GLmatrix *mat, 143 134 GLfloat scale, 144 135 const GLvector3f *in, … … 181 172 182 173 174 175 typedef void (*render_func)( struct vertex_buffer *VB, 176 GLuint start, 177 GLuint count, 178 GLuint parity ); 179 180 183 181 /* 184 182 * Blending function 185 183 */ 186 typedef void (* __cdecl blend_func)( GLcontext *ctx, GLuint n, const GLubyte mask[], 184 #ifdef USE_MMX_ASM 185 typedef void (_ASMAPIP blend_func)( GLcontext *ctx, GLuint n, 186 const GLubyte mask[], 187 GLubyte src[][4], CONST GLubyte dst[][4] ); 188 #else 189 typedef void (*blend_func)( GLcontext *ctx, GLuint n, const GLubyte mask[], 187 190 GLubyte src[][4], CONST GLubyte dst[][4] ); 191 #endif 188 192 189 193 … … 199 203 const GLfloat u[], const GLfloat lambda[], 200 204 GLubyte rgba[][4] ); 201 202 203 204 /* Generic internal image format */205 struct gl_image {206 GLint Width;207 GLint Height;208 GLint Depth; /* for 3-D texturing */209 GLint Components; /* 1, 2, 3 or 4 */210 GLenum Format; /* GL_COLOR_INDEX, GL_RED, GL_RGB, etc */211 GLenum Type; /* GL_UNSIGNED_BYTE or GL_FLOAT or GL_BITMAP */212 GLvoid *Data;213 GLboolean ErrorFlag;214 GLint RefCount;215 };216 205 217 206 … … 249 238 250 239 251 /* 252 * All gl* API functions in api*.c jump through pointers in this struct. 253 */ 254 struct gl_api_table { 255 void (*Accum)( GLcontext *, GLenum, GLfloat ); 256 void (*AlphaFunc)( GLcontext *, GLenum, GLclampf ); 257 GLboolean (*AreTexturesResident)( GLcontext *, GLsizei, 258 const GLuint *, GLboolean * ); 259 void (*BindTexture)( GLcontext *, GLenum, GLuint ); 260 void (*Bitmap)( GLcontext *, GLsizei, GLsizei, GLfloat, GLfloat, 261 GLfloat, GLfloat, const GLubyte *, 262 const struct gl_pixelstore_attrib *packing ); 263 void (*BlendColor)( GLcontext *, GLclampf, GLclampf, GLclampf, GLclampf); 264 void (*BlendEquation)( GLcontext *, GLenum ); 265 void (*BlendFunc)( GLcontext *, GLenum, GLenum ); 266 void (*BlendFuncSeparate)( GLcontext *, GLenum, GLenum, GLenum, GLenum ); 267 void (*CallList)( GLcontext *, GLuint list ); 268 void (*CallLists)( GLcontext *, GLsizei, GLenum, const GLvoid * ); 269 void (*Clear)( GLcontext *, GLbitfield ); 270 void (*ClearAccum)( GLcontext *, GLfloat, GLfloat, GLfloat, GLfloat ); 271 void (*ClearColor)( GLcontext *, GLclampf, GLclampf, GLclampf, GLclampf ); 272 void (*ClearDepth)( GLcontext *, GLclampd ); 273 void (*ClearIndex)( GLcontext *, GLfloat ); 274 void (*ClearStencil)( GLcontext *, GLint ); 275 void (*ClipPlane)( GLcontext *, GLenum, const GLfloat * ); 276 void (*ColorMask)( GLcontext *, 277 GLboolean, GLboolean, GLboolean, GLboolean ); 278 void (*ColorMaterial)( GLcontext *, GLenum, GLenum ); 279 void (*ColorTable)( GLcontext *, GLenum, GLenum, struct gl_image * ); 280 void (*ColorSubTable)( GLcontext *, GLenum, GLsizei, struct gl_image * ); 281 void (*CopyPixels)( GLcontext *, GLint, GLint, GLsizei, GLsizei, GLenum ); 282 void (*CopyTexImage1D)( GLcontext *, GLenum, GLint, GLenum, 283 GLint, GLint, GLsizei, GLint ); 284 void (*CopyTexImage2D)( GLcontext *, GLenum, GLint, GLenum, 285 GLint, GLint, GLsizei, GLsizei, GLint ); 286 void (*CopyTexSubImage1D)( GLcontext *, GLenum, GLint, GLint, 287 GLint, GLint, GLsizei ); 288 void (*CopyTexSubImage2D)( GLcontext *, GLenum, GLint, GLint, GLint, 289 GLint, GLint, GLsizei, GLsizei ); 290 void (*CopyTexSubImage3D)(GLcontext *, GLenum, GLint, GLint, GLint, GLint, 291 GLint, GLint, GLsizei, GLsizei ); 292 void (*CullFace)( GLcontext *, GLenum ); 293 void (*DeleteLists)( GLcontext *, GLuint, GLsizei ); 294 void (*DeleteTextures)( GLcontext *, GLsizei, const GLuint *); 295 void (*DepthFunc)( GLcontext *, GLenum ); 296 void (*DepthMask)( GLcontext *, GLboolean ); 297 void (*DepthRange)( GLcontext *, GLclampd, GLclampd ); 298 void (*Disable)( GLcontext *, GLenum ); 299 void (*DisableClientState)( GLcontext *, GLenum ); 300 void (*DrawBuffer)( GLcontext *, GLenum ); 301 void (*DrawPixels)( GLcontext *, struct gl_image *image ); 302 void (*Enable)( GLcontext *, GLenum ); 303 void (*Error)( GLcontext *, GLenum, const char * ); 304 void (*EnableClientState)( GLcontext *, GLenum ); 305 void (*EndList)( GLcontext * ); 306 void (*EvalMesh1)( GLcontext *, GLenum, GLint, GLint ); 307 void (*EvalMesh2)( GLcontext *, GLenum, GLint, GLint, GLint, GLint ); 308 void (*FeedbackBuffer)( GLcontext *, GLsizei, GLenum, GLfloat * ); 309 void (*Finish)( GLcontext * ); 310 void (*Flush)( GLcontext * ); 311 void (*Fogfv)( GLcontext *, GLenum, const GLfloat * ); 312 void (*FrontFace)( GLcontext *, GLenum ); 313 void (*Frustum)( GLcontext *, GLdouble, GLdouble, GLdouble, GLdouble, 314 GLdouble, GLdouble ); 315 GLuint (*GenLists)( GLcontext *, GLsizei ); 316 void (*GenTextures)( GLcontext *, GLsizei, GLuint * ); 317 void (*GetBooleanv)( GLcontext *, GLenum, GLboolean * ); 318 void (*GetClipPlane)( GLcontext *, GLenum, GLdouble * ); 319 void (*GetColorTable)( GLcontext *, GLenum, GLenum, GLenum, GLvoid *); 320 void (*GetColorTableParameteriv)( GLcontext *, GLenum, GLenum, GLint *); 321 void (*GetDoublev)( GLcontext *, GLenum, GLdouble * ); 322 GLenum (*GetError)( GLcontext * ); 323 void (*GetFloatv)( GLcontext *, GLenum, GLfloat * ); 324 void (*GetIntegerv)( GLcontext *, GLenum, GLint * ); 325 const GLubyte* (*GetString)( GLcontext *, GLenum name ); 326 void (*GetLightfv)( GLcontext *, GLenum light, GLenum, GLfloat * ); 327 void (*GetLightiv)( GLcontext *, GLenum light, GLenum, GLint * ); 328 void (*GetMapdv)( GLcontext *, GLenum, GLenum, GLdouble * ); 329 void (*GetMapfv)( GLcontext *, GLenum, GLenum, GLfloat * ); 330 void (*GetMapiv)( GLcontext *, GLenum, GLenum, GLint * ); 331 void (*GetMaterialfv)( GLcontext *, GLenum, GLenum, GLfloat * ); 332 void (*GetMaterialiv)( GLcontext *, GLenum, GLenum, GLint * ); 333 void (*GetPixelMapfv)( GLcontext *, GLenum, GLfloat * ); 334 void (*GetPixelMapuiv)( GLcontext *, GLenum, GLuint * ); 335 void (*GetPixelMapusv)( GLcontext *, GLenum, GLushort * ); 336 void (*GetPointerv)( GLcontext *, GLenum, GLvoid ** ); 337 void (*GetPolygonStipple)( GLcontext *, GLubyte * ); 338 void (*PrioritizeTextures)( GLcontext *, GLsizei, const GLuint *, 339 const GLclampf * ); 340 void (*GetTexEnvfv)( GLcontext *, GLenum, GLenum, GLfloat * ); 341 void (*GetTexEnviv)( GLcontext *, GLenum, GLenum, GLint * ); 342 void (*GetTexGendv)( GLcontext *, GLenum coord, GLenum, GLdouble * ); 343 void (*GetTexGenfv)( GLcontext *, GLenum coord, GLenum, GLfloat * ); 344 void (*GetTexGeniv)( GLcontext *, GLenum coord, GLenum, GLint * ); 345 void (*GetTexImage)( GLcontext *, GLenum, GLint level, GLenum, GLenum, 346 GLvoid * ); 347 void (*GetTexLevelParameterfv)( GLcontext *, 348 GLenum, GLint, GLenum, GLfloat * ); 349 void (*GetTexLevelParameteriv)( GLcontext *, 350 GLenum, GLint, GLenum, GLint * ); 351 void (*GetTexParameterfv)( GLcontext *, GLenum, GLenum, GLfloat *); 352 void (*GetTexParameteriv)( GLcontext *, GLenum, GLenum, GLint * ); 353 GLboolean (*Hint)( GLcontext *, GLenum, GLenum ); 354 void (*IndexMask)( GLcontext *, GLuint ); 355 void (*InitNames)( GLcontext * ); 356 GLboolean (*IsEnabled)( GLcontext *, GLenum ); 357 GLboolean (*IsList)( GLcontext *, GLuint ); 358 GLboolean (*IsTexture)( GLcontext *, GLuint ); 359 void (*LightModelfv)( GLcontext *, GLenum, const GLfloat * ); 360 void (*Lightfv)( GLcontext *, GLenum light, GLenum, const GLfloat *, GLint); 361 void (*LineStipple)( GLcontext *, GLint factor, GLushort ); 362 void (*LineWidth)( GLcontext *, GLfloat ); 363 void (*ListBase)( GLcontext *, GLuint ); 364 void (*LoadIdentity)( GLcontext * ); 365 /* LoadMatrixd implemented with glLoadMatrixf */ 366 void (*LoadMatrixf)( GLcontext *, const GLfloat * ); 367 void (*LoadName)( GLcontext *, GLuint ); 368 void (*LogicOp)( GLcontext *, GLenum ); 369 void (*Map1f)( GLcontext *, GLenum, GLfloat, GLfloat, GLint, GLint, 370 const GLfloat *, GLboolean ); 371 void (*Map2f)( GLcontext *, GLenum, GLfloat, GLfloat, GLint, GLint, 372 GLfloat, GLfloat, GLint, GLint, const GLfloat *, 373 GLboolean ); 374 void (*MapGrid1f)( GLcontext *, GLint, GLfloat, GLfloat ); 375 void (*MapGrid2f)( GLcontext *, GLint, GLfloat, GLfloat, 376 GLint, GLfloat, GLfloat ); 377 void (*MatrixMode)( GLcontext *, GLenum ); 378 /* MultMatrixd implemented with glMultMatrixf */ 379 void (*MultMatrixf)( GLcontext *, const GLfloat * ); 380 void (*NewList)( GLcontext *, GLuint list, GLenum ); 381 void (*Ortho)( GLcontext *, GLdouble, GLdouble, GLdouble, GLdouble, 382 GLdouble, GLdouble ); 383 void (*PassThrough)( GLcontext *, GLfloat ); 384 void (*PixelMapfv)( GLcontext *, GLenum, GLint, const GLfloat * ); 385 void (*PixelStorei)( GLcontext *, GLenum, GLint ); 386 void (*PixelTransferf)( GLcontext *, GLenum, GLfloat ); 387 void (*PixelZoom)( GLcontext *, GLfloat, GLfloat ); 388 void (*PointParameterfvEXT)( GLcontext *, GLenum, const GLfloat * ); 389 void (*PointSize)( GLcontext *, GLfloat ); 390 void (*PolygonMode)( GLcontext *, GLenum, GLenum ); 391 void (*PolygonOffset)( GLcontext *, GLfloat, GLfloat ); 392 void (*PolygonStipple)( GLcontext *, const GLuint * ); 393 void (*PopAttrib)( GLcontext * ); 394 void (*PopClientAttrib)( GLcontext * ); 395 void (*PopMatrix)( GLcontext * ); 396 void (*PopName)( GLcontext * ); 397 void (*PushAttrib)( GLcontext *, GLbitfield ); 398 void (*PushClientAttrib)( GLcontext *, GLbitfield ); 399 void (*PushMatrix)( GLcontext * ); 400 void (*PushName)( GLcontext *, GLuint ); 401 void (*RasterPos4f)( GLcontext *, 402 GLfloat x, GLfloat y, GLfloat z, GLfloat w ); 403 void (*ReadBuffer)( GLcontext *, GLenum ); 404 void (*ReadPixels)( GLcontext *, GLint, GLint, GLsizei, GLsizei, GLenum, 405 GLenum, GLvoid * ); 406 void (*Rectf)( GLcontext *, GLfloat, GLfloat, GLfloat, GLfloat ); 407 GLint (*RenderMode)( GLcontext *, GLenum ); 408 void (*Rotatef)( GLcontext *, GLfloat, GLfloat, GLfloat, GLfloat ); 409 void (*Scalef)( GLcontext *, GLfloat, GLfloat, GLfloat ); 410 void (*Scissor)( GLcontext *, GLint, GLint, GLsizei, GLsizei); 411 void (*SelectBuffer)( GLcontext *, GLsizei, GLuint * ); 412 void (*ShadeModel)( GLcontext *, GLenum ); 413 void (*StencilFunc)( GLcontext *, GLenum, GLint, GLuint ); 414 void (*StencilMask)( GLcontext *, GLuint ); 415 void (*StencilOp)( GLcontext *, GLenum, GLenum, GLenum ); 416 417 void (*TexEnvfv)( GLcontext *, GLenum, GLenum, const GLfloat * ); 418 void (*TexGenfv)( GLcontext *, GLenum coord, GLenum, const GLfloat * ); 419 void (*TexImage1D)( GLcontext *, GLenum, GLint, GLint, GLsizei, 420 GLint, GLenum, GLenum, const GLvoid * ); 421 void (*TexImage2D)( GLcontext *, GLenum, GLint, GLint, GLsizei, GLsizei, 422 GLint, GLenum, GLenum, const GLvoid *); 423 void (*TexSubImage1D)( GLcontext *, GLenum, GLint, GLint, GLsizei, 424 GLenum, GLenum, const GLvoid * ); 425 void (*TexSubImage2D)( GLcontext *, GLenum, GLint, GLint, GLint, 426 GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); 427 void (*TexImage3D)(GLcontext *, GLenum, GLint, GLint, GLsizei, GLsizei, 428 GLsizei, GLint, GLenum, GLenum, const GLvoid *); 429 void (*TexSubImage3D)(GLcontext *, GLenum, GLint, GLint, GLint, GLint, 430 GLsizei, GLsizei, GLsizei, GLenum, GLenum, 431 const GLvoid *); 432 void (*TexParameterfv)( GLcontext *, GLenum, GLenum, const GLfloat * ); 433 /* Translated implemented by Translatef */ 434 void (*Translatef)( GLcontext *, GLfloat, GLfloat, GLfloat ); 435 436 void (*Viewport)( GLcontext *, GLint, GLint, GLsizei, GLsizei ); 437 438 /* GL_MESA_window_pos extension */ 439 void (*WindowPos4fMESA)( GLcontext *, GLfloat, GLfloat, GLfloat, GLfloat ); 440 441 /* GL_MESA_resize_buffers extension */ 442 void (*ResizeBuffersMESA)( GLcontext * ); 443 444 /* GL_ARB_multitexture */ 445 void (*ActiveTexture)( GLcontext *, GLenum ); 446 void (*ClientActiveTexture)( GLcontext *, GLenum ); 447 }; 448 449 450 451 typedef void (*render_func)( struct vertex_buffer *VB, 452 GLuint start, 453 GLuint count, 454 GLuint parity ); 455 456 240 /* Data structure for color tables */ 241 struct gl_color_table { 242 GLubyte Table[4 * MAX_TEXTURE_PALETTE_SIZE]; 243 GLuint Size; /* number of entries (rows) in table */ 244 GLenum Format; 245 GLenum IntFormat; 246 }; 457 247 458 248 … … 601 391 602 392 struct gl_current_attrib { 603 604 393 /* KW: These values valid only when the VB is flushed. 605 394 */ … … 629 418 GLboolean Test; /* Depth buffering enabled flag */ 630 419 GLboolean Mask; /* Depth buffer writable? */ 420 GLboolean OcclusionTest;/* XXX GL_HP_occlusion_test */ 631 421 }; 632 422 … … 943 733 /* Texture object record */ 944 734 struct gl_texture_object { 735 _glthread_Mutex Mutex; /* for thread safety */ 945 736 GLint RefCount; /* reference count */ 946 737 GLuint Name; /* an unsigned integer */ … … 963 754 964 755 /* GL_EXT_paletted_texture */ 965 GLubyte Palette[MAX_TEXTURE_PALETTE_SIZE*4]; 966 GLuint PaletteSize; 967 GLenum PaletteIntFormat; 968 GLenum PaletteFormat; 756 struct gl_color_table Palette; 969 757 970 758 /* For device driver: */ … … 1013 801 GLuint TexgenSize; /* size of element generated */ 1014 802 GLboolean AnyTransform; /* texgen or non-identity matrix */ 803 GLfloat LodBias; /* for biasing mipmap levels */ 1015 804 1016 805 struct gl_texture_object *CurrentD[4]; … … 1046 835 /* GL_EXT_shared_texture_palette */ 1047 836 GLboolean SharedPalette; 1048 GLubyte Palette[MAX_TEXTURE_PALETTE_SIZE*4]; 1049 GLuint PaletteSize; 1050 GLenum PaletteIntFormat; 1051 GLenum PaletteFormat; 837 struct gl_color_table Palette; 1052 838 }; 1053 839 … … 1337 1123 1338 1124 struct gl_selection { 1339 GLuint *Buffer;1340 GLuint BufferSize;/* size of SelectBuffer */1341 GLuint BufferCount;/* number of values in SelectBuffer */1342 GLuint Hits;/* number of records in SelectBuffer */1343 GLuint NameStackDepth;1344 GLuint NameStack[MAX_NAME_STACK_DEPTH];1345 GLboolean HitFlag;1346 GLfloat HitMinZ, HitMaxZ;1125 GLuint *Buffer; 1126 GLuint BufferSize; /* size of SelectBuffer */ 1127 GLuint BufferCount; /* number of values in SelectBuffer */ 1128 GLuint Hits; /* number of records in SelectBuffer */ 1129 GLuint NameStackDepth; 1130 GLuint NameStack[MAX_NAME_STACK_DEPTH]; 1131 GLboolean HitFlag; 1132 GLfloat HitMinZ, HitMaxZ; 1347 1133 }; 1348 1134 … … 1353 1139 */ 1354 1140 struct gl_1d_map { 1355 GLuint Order; /* Number of control points */ 1356 GLfloat u1, u2, du; /* u1, u2, 1.0/(u2-u1) */ 1357 GLfloat *Points; /* Points to contiguous control points */ 1358 GLboolean Retain; /* Reference counter */ 1359 }; 1360 1141 GLuint Order; /* Number of control points */ 1142 GLfloat u1, u2, du; /* u1, u2, 1.0/(u2-u1) */ 1143 GLfloat *Points; /* Points to contiguous control points */ 1144 }; 1145 1361 1146 1362 1147 /* … … 1364 1149 */ 1365 1150 struct gl_2d_map { 1366 GLuint Uorder; /* Number of control points in U dimension */ 1367 GLuint Vorder; /* Number of control points in V dimension */ 1368 GLfloat u1, u2, du; 1369 GLfloat v1, v2, dv; 1370 GLfloat *Points; /* Points to contiguous control points */ 1371 GLboolean Retain; /* Reference counter */ 1151 GLuint Uorder; /* Number of control points in U dimension */ 1152 GLuint Vorder; /* Number of control points in V dimension */ 1153 GLfloat u1, u2, du; 1154 GLfloat v1, v2, dv; 1155 GLfloat *Points; /* Points to contiguous control points */ 1372 1156 }; 1373 1157 … … 1377 1161 */ 1378 1162 struct gl_evaluators { 1379 /* 1-D maps */1380 struct gl_1d_map Map1Vertex3;1381 struct gl_1d_map Map1Vertex4;1382 struct gl_1d_map Map1Index;1383 struct gl_1d_map Map1Color4;1384 struct gl_1d_map Map1Normal;1385 struct gl_1d_map Map1Texture1;1386 struct gl_1d_map Map1Texture2;1387 struct gl_1d_map Map1Texture3;1388 struct gl_1d_map Map1Texture4;1389 1390 /* 2-D maps */1391 struct gl_2d_map Map2Vertex3;1392 struct gl_2d_map Map2Vertex4;1393 struct gl_2d_map Map2Index;1394 struct gl_2d_map Map2Color4;1395 struct gl_2d_map Map2Normal;1396 struct gl_2d_map Map2Texture1;1397 struct gl_2d_map Map2Texture2;1398 struct gl_2d_map Map2Texture3;1399 struct gl_2d_map Map2Texture4;1163 /* 1-D maps */ 1164 struct gl_1d_map Map1Vertex3; 1165 struct gl_1d_map Map1Vertex4; 1166 struct gl_1d_map Map1Index; 1167 struct gl_1d_map Map1Color4; 1168 struct gl_1d_map Map1Normal; 1169 struct gl_1d_map Map1Texture1; 1170 struct gl_1d_map Map1Texture2; 1171 struct gl_1d_map Map1Texture3; 1172 struct gl_1d_map Map1Texture4; 1173 1174 /* 2-D maps */ 1175 struct gl_2d_map Map2Vertex3; 1176 struct gl_2d_map Map2Vertex4; 1177 struct gl_2d_map Map2Index; 1178 struct gl_2d_map Map2Color4; 1179 struct gl_2d_map Map2Normal; 1180 struct gl_2d_map Map2Texture1; 1181 struct gl_2d_map Map2Texture2; 1182 struct gl_2d_map Map2Texture3; 1183 struct gl_2d_map Map2Texture4; 1400 1184 }; 1401 1185 … … 1406 1190 */ 1407 1191 struct gl_shared_state { 1408 GLint RefCount; /* Reference count */ 1409 struct HashTable *DisplayList; /* Display lists hash table */ 1410 struct HashTable *TexObjects; /* Texture objects hash table */ 1192 _glthread_Mutex Mutex; /* for thread safety */ 1193 GLint RefCount; /* Reference count */ 1194 struct _mesa_HashTable *DisplayList; /* Display lists hash table */ 1195 struct _mesa_HashTable *TexObjects; /* Texture objects hash table */ 1411 1196 struct gl_texture_object *TexObjectList;/* Linked list of texture objects */ 1412 1197 struct gl_texture_object *DirtyTexObjList; /* List of dirty tex objects */ … … 1424 1209 */ 1425 1210 struct gl_visual { 1426 GLboolean RGBAflag; /* Is frame buffer in RGBA mode, not CI? */ 1427 GLboolean DBflag; /* Is color buffer double buffered? */ 1428 GLboolean StereoFlag; /* stereo buffer? */ 1429 1430 GLint RedBits; /* Bits per color component */ 1431 GLint GreenBits; 1432 GLint BlueBits; 1433 GLint AlphaBits; 1434 1435 GLint IndexBits; /* Bits/pixel if in color index mode */ 1436 1437 GLint AccumBits; /* Number of bits per color channel, or 0 */ 1438 GLint DepthBits; /* Number of bits in depth buffer, or 0 */ 1439 GLint StencilBits; /* Number of bits in stencil buffer, or 0 */ 1440 1441 GLboolean SoftwareAlpha;/* Implement software alpha buffer? */ 1211 GLboolean RGBAflag; /* Is frame buffer in RGBA mode, not CI? */ 1212 GLboolean DBflag; /* Is color buffer double buffered? */ 1213 GLboolean StereoFlag; /* stereo buffer? */ 1214 1215 GLint RedBits; /* Bits per color component */ 1216 GLint GreenBits; 1217 GLint BlueBits; 1218 GLint AlphaBits; 1219 1220 GLint IndexBits; /* Bits/pixel if in color index mode */ 1221 1222 GLint AccumBits; /* Number of bits per color channel, or 0 */ 1223 GLint DepthBits; /* Number of bits in depth buffer, or 0 */ 1224 GLint StencilBits; /* Number of bits in stencil buffer, or 0 */ 1225 1226 GLboolean SoftwareAlpha;/* Implement software alpha buffer? */ 1227 1228 GLuint DepthMax; /* Max depth buffer value */ 1229 GLfloat DepthMaxF; /* Float max depth buffer value */ 1442 1230 }; 1443 1231 … … 1451 1239 */ 1452 1240 struct gl_frame_buffer { 1453 GLvisual *Visual; /* The corresponding visual */ 1454 1455 GLint Width; /* Width of frame buffer in pixels */ 1456 GLint Height; /* Height of frame buffer in pixels */ 1457 1458 GLdepth *Depth; /* array [Width*Height] of GLdepth values */ 1459 1460 /* Stencil buffer */ 1461 GLstencil *Stencil; /* array [Width*Height] of GLstencil values */ 1462 1463 /* Accumulation buffer */ 1464 GLaccum *Accum; /* array [4*Width*Height] of GLaccum values */ 1465 1466 /* Software alpha planes: */ 1467 GLubyte *FrontLeftAlpha; /* array [Width*Height] of GLubyte */ 1468 GLubyte *BackLeftAlpha; /* array [Width*Height] of GLubyte */ 1469 GLubyte *FrontRightAlpha; /* array [Width*Height] of GLubyte */ 1470 GLubyte *BackRightAlpha; /* array [Width*Height] of GLubyte */ 1471 GLubyte *Alpha; /* Points to current alpha buffer */ 1472 1473 /* Drawing bounds: intersection of window size and scissor box */ 1474 GLint Xmin, Xmax, Ymin, Ymax; 1241 GLvisual *Visual; /* The corresponding visual */ 1242 1243 GLint Width, Height; /* Width of frame buffer in pixels */ 1244 1245 GLboolean UseSoftwareDepthBuffer; 1246 GLboolean UseSoftwareAccumBuffer; 1247 GLboolean UseSoftwareStencilBuffer; 1248 GLboolean UseSoftwareAlphaBuffers; 1249 1250 1251 GLvoid *DepthBuffer; /* array [Width*Height] of GLushort or GLint values */ 1252 1253 /* Stencil buffer */ 1254 GLstencil *Stencil; /* array [Width*Height] of GLstencil values */ 1255 1256 /* Accumulation buffer */ 1257 GLaccum *Accum; /* array [4*Width*Height] of GLaccum values */ 1258 1259 /* Software alpha planes: */ 1260 GLubyte *FrontLeftAlpha; /* array [Width*Height] of GLubyte */ 1261 GLubyte *BackLeftAlpha; /* array [Width*Height] of GLubyte */ 1262 GLubyte *FrontRightAlpha; /* array [Width*Height] of GLubyte */ 1263 GLubyte *BackRightAlpha; /* array [Width*Height] of GLubyte */ 1264 GLubyte *Alpha; /* Points to current alpha buffer */ 1265 1266 /* Drawing bounds: intersection of window size and scissor box */ 1267 GLint Xmin, Xmax, Ymin, Ymax; 1475 1268 }; 1476 1269 … … 1484 1277 GLuint MaxTextureUnits; 1485 1278 GLuint MaxArrayLockSize; 1279 GLint SubPixelBits; 1280 GLfloat MinPointSize, MaxPointSize; /* aliased */ 1281 GLfloat MinPointSizeAA, MaxPointSizeAA; /* antialiased */ 1282 GLfloat PointSizeGranularity; 1283 GLfloat MinLineWidth, MaxLineWidth; /* aliased */ 1284 GLfloat MinLineWidthAA, MaxLineWidthAA; /* antialiased */ 1285 GLfloat LineWidthGranularity; 1286 GLuint NumAuxBuffers; 1486 1287 }; 1487 1288 … … 1494 1295 char *ext_string; 1495 1296 struct extension *ext_list; 1297 /* flags to quickly test if certain extensions are available */ 1298 GLboolean HaveTextureEnvAdd; 1299 GLboolean HaveTextureLodBias; 1300 GLboolean HaveHpOcclusionTest; 1496 1301 }; 1497 1302 … … 1500 1305 * Bitmasks to indicate which rasterization options are enabled (RasterMask) 1501 1306 */ 1502 #define ALPHATEST_BIT 0x001/* Alpha-test pixels */1503 #define BLEND_BIT 0x002/* Blend pixels */1504 #define DEPTH_BIT 0x004/* Depth-test pixels */1505 #define FOG_BIT 0x008/* Per-pixel fog */1506 #define LOGIC_OP_BIT 0x010/* Apply logic op in software */1507 #define SCISSOR_BIT 0x020/* Scissor pixels */1508 #define STENCIL_BIT 0x040/* Stencil pixels */1509 #define MASKING_BIT 0x080/* Do glColorMask or glIndexMask */1510 #define ALPHABUF_BIT 0x100/* Using software alpha buffer */1511 #define WINCLIP_BIT 0x200/* Clip pixels/primitives to window */1512 #define MULTI_DRAW_BIT 0x400/* Write to more than one color- */1307 #define ALPHATEST_BIT 0x001 /* Alpha-test pixels */ 1308 #define BLEND_BIT 0x002 /* Blend pixels */ 1309 #define DEPTH_BIT 0x004 /* Depth-test pixels */ 1310 #define FOG_BIT 0x008 /* Per-pixel fog */ 1311 #define LOGIC_OP_BIT 0x010 /* Apply logic op in software */ 1312 #define SCISSOR_BIT 0x020 /* Scissor pixels */ 1313 #define STENCIL_BIT 0x040 /* Stencil pixels */ 1314 #define MASKING_BIT 0x080 /* Do glColorMask or glIndexMask */ 1315 #define ALPHABUF_BIT 0x100 /* Using software alpha buffer */ 1316 #define WINCLIP_BIT 0x200 /* Clip pixels/primitives to window */ 1317 #define MULTI_DRAW_BIT 0x400 /* Write to more than one color- */ 1513 1318 /* buffer or no buffers. */ 1319 #define OCCLUSION_BIT 0x800 /* GL_HP_occlusion_test enabled */ 1320 1514 1321 1515 1322 /* 1516 1323 * Bits to indicate what state has to be updated (NewState) 1517 1324 */ 1518 #define NEW_LIGHTING 0x11519 #define NEW_RASTER_OPS 0x21520 #define NEW_TEXTURING 0x41521 #define NEW_POLYGON 0x81522 #define NEW_DRVSTATE0 0x10 /* Reserved for drivers */1523 #define NEW_DRVSTATE1 0x20 /* Reserved for drivers */1524 #define NEW_DRVSTATE2 0x40 /* Reserved for drivers */1525 #define NEW_DRVSTATE3 0x80 /* Reserved for drivers */1526 #define NEW_MODELVIEW 0x1001527 #define NEW_PROJECTION 0x2001528 #define NEW_TEXTURE_MATRIX 0x4001529 #define NEW_USER_CLIP 0x8001325 #define NEW_LIGHTING 0x1 1326 #define NEW_RASTER_OPS 0x2 1327 #define NEW_TEXTURING 0x4 1328 #define NEW_POLYGON 0x8 1329 #define NEW_DRVSTATE0 0x10 /* Reserved for drivers */ 1330 #define NEW_DRVSTATE1 0x20 /* Reserved for drivers */ 1331 #define NEW_DRVSTATE2 0x40 /* Reserved for drivers */ 1332 #define NEW_DRVSTATE3 0x80 /* Reserved for drivers */ 1333 #define NEW_MODELVIEW 0x100 1334 #define NEW_PROJECTION 0x200 1335 #define NEW_TEXTURE_MATRIX 0x400 1336 #define NEW_USER_CLIP 0x800 1530 1337 #define NEW_TEXTURE_ENV 0x1000 1531 1338 #define NEW_CLIENT_STATE 0x2000 … … 1534 1341 #define NEW_VIEWPORT 0x10000 1535 1342 #define NEW_TEXTURE_ENABLE 0x20000 1536 #define NEW_ALL ~01537 1538 1539 #define NEW_DRIVER_STATE (NEW_DRVSTATE0 | NEW_DRVSTATE1 | \1343 #define NEW_ALL ~0 1344 1345 1346 #define NEW_DRIVER_STATE (NEW_DRVSTATE0 | NEW_DRVSTATE1 | \ 1540 1347 NEW_DRVSTATE2 | NEW_DRVSTATE3) 1541 1348 … … 1570 1377 #define DD_CLIP_FOG_COORD 0x2000000 1571 1378 1572 #define DD_SW_SETUP (DD_TRI_CULL| \ 1573 DD_TRI_CULL_FRONT_BACK| \ 1574 DD_TRI_OFFSET| \ 1575 DD_TRI_LIGHT_TWOSIDE| \ 1379 1380 1381 #define DD_SW_SETUP (DD_TRI_CULL| \ 1382 DD_TRI_CULL_FRONT_BACK| \ 1383 DD_TRI_OFFSET| \ 1384 DD_TRI_LIGHT_TWOSIDE| \ 1576 1385 DD_TRI_UNFILLED) 1577 1386 1578 #define DD_ANY_CULL (DD_TRI_CULL_FRONT_BACK| \1579 DD_TRI_CULL| \1387 #define DD_ANY_CULL (DD_TRI_CULL_FRONT_BACK| \ 1388 DD_TRI_CULL| \ 1580 1389 DD_LIGHTING_CULL) 1581 1390 1582 #define DD_SW_RASTERIZE (DD_POINT_SW_RASTERIZE| \1583 DD_LINE_SW_RASTERIZE| \1584 DD_TRI_SW_RASTERIZE| \1391 #define DD_SW_RASTERIZE (DD_POINT_SW_RASTERIZE| \ 1392 DD_LINE_SW_RASTERIZE| \ 1393 DD_TRI_SW_RASTERIZE| \ 1585 1394 DD_QUAD_SW_RASTERIZE) 1586 1395 … … 1588 1397 /* Vertex buffer clipping flags 1589 1398 */ 1590 #define CLIP_RIGHT_SHIFT 01591 #define CLIP_LEFT_SHIFT 11592 #define CLIP_TOP_SHIFT 21399 #define CLIP_RIGHT_SHIFT 0 1400 #define CLIP_LEFT_SHIFT 1 1401 #define CLIP_TOP_SHIFT 2 1593 1402 #define CLIP_BOTTOM_SHIFT 3 1594 #define CLIP_NEAR_SHIFT 41595 #define CLIP_FAR_SHIFT 51403 #define CLIP_NEAR_SHIFT 4 1404 #define CLIP_FAR_SHIFT 5 1596 1405 1597 1406 #define CLIP_RIGHT_BIT 0x01 … … 1602 1411 #define CLIP_FAR_BIT 0x20 1603 1412 #define CLIP_USER_BIT 0x40 1604 #define CLIP_CULLED_BIT 0x80 /* Vertex has been culled */1413 #define CLIP_CULLED_BIT 0x80 /* Vertex has been culled */ 1605 1414 #define CLIP_ALL_BITS 0x3f 1606 1415 … … 1611 1420 * and some misc. flags. 1612 1421 */ 1613 #define VERT_FACE_FRONT 0x1 /* is in a front-color primitive */1614 #define VERT_FACE_REAR 0x2 /* is in a rear-color primitive */1615 #define PRIM_FACE_FRONT 0x4 /* use front color */1616 #define PRIM_FACE_REAR 0x8 /* use rear color */1617 #define PRIM_CLIPPED 0x10 /* needs clipping */1618 #define PRIM_USER_CLIPPED CLIP_USER_BIT /* 0x40 */1422 #define VERT_FACE_FRONT 0x1 /* is in a front-color primitive */ 1423 #define VERT_FACE_REAR 0x2 /* is in a rear-color primitive */ 1424 #define PRIM_FACE_FRONT 0x4 /* use front color */ 1425 #define PRIM_FACE_REAR 0x8 /* use rear color */ 1426 #define PRIM_CLIPPED 0x10 /* needs clipping */ 1427 #define PRIM_USER_CLIPPED CLIP_USER_BIT /* 0x40 */ 1619 1428 1620 1429 … … 1643 1452 /* Flags for selecting a normal transformation function. 1644 1453 */ 1645 #define NORM_RESCALE 0x1 /* apply the scale factor */1646 #define NORM_NORMALIZE 0x2 /* normalize */1647 #define NORM_TRANSFORM 0x4 /* apply the transformation matrix */1648 #define NORM_TRANSFORM_NO_ROT 0x8 /* apply the transformation matrix */1454 #define NORM_RESCALE 0x1 /* apply the scale factor */ 1455 #define NORM_NORMALIZE 0x2 /* normalize */ 1456 #define NORM_TRANSFORM 0x4 /* apply the transformation matrix */ 1457 #define NORM_TRANSFORM_NO_ROT 0x8 /* apply the transformation matrix */ 1649 1458 1650 1459 … … 1652 1461 * Different kinds of 4x4 transformation matrices: 1653 1462 */ 1654 #define MATRIX_GENERAL 0/* general 4x4 matrix */1655 #define MATRIX_IDENTITY 1/* identity matrix */1656 #define MATRIX_3D_NO_ROT 2/* ortho projection and others... */1657 #define MATRIX_PERSPECTIVE 3/* perspective projection matrix */1658 #define MATRIX_2D 4/* 2-D transformation */1659 #define MATRIX_2D_NO_ROT 5/* 2-D scale & translate only */1660 #define MATRIX_3D 6/* 3-D transformation */1463 #define MATRIX_GENERAL 0 /* general 4x4 matrix */ 1464 #define MATRIX_IDENTITY 1 /* identity matrix */ 1465 #define MATRIX_3D_NO_ROT 2 /* ortho projection and others... */ 1466 #define MATRIX_PERSPECTIVE 3 /* perspective projection matrix */ 1467 #define MATRIX_2D 4 /* 2-D transformation */ 1468 #define MATRIX_2D_NO_ROT 5 /* 2-D scale & translate only */ 1469 #define MATRIX_3D 6 /* 3-D transformation */ 1661 1470 1662 1471 #define MAT_FLAG_IDENTITY 0 … … 1686 1495 1687 1496 #define MAT_FLAGS_ANGLE_PRESERVING (MAT_FLAG_ROTATION | \ 1688 MAT_FLAG_TRANSLATION | \1689 MAT_FLAG_UNIFORM_SCALE)1497 MAT_FLAG_TRANSLATION | \ 1498 MAT_FLAG_UNIFORM_SCALE) 1690 1499 1691 1500 #define MAT_FLAGS_LENGTH_PRESERVING (MAT_FLAG_ROTATION | \ 1692 MAT_FLAG_TRANSLATION)1501 MAT_FLAG_TRANSLATION) 1693 1502 1694 1503 #define MAT_FLAGS_3D (MAT_FLAG_ROTATION | \ 1695 MAT_FLAG_TRANSLATION | \1696 MAT_FLAG_UNIFORM_SCALE | \1697 MAT_FLAG_GENERAL_SCALE | \1698 MAT_FLAG_GENERAL_3D)1504 MAT_FLAG_TRANSLATION | \ 1505 MAT_FLAG_UNIFORM_SCALE | \ 1506 MAT_FLAG_GENERAL_SCALE | \ 1507 MAT_FLAG_GENERAL_3D) 1699 1508 1700 1509 #define MAT_FLAGS_GEOMETRY (MAT_FLAG_GENERAL | \ 1701 MAT_FLAG_ROTATION | \1702 MAT_FLAG_TRANSLATION | \1703 MAT_FLAG_UNIFORM_SCALE | \1704 MAT_FLAG_GENERAL_SCALE | \1705 MAT_FLAG_GENERAL_3D | \1706 MAT_FLAG_PERSPECTIVE)1510 MAT_FLAG_ROTATION | \ 1511 MAT_FLAG_TRANSLATION | \ 1512 MAT_FLAG_UNIFORM_SCALE | \ 1513 MAT_FLAG_GENERAL_SCALE | \ 1514 MAT_FLAG_GENERAL_3D | \ 1515 MAT_FLAG_PERSPECTIVE) 1707 1516 1708 1517 #define MAT_DIRTY_ALL_OVER (MAT_DIRTY_TYPE | \ 1709 MAT_DIRTY_DEPENDENTS | \1710 MAT_DIRTY_FLAGS | \1711 MAT_DIRTY_INVERSE)1518 MAT_DIRTY_DEPENDENTS | \ 1519 MAT_DIRTY_FLAGS | \ 1520 MAT_DIRTY_INVERSE) 1712 1521 1713 1522 #define TEST_MAT_FLAGS(mat, a) ((MAT_FLAGS_GEOMETRY&(~(a))&((mat)->flags))==0) … … 1717 1526 * FogMode values: 1718 1527 */ 1719 #define FOG_NONE 0/* no fog */1720 #define FOG_VERTEX 1/* apply per vertex */1721 #define FOG_FRAGMENT 2/* apply per fragment */1528 #define FOG_NONE 0 /* no fog */ 1529 #define FOG_VERTEX 1 /* apply per vertex */ 1530 #define FOG_FRAGMENT 2 /* apply per fragment */ 1722 1531 1723 1532 … … 1743 1552 */ 1744 1553 1745 #define VERT_OBJ_2 0x1 /* glVertex2 */1554 #define VERT_OBJ_2 0x1 /* glVertex2 */ 1746 1555 #define VERT_OBJ_3 0x2 /* glVertex3 */ 1747 1556 #define VERT_OBJ_4 0x4 /* glVertex4 */ 1748 #define VERT_BEGIN 0x8 /* glBegin */1749 #define VERT_END 0x10 /* glEnd */1750 #define VERT_ELT 0x20 /* glArrayElement */1751 #define VERT_RGBA 0x40 /* glColor */1752 #define VERT_NORM 0x80 /* glNormal */1753 #define VERT_INDEX 0x100 /* glIndex */1754 #define VERT_EDGE 0x200 /* glEdgeFlag */1755 #define VERT_MATERIAL 0x400 /* glMaterial */1756 #define VERT_TEX0_1 0x800 1557 #define VERT_BEGIN 0x8 /* glBegin */ 1558 #define VERT_END 0x10 /* glEnd */ 1559 #define VERT_ELT 0x20 /* glArrayElement */ 1560 #define VERT_RGBA 0x40 /* glColor */ 1561 #define VERT_NORM 0x80 /* glNormal */ 1562 #define VERT_INDEX 0x100 /* glIndex */ 1563 #define VERT_EDGE 0x200 /* glEdgeFlag */ 1564 #define VERT_MATERIAL 0x400 /* glMaterial */ 1565 #define VERT_TEX0_1 0x800 1757 1566 #define VERT_TEX0_2 0x1000 1758 1567 #define VERT_TEX0_3 0x2000 … … 1771 1580 #define VERT_EVAL_P1 0x4000000 /* */ 1772 1581 #define VERT_EVAL_P2 0x8000000 /* */ 1773 #define VERT_ FLOAT_RGBA 0x10000000 /* allow partial support for this */1774 #define VERT_FOG_COORD 0x20000000 /* internal use only, currently */1582 #define VERT_SPEC_RGB 0x10000000 1583 #define VERT_FOG_COORD 0x20000000 /* internal use only, currently */ 1775 1584 1776 1585 #define VERT_EYE VERT_BEGIN /* for pipeline management & cva */ … … 1784 1593 #define VERT_TEX0_SHIFT 11 1785 1594 1786 #define VERT_EVAL_ANY (VERT_EVAL_C1|VERT_EVAL_P1| \1595 #define VERT_EVAL_ANY (VERT_EVAL_C1|VERT_EVAL_P1| \ 1787 1596 VERT_EVAL_C2|VERT_EVAL_P2) 1788 1597 … … 1818 1627 1819 1628 #define VERT_FIXUP (VERT_TEX0_ANY|VERT_TEX1_ANY|VERT_RGBA| \ 1820 VERT_INDEX|VERT_EDGE|VERT_NORM)1629 VERT_INDEX|VERT_EDGE|VERT_NORM) 1821 1630 1822 1631 #define VERT_DATA (VERT_TEX0_ANY|VERT_TEX1_ANY|VERT_RGBA| \ 1823 VERT_INDEX|VERT_EDGE|VERT_NORM| \1824 VERT_OBJ_ANY|VERT_MATERIAL|VERT_ELT| \1825 VERT_EVAL_ANY|VERT_FOG_COORD)1632 VERT_INDEX|VERT_EDGE|VERT_NORM| \ 1633 VERT_OBJ_ANY|VERT_MATERIAL|VERT_ELT| \ 1634 VERT_EVAL_ANY|VERT_FOG_COORD) 1826 1635 1827 1636 … … 1835 1644 /* For beginstate 1836 1645 */ 1837 #define VERT_BEGIN_0 0x1 /* glBegin (if initially inside beg/end) */1838 #define VERT_BEGIN_1 0x2 /* glBegin (if initially outside beg/end) */1839 #define VERT_ERROR_0 0x4 /* invalid_operation in initial state 0 */1646 #define VERT_BEGIN_0 0x1 /* glBegin (if initially inside beg/end) */ 1647 #define VERT_BEGIN_1 0x2 /* glBegin (if initially outside beg/end) */ 1648 #define VERT_ERROR_0 0x4 /* invalid_operation in initial state 0 */ 1840 1649 #define VERT_ERROR_1 0x8 /* invalid_operation in initial state 1 */ 1841 1650 … … 1847 1656 1848 1657 typedef GLuint (*clip_line_func)( struct vertex_buffer *VB, 1849 GLuint *i, GLuint *j,1850 GLubyte mask);1658 GLuint *i, GLuint *j, 1659 GLubyte mask); 1851 1660 typedef GLuint (*clip_poly_func)( struct vertex_buffer *VB, 1852 GLuint n, GLuint vlist[],1853 GLubyte mask );1661 GLuint n, GLuint vlist[], 1662 GLubyte mask ); 1854 1663 1855 1664 /* … … 1858 1667 1859 1668 struct gl_context { 1860 /* State possibly shared with other contexts in the address space */1861 struct gl_shared_state *Shared;1862 1863 /* API function pointer tables */1864 struct gl_api_table API; /* For api.c*/1865 struct gl_api_table Save; /* Display list save funcs */1866 struct gl_api_table Exec; /* Execute funcs*/1669 /* State possibly shared with other contexts in the address space */ 1670 struct gl_shared_state *Shared; 1671 1672 /* API function pointer tables */ 1673 struct _glapi_table *Save; /* Display list save funcs */ 1674 struct _glapi_table *Exec; /* Execute funcs */ 1675 struct _glapi_table *CurrentDispatch; /* == Save or Exec !! */ 1867 1676 1868 1677 GLvisual *Visual; 1869 GLframebuffer *Buffer; 1870 1871 /* Driver function pointer table */ 1872 struct dd_function_table Driver; 1873 1678 GLframebuffer *DrawBuffer; 1679 GLframebuffer *ReadBuffer; 1680 1681 /* Driver function pointer table */ 1682 struct dd_function_table Driver; 1683 1874 1684 triangle_func TriangleFunc; /* driver or indirect triangle func */ 1875 1685 quad_func QuadFunc; 1876 1686 triangle_func ClippedTriangleFunc; 1877 clip_poly_func *poly_clip_tab;1878 clip_line_func *line_clip_tab;1879 1880 void *DriverCtx;/* Points to device driver context/state */1881 void *DriverMgrCtx;/* Points to device driver manager (optional)*/1882 1883 /* Core/Driver constants */1884 struct gl_constants Const;1885 1886 /* Modelview matrix and stack */1887 GLmatrix ModelView; 1888 GLuint ModelViewStackDepth;1889 GLmatrix ModelViewStack[MAX_MODELVIEW_STACK_DEPTH];1890 1891 /* Projection matrix and stack */1892 GLmatrix ProjectionMatrix;1893 GLuint ProjectionStackDepth;1894 GLmatrix ProjectionStack[MAX_PROJECTION_STACK_DEPTH];1895 GLfloat NearFarStack[MAX_PROJECTION_STACK_DEPTH][2];1687 clip_poly_func *poly_clip_tab; 1688 clip_line_func *line_clip_tab; 1689 1690 void *DriverCtx; /* Points to device driver context/state */ 1691 void *DriverMgrCtx; /* Points to device driver manager (optional)*/ 1692 1693 /* Core/Driver constants */ 1694 struct gl_constants Const; 1695 1696 /* Modelview matrix and stack */ 1697 GLmatrix ModelView; 1698 GLuint ModelViewStackDepth; 1699 GLmatrix ModelViewStack[MAX_MODELVIEW_STACK_DEPTH - 1]; 1700 1701 /* Projection matrix and stack */ 1702 GLmatrix ProjectionMatrix; 1703 GLuint ProjectionStackDepth; 1704 GLmatrix ProjectionStack[MAX_PROJECTION_STACK_DEPTH - 1]; 1705 GLfloat NearFarStack[MAX_PROJECTION_STACK_DEPTH - 1][2]; 1896 1706 1897 1707 /* Combined modelview and projection matrix */ … … 1902 1712 GLboolean ModelProjectWinMatrixUptodate; 1903 1713 1904 /* Texture matrix and stack */1905 GLmatrix TextureMatrix[MAX_TEXTURE_UNITS];1906 GLuint TextureStackDepth[MAX_TEXTURE_UNITS];1907 GLmatrix TextureStack[MAX_TEXTURE_UNITS][MAX_TEXTURE_STACK_DEPTH];1908 1909 /* Display lists */1910 GLuint CallDepth;/* Current recursion calling depth */1911 GLboolean ExecuteFlag;/* Execute GL commands? */1912 GLboolean CompileFlag;/* Compile GL commands into display list? */1913 GLboolean CompileCVAFlag;1914 Node *CurrentListPtr;/* Head of list being compiled */1915 GLuint CurrentListNum;/* Number of the list being compiled */1916 Node *CurrentBlock;/* Pointer to current block of nodes */1917 GLuint CurrentPos;/* Index into current block of nodes */1918 1919 /* Extensions */1920 struct gl_extensions Extensions;1921 1922 1923 /* Pipeline stages - shared between the two pipelines,1924 * which live in CVA.1925 */1926 struct gl_pipeline_stage PipelineStage[MAX_PIPELINE_STAGES];1927 GLuint NrPipelineStages;1928 1929 /* Cva */1930 struct gl_cva CVA;1931 1932 /* Renderer attribute stack */1933 GLuint AttribStackDepth;1934 struct gl_attrib_node *AttribStack[MAX_ATTRIB_STACK_DEPTH];1935 1936 /* Renderer attribute groups */1937 struct gl_accum_attribAccum;1938 struct gl_colorbuffer_attribColor;1939 struct gl_current_attribCurrent;1940 struct gl_depthbuffer_attribDepth;1941 struct gl_eval_attribEval;1942 struct gl_fog_attribFog;1943 struct gl_hint_attribHint;1944 struct gl_light_attribLight;1945 struct gl_line_attribLine;1946 struct gl_list_attribList;1947 struct gl_pixel_attribPixel;1948 struct gl_point_attribPoint;1949 struct gl_polygon_attribPolygon;1950 GLuint PolygonStipple[32];1951 struct gl_scissor_attribScissor;1952 struct gl_stencil_attribStencil;1953 struct gl_texture_attribTexture;1954 struct gl_transform_attribTransform;1955 struct gl_viewport_attribViewport;1956 1957 /* Client attribute stack */1958 GLuint ClientAttribStackDepth;1959 struct gl_attrib_node *ClientAttribStack[MAX_CLIENT_ATTRIB_STACK_DEPTH];1960 1961 /* Client attribute groups */1962 struct gl_array_attrib Array;/* Vertex arrays */1963 struct gl_pixelstore_attrib Pack;/* Pixel packing */1964 struct gl_pixelstore_attrib Unpack;/* Pixel unpacking */1965 1966 struct gl_evaluators EvalMap;/* All evaluators */1967 struct gl_feedback Feedback;/* Feedback */1968 struct gl_selection Select;/* Selection */1969 1970 /* Optimized Accumulation buffer info */1971 GLboolean IntegerAccumMode;/* Storing unscaled integers? */1972 GLfloat IntegerAccumScaler;/* Implicit scale factor */1973 1974 1975 struct gl_fallback_arrays Fallback;1976 1977 GLenum ErrorValue;/* Last error code */1978 1979 /* Miscellaneous */1714 /* Texture matrix and stack */ 1715 GLmatrix TextureMatrix[MAX_TEXTURE_UNITS]; 1716 GLuint TextureStackDepth[MAX_TEXTURE_UNITS]; 1717 GLmatrix TextureStack[MAX_TEXTURE_UNITS][MAX_TEXTURE_STACK_DEPTH - 1]; 1718 1719 /* Display lists */ 1720 GLuint CallDepth; /* Current recursion calling depth */ 1721 GLboolean ExecuteFlag; /* Execute GL commands? */ 1722 GLboolean CompileFlag; /* Compile GL commands into display list? */ 1723 GLboolean CompileCVAFlag; 1724 Node *CurrentListPtr; /* Head of list being compiled */ 1725 GLuint CurrentListNum; /* Number of the list being compiled */ 1726 Node *CurrentBlock; /* Pointer to current block of nodes */ 1727 GLuint CurrentPos; /* Index into current block of nodes */ 1728 1729 /* Extensions */ 1730 struct gl_extensions Extensions; 1731 1732 1733 /* Pipeline stages - shared between the two pipelines, 1734 * which live in CVA. 1735 */ 1736 struct gl_pipeline_stage PipelineStage[MAX_PIPELINE_STAGES]; 1737 GLuint NrPipelineStages; 1738 1739 /* Cva */ 1740 struct gl_cva CVA; 1741 1742 /* Renderer attribute stack */ 1743 GLuint AttribStackDepth; 1744 struct gl_attrib_node *AttribStack[MAX_ATTRIB_STACK_DEPTH]; 1745 1746 /* Renderer attribute groups */ 1747 struct gl_accum_attrib Accum; 1748 struct gl_colorbuffer_attrib Color; 1749 struct gl_current_attrib Current; 1750 struct gl_depthbuffer_attrib Depth; 1751 struct gl_eval_attrib Eval; 1752 struct gl_fog_attrib Fog; 1753 struct gl_hint_attrib Hint; 1754 struct gl_light_attrib Light; 1755 struct gl_line_attrib Line; 1756 struct gl_list_attrib List; 1757 struct gl_pixel_attrib Pixel; 1758 struct gl_point_attrib Point; 1759 struct gl_polygon_attrib Polygon; 1760 GLuint PolygonStipple[32]; 1761 struct gl_scissor_attrib Scissor; 1762 struct gl_stencil_attrib Stencil; 1763 struct gl_texture_attrib Texture; 1764 struct gl_transform_attrib Transform; 1765 struct gl_viewport_attrib Viewport; 1766 1767 /* Client attribute stack */ 1768 GLuint ClientAttribStackDepth; 1769 struct gl_attrib_node *ClientAttribStack[MAX_CLIENT_ATTRIB_STACK_DEPTH]; 1770 1771 /* Client attribute groups */ 1772 struct gl_array_attrib Array; /* Vertex arrays */ 1773 struct gl_pixelstore_attrib Pack; /* Pixel packing */ 1774 struct gl_pixelstore_attrib Unpack; /* Pixel unpacking */ 1775 1776 struct gl_evaluators EvalMap; /* All evaluators */ 1777 struct gl_feedback Feedback; /* Feedback */ 1778 struct gl_selection Select; /* Selection */ 1779 1780 /* Optimized Accumulation buffer info */ 1781 GLboolean IntegerAccumMode; /* Storing unscaled integers? */ 1782 GLfloat IntegerAccumScaler; /* Implicit scale factor */ 1783 1784 1785 struct gl_fallback_arrays Fallback; 1786 1787 GLenum ErrorValue; /* Last error code */ 1788 1789 /* Miscellaneous */ 1980 1790 GLuint NewState; /* bitwise OR of NEW_* flags */ 1981 GLuint Enabled; /* bitwise or of ENABLE_* flags */1982 GLenum RenderMode;/* either GL_RENDER, GL_SELECT, GL_FEEDBACK */1983 GLuint StippleCounter;/* Line stipple counter */1984 GLuint RasterMask;/* OR of rasterization flags */1985 GLuint TriangleCaps; /* OR of DD_* flags */1986 GLuint IndirectTriangles; /* TriangleCaps not handled by the driver */1987 GLfloat PolygonZoffset;/* Z offset for GL_FILL polygons */1988 GLfloat LineZoffset;/* Z offset for GL_LINE polygons */1989 GLfloat PointZoffset;/* Z offset for GL_POINT polygons */1990 GLboolean NeedNormals;/* Are vertex normal vectors needed? */1791 GLuint Enabled; /* bitwise or of ENABLE_* flags */ 1792 GLenum RenderMode; /* either GL_RENDER, GL_SELECT, GL_FEEDBACK */ 1793 GLuint StippleCounter; /* Line stipple counter */ 1794 GLuint RasterMask; /* OR of rasterization flags */ 1795 GLuint TriangleCaps; /* OR of DD_* flags */ 1796 GLuint IndirectTriangles; /* TriangleCaps not handled by the driver */ 1797 GLfloat PolygonZoffset; /* Z offset for GL_FILL polygons */ 1798 GLfloat LineZoffset; /* Z offset for GL_LINE polygons */ 1799 GLfloat PointZoffset; /* Z offset for GL_POINT polygons */ 1800 GLboolean NeedNormals; /* Are vertex normal vectors needed? */ 1991 1801 GLboolean MutablePixels;/* Can rasterization change pixel's color? */ 1992 1802 GLboolean MonoPixels; /* Are all pixels likely to be same color? */ 1993 GLuint FogMode; /* FOG_OFF, FOG_VERTEX or FOG_FRAGMENT */ 1994 1995 GLboolean DoViewportMapping; 1996 1997 1998 GLuint RenderFlags; /* Active inputs to render stage */ 1999 2000 GLuint RequireWriteableFlags; /* What can the driver/clipping tolerate? */ 2001 2002 /* Points to function which interpolates colors, etc when clipping */ 2003 clip_interp_func ClipInterpFunc; 2004 GLuint ClipTabMask; 1803 GLuint FogMode; /* FOG_OFF, FOG_VERTEX or FOG_FRAGMENT */ 1804 1805 GLboolean DoViewportMapping; 1806 1807 GLuint RenderFlags; /* Active inputs to render stage */ 1808 1809 GLuint RequireWriteableFlags; /* What can the driver/clipping tolerate? */ 1810 1811 /* Points to function which interpolates colors, etc when clipping */ 1812 clip_interp_func ClipInterpFunc; 1813 GLuint ClipTabMask; 2005 1814 2006 1815 normal_func *NormalTransform; 2007 1816 2008 /* Current shading function */1817 /* Current shading function */ 2009 1818 GLuint shade_func_flags; 2010 1819 … … 2012 1821 GLfloat rescale_factor; 2013 1822 2014 GLfloat vb_rescale_factor;2015 GLmatrix *vb_proj_matrix;2016 2017 GLubyte AllowVertexCull; /* To be set by the geometry driver */1823 GLfloat vb_rescale_factor; 1824 GLmatrix *vb_proj_matrix; 1825 1826 GLubyte AllowVertexCull; /* To be set by the geometry driver */ 2018 1827 GLboolean NeedEyeCoords; 2019 1828 GLboolean NeedEyeNormals; 2020 1829 GLboolean NeedClipCoords; 2021 1830 2022 GLfloat backface_sign; 1831 GLfloat backface_sign; 1832 1833 GLboolean OcclusionResult; /* GL_HP_occlusion_test */ 2023 1834 2024 1835 /* Destination of immediate mode commands */ … … 2026 1837 2027 1838 2028 /* Cache of unused immediate structs2029 */2030 struct immediate *freed_im_queue;2031 GLuint nr_im_queued;1839 /* Cache of unused immediate structs 1840 */ 1841 struct immediate *freed_im_queue; 1842 GLuint nr_im_queued; 2032 1843 2033 1844 /* The vertex buffer being used by this context. 2034 */1845 */ 2035 1846 struct vertex_buffer *VB; 2036 1847 … … 2044 1855 #ifdef PROFILE 2045 1856 /* Performance measurements */ 2046 GLuint BeginEndCount; /* number of glBegin/glEnd pairs */2047 GLdouble BeginEndTime; /* seconds spent between glBegin/glEnd */2048 GLuint VertexCount; /* number of vertices processed */2049 GLdouble VertexTime; /* total time in seconds */2050 GLuint PointCount; /* number of points rendered */2051 GLdouble PointTime; /* total time in seconds */2052 GLuint LineCount; /* number of lines rendered */2053 GLdouble LineTime; /* total time in seconds */2054 GLuint PolygonCount; /* number of polygons rendered */2055 GLdouble PolygonTime; /* total time in seconds */2056 GLuint ClearCount; /* number of glClear calls */2057 GLdouble ClearTime; /* seconds spent in glClear*/2058 GLuint SwapCount; /* number of swap-buffer calls*/2059 GLdouble SwapTime; /* seconds spent in swap-buffers*/1857 GLuint BeginEndCount; /* number of glBegin/glEnd pairs */ 1858 GLdouble BeginEndTime; /* seconds spent between glBegin/glEnd */ 1859 GLuint VertexCount; /* number of vertices processed */ 1860 GLdouble VertexTime; /* total time in seconds */ 1861 GLuint PointCount; /* number of points rendered */ 1862 GLdouble PointTime; /* total time in seconds */ 1863 GLuint LineCount; /* number of lines rendered */ 1864 GLdouble LineTime; /* total time in seconds */ 1865 GLuint PolygonCount; /* number of polygons rendered */ 1866 GLdouble PolygonTime; /* total time in seconds */ 1867 GLuint ClearCount; /* number of glClear calls */ 1868 GLdouble ClearTime; /* seconds spent in glClear */ 1869 GLuint SwapCount; /* number of swap-buffer calls */ 1870 GLdouble SwapTime; /* seconds spent in swap-buffers */ 2060 1871 #endif 2061 1872 … … 2084 1895 2085 1896 enum _verbose { 2086 VERBOSE_VARRAY = 0x1, 2087 VERBOSE_TEXTURE = 0x2, 2088 VERBOSE_IMMEDIATE = 0x4, 2089 VERBOSE_PIPELINE = 0x8, 2090 VERBOSE_DRIVER = 0x10, 2091 VERBOSE_STATE = 0x20, 2092 VERBOSE_API = 0x40, 2093 VERBOSE_TRIANGLE_CHECKS = 0x80, 2094 VERBOSE_CULL = 0x100, 2095 VERBOSE_DISPLAY_LIST = 0x200 1897 VERBOSE_VARRAY = 0x1, 1898 VERBOSE_TEXTURE = 0x2, 1899 VERBOSE_IMMEDIATE = 0x4, 1900 VERBOSE_PIPELINE = 0x8, 1901 VERBOSE_DRIVER = 0x10, 1902 VERBOSE_STATE = 0x20, 1903 VERBOSE_API = 0x40, 1904 VERBOSE_TRIANGLE_CHECKS = 0x80, 1905 VERBOSE_CULL = 0x100, 1906 VERBOSE_DISPLAY_LIST = 0x200, 1907 VERBOSE_LIGHTING = 0x400 2096 1908 }; 2097 1909 2098 1910 2099 1911 enum _debug { 2100 DEBUG_ALWAYS_FLUSH = 0x11912 DEBUG_ALWAYS_FLUSH = 0x1 2101 1913 }; 2102 1914 … … 2106 1918 extern void RESET_IMMEDIATE( GLcontext *ctx ); 2107 1919 2108 #define FLUSH_VB( ctx, where ) \2109 do { \2110 struct immediate *IM = ctx->input;\2111 if (IM->Flag[IM->Start])\2112 gl_flush_vb( ctx, where );\1920 #define FLUSH_VB( ctx, where ) \ 1921 do { \ 1922 struct immediate *IM = ctx->input; \ 1923 if (IM->Flag[IM->Start]) \ 1924 gl_flush_vb( ctx, where ); \ 2113 1925 } while (0) 2114 1926 … … 2118 1930 /* Test if we're inside a glBegin / glEnd pair: 2119 1931 */ 2120 #define ASSERT_OUTSIDE_BEGIN_END( ctx, where ) \2121 do { \2122 struct immediate *IM = ctx->input;\2123 GLuint flag = IM->Flag[IM->Count];\2124 if ((flag & (VERT_BEGIN|VERT_END)) != VERT_END) {\2125 FLUSH_VB(ctx, where); \2126 if (ctx->Current.Primitive != GL_POLYGON+1) {\2127 gl_error( ctx, GL_INVALID_OPERATION, where );\2128 return;\2129 }\2130 }\1932 #define ASSERT_OUTSIDE_BEGIN_END( ctx, where ) \ 1933 do { \ 1934 struct immediate *IM = ctx->input; \ 1935 GLuint flag = IM->Flag[IM->Count]; \ 1936 if ((flag & (VERT_BEGIN|VERT_END)) != VERT_END) { \ 1937 FLUSH_VB(ctx, where); \ 1938 if (ctx->Current.Primitive != GL_POLYGON+1) { \ 1939 gl_error( ctx, GL_INVALID_OPERATION, where ); \ 1940 return; \ 1941 } \ 1942 } \ 2131 1943 } while (0) 2132 1944 2133 #define ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL( ctx, where, what ) \2134 do { \2135 struct immediate *IM = ctx->input;\2136 GLuint flag = IM->Flag[IM->Count];\2137 if ((flag & (VERT_BEGIN|VERT_END)) != VERT_END) {\2138 FLUSH_VB(ctx, where); \2139 if (ctx->Current.Primitive != GL_POLYGON+1) {\2140 gl_error( ctx, GL_INVALID_OPERATION, where );\2141 return what;\2142 }\2143 }\1945 #define ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL( ctx, where, what ) \ 1946 do { \ 1947 struct immediate *IM = ctx->input; \ 1948 GLuint flag = IM->Flag[IM->Count]; \ 1949 if ((flag & (VERT_BEGIN|VERT_END)) != VERT_END) { \ 1950 FLUSH_VB(ctx, where); \ 1951 if (ctx->Current.Primitive != GL_POLYGON+1) { \ 1952 gl_error( ctx, GL_INVALID_OPERATION, where ); \ 1953 return what; \ 1954 } \ 1955 } \ 2144 1956 } while (0) 2145 1957 2146 1958 2147 #define ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH( ctx, where ) \2148 do { \2149 FLUSH_VB( ctx, where );\2150 if (ctx->Current.Primitive != GL_POLYGON+1) {\2151 gl_error( ctx, GL_INVALID_OPERATION, where );\2152 return;\2153 }\1959 #define ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH( ctx, where ) \ 1960 do { \ 1961 FLUSH_VB( ctx, where ); \ 1962 if (ctx->Current.Primitive != GL_POLYGON+1) { \ 1963 gl_error( ctx, GL_INVALID_OPERATION, where ); \ 1964 return; \ 1965 } \ 2154 1966 } while (0) 2155 1967 2156 1968 2157 1969 #define ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH_WITH_RETVAL( ctx, where, what ) \ 2158 do { \2159 FLUSH_VB( ctx, where );\2160 if (ctx->Current.Primitive != GL_POLYGON+1) {\2161 gl_error( ctx, GL_INVALID_OPERATION, where );\2162 return what;\2163 }\1970 do { \ 1971 FLUSH_VB( ctx, where ); \ 1972 if (ctx->Current.Primitive != GL_POLYGON+1) { \ 1973 gl_error( ctx, GL_INVALID_OPERATION, where ); \ 1974 return what; \ 1975 } \ 2164 1976 } while (0) 2165 1977 -
trunk/src/opengl/mesa/varray.h
r2938 r3597 1 /* $Id: varray.h,v 1. 1 2000-02-29 00:48:42 sandervlExp $ */1 /* $Id: varray.h,v 1.2 2000-05-23 20:34:59 jeroen Exp $ */ 2 2 3 3 /* … … 33 33 34 34 35 extern void gl_VertexPointer( GLcontext *ctx,36 GLint size, GLenum type, GLsizei stride,37 const GLvoid *ptr);35 extern void 36 _mesa_VertexPointer(GLint size, GLenum type, GLsizei stride, 37 const GLvoid *ptr); 38 38 39 39 40 extern void gl_NormalPointer( GLcontext *ctx,41 GLenum type, GLsizei stride, const GLvoid *ptr);40 extern void 41 _mesa_NormalPointer(GLenum type, GLsizei stride, const GLvoid *ptr); 42 42 43 43 44 extern void gl_ColorPointer( GLcontext *ctx, 45 GLint size, GLenum type, GLsizei stride, 46 const GLvoid *ptr ); 44 extern void 45 _mesa_ColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr); 47 46 48 47 49 extern void gl_IndexPointer( GLcontext *ctx, 50 GLenum type, GLsizei stride, 51 const GLvoid *ptr ); 48 extern void 49 _mesa_IndexPointer(GLenum type, GLsizei stride, const GLvoid *ptr); 52 50 53 51 54 extern void gl_TexCoordPointer( GLcontext *ctx,55 GLint size, GLenum type, GLsizei stride,56 const GLvoid *ptr);52 extern void 53 _mesa_TexCoordPointer(GLint size, GLenum type, GLsizei stride, 54 const GLvoid *ptr); 57 55 58 56 59 extern void gl_EdgeFlagPointer( GLcontext *ctx,60 GLsizei stride, const GLboolean *ptr);57 extern void 58 _mesa_EdgeFlagPointer(GLsizei stride, const GLvoid *ptr); 61 59 62 60 63 extern void gl_GetPointerv( GLcontext *ctx, GLenum pname, GLvoid **params ); 61 extern void 62 _mesa_ArrayElement( GLint ); 64 63 65 64 66 67 extern void gl_DrawArrays( GLcontext *ctx, 68 GLenum mode, GLint first, GLsizei count ); 69 70 extern void gl_save_DrawArrays( GLcontext *ctx, 71 GLenum mode, GLint first, GLsizei count ); 65 extern void 66 _mesa_DrawArrays(GLenum mode, GLint first, GLsizei count); 72 67 73 68 74 extern void gl_DrawElements( GLcontext *ctx, 75 GLenum mode, GLsizei count, 76 GLenum type, const GLvoid *indices ); 77 78 extern void gl_save_DrawElements( GLcontext *ctx, 79 GLenum mode, GLsizei count, 80 GLenum type, const GLvoid *indices ); 69 extern void 70 _mesa_save_DrawArrays(GLenum mode, GLint first, GLsizei count); 81 71 82 72 83 extern void gl_InterleavedArrays( GLcontext *ctx, 84 GLenum format, GLsizei stride, 85 const GLvoid *pointer ); 86 87 extern void gl_save_InterleavedArrays( GLcontext *ctx, 88 GLenum format, GLsizei stride, 89 const GLvoid *pointer ); 73 extern void 74 _mesa_DrawElements(GLenum mode, GLsizei count, GLenum type, 75 const GLvoid *indices); 90 76 91 77 92 extern void gl_DrawRangeElements( GLcontext *ctx, GLenum mode, GLuint start,93 GLuint end, GLsizei count, GLenum type,94 const GLvoid *indices);78 extern void 79 _mesa_save_DrawElements(GLenum mode, GLsizei count, 80 GLenum type, const GLvoid *indices); 95 81 96 extern void gl_save_DrawRangeElements( GLcontext *ctx, GLenum mode, 97 GLuint start, GLuint end, GLsizei count, 98 GLenum type, const GLvoid *indices ); 82 83 extern void 84 _mesa_InterleavedArrays(GLenum format, GLsizei stride, const GLvoid *pointer); 85 86 extern void 87 _mesa_save_InterleavedArrays(GLenum format, GLsizei stride, 88 const GLvoid *pointer); 89 90 91 extern void 92 _mesa_DrawRangeElements(GLenum mode, GLuint start, 93 GLuint end, GLsizei count, GLenum type, 94 const GLvoid *indices); 95 96 extern void 97 _mesa_save_DrawRangeElements(GLenum mode, 98 GLuint start, GLuint end, GLsizei count, 99 GLenum type, const GLvoid *indices ); 99 100 100 101 101 102 extern void gl_exec_array_elements( GLcontext *ctx, 102 struct immediate *IM,103 GLuint start,104 GLuint end );103 struct immediate *IM, 104 GLuint start, 105 GLuint end ); 105 106 106 107 extern void gl_update_client_state( GLcontext *ctx ); -
trunk/src/opengl/mesa/vb.h
r2938 r3597 1 /* $Id: vb.h,v 1. 1 2000-02-29 00:48:42 sandervlExp $ */1 /* $Id: vb.h,v 1.2 2000-05-23 20:34:59 jeroen Exp $ */ 2 2 3 3 /* 4 4 * Mesa 3-D graphics library 5 * Version: 3. 15 * Version: 3.3 6 6 * 7 7 * Copyright (C) 1999 Brian Paul All Rights Reserved. … … 54 54 #endif 55 55 56 #include "gl.h"57 56 #include "vector.h" 58 57 #include "matrix.h" … … 114 113 GLfloat Emission[4]; 115 114 GLfloat Shininess; 116 GLfloat AmbientIndex; /* for color index lighting */117 GLfloat DiffuseIndex; /* for color index lighting */118 GLfloat SpecularIndex; /* for color index lighting */115 GLfloat AmbientIndex; /* for color index lighting */ 116 GLfloat DiffuseIndex; /* for color index lighting */ 117 GLfloat SpecularIndex; /* for color index lighting */ 119 118 }; 120 119 … … 131 130 struct immediate 132 131 { 133 struct immediate *next; /* for cache of free IM's */132 struct immediate *next; /* for cache of free IM's */ 134 133 GLuint id, ref_count; 135 134 … … 137 136 */ 138 137 GLuint Start, Count; 139 GLuint LastData; /* count or count+1 */138 GLuint LastData; /* count or count+1 */ 140 139 GLuint AndFlag, OrFlag, BeginState; 141 GLuint LastPrimitive; 142 143 GLuint ArrayAndFlags; /* precalc'ed for glArrayElt */140 GLuint LastPrimitive; 141 142 GLuint ArrayAndFlags; /* precalc'ed for glArrayElt */ 144 143 GLuint ArrayIncr; 145 144 GLuint ArrayEltFlush; 146 145 GLuint FlushElt; 147 146 148 GLuint TF1[2]; /* precalc'ed for glTexCoord */147 GLuint TF1[2]; /* precalc'ed for glTexCoord */ 149 148 GLuint TF2[2]; 150 149 GLuint TF3[2]; 151 150 GLuint TF4[2]; 152 151 153 GLuint Primitive[VB_SIZE]; /* GLubyte would do... */152 GLuint Primitive[VB_SIZE]; /* GLubyte would do... */ 154 153 GLuint NextPrimitive[VB_SIZE]; 155 154 … … 163 162 struct vertex_arrays v; 164 163 165 struct gl_context *backref; 164 struct gl_context *backref; 166 165 void (*maybe_transform_vb)( struct immediate * ); 167 166 … … 206 205 * case the values will be scribbled during transform_vb. 207 206 */ 208 struct immediate *IM; 209 struct vertex_array_pointers store; 207 struct immediate *IM; 208 struct vertex_array_pointers store; 210 209 211 210 /* Where to find outstanding untransformed vertices. … … 220 219 GLuint Parity, Ovf; 221 220 GLuint PurgeFlags; 222 GLuint IndirectCount; /* defaults to count */221 GLuint IndirectCount; /* defaults to count */ 223 222 GLuint OrFlag, SavedOrFlag; 224 223 GLuint EarlyCull; … … 242 241 GLuint LastPrimitive; 243 242 244 GLfloat (*BoundsPtr)[3]; /* Bounds for cull check */245 GLfloat *NormalLengthPtr; /* Array of precomputed inv. normal lengths */243 GLfloat (*BoundsPtr)[3]; /* Bounds for cull check */ 244 GLfloat *NormalLengthPtr; /* Array of precomputed inv. normal lengths */ 246 245 247 246 … … 252 251 GLvector4f Clip; 253 252 GLvector4f Win; 254 GLvector4ub BColor; /* not used in cva */255 GLvector1ui BIndex; /* not used in cva */253 GLvector4ub BColor; /* not used in cva */ 254 GLvector1ui BIndex; /* not used in cva */ 256 255 GLubyte (*Specular)[4]; 257 256 GLubyte (*Spec[2])[4]; … … 301 300 */ 302 301 GLubyte *NormCullStart; 303 GLubyte *CullMask; /* Results of vertex culling */302 GLubyte *CullMask; /* Results of vertex culling */ 304 303 GLubyte *NormCullMask; /* Compressed onto shared normals */ 305 304 306 305 307 GLubyte ClipOrMask; /* bitwise-OR of all ClipMask[] values */308 GLubyte ClipAndMask; /* bitwise-AND of all ClipMask[] values */306 GLubyte ClipOrMask; /* bitwise-OR of all ClipMask[] values */ 307 GLubyte ClipAndMask; /* bitwise-AND of all ClipMask[] values */ 309 308 GLubyte CullFlag[2]; 310 GLubyte CullMode; /* see flags below */311 312 GLuint CopyCount; /* max 3 vertices to copy after transform */309 GLubyte CullMode; /* see flags below */ 310 311 GLuint CopyCount; /* max 3 vertices to copy after transform */ 313 312 GLuint Copy[3]; 314 GLfloat CopyProj[3][4]; /* temporary store for projected clip coords */313 GLfloat CopyProj[3][4]; /* temporary store for projected clip coords */ 315 314 }; 316 315 … … 322 321 extern struct vertex_buffer *gl_vb_create_for_immediate( GLcontext *ctx ); 323 322 extern struct vertex_buffer *gl_vb_create_for_cva( GLcontext *ctx, 324 GLuint size );323 GLuint size ); 325 324 extern void gl_vb_free( struct vertex_buffer * ); 326 325 extern struct immediate *gl_immediate_alloc( GLcontext *ctx ); -
trunk/src/opengl/mesa/vbfill.h
r2938 r3597 1 /* $Id: vbfill.h,v 1. 1 2000-02-29 00:48:42 sandervlExp $ */1 /* $Id: vbfill.h,v 1.2 2000-05-23 20:34:59 jeroen Exp $ */ 2 2 3 3 /* 4 4 * Mesa 3-D graphics library 5 * Version: 3. 15 * Version: 3.3 6 6 * 7 7 * Copyright (C) 1999 Brian Paul All Rights Reserved. … … 36 36 37 37 38 /* Small number of API equivalent functions provided for internal39 * use:40 */41 38 extern void gl_Begin( GLcontext *ctx, GLenum p ); 42 extern void gl_Vertex2f( GLcontext *ctx, GLfloat, GLfloat );43 extern void gl_ArrayElement( GLcontext *ctx, GLint );44 extern void gl_EvalCoord1f( GLcontext *ctx, GLfloat );45 extern void gl_EvalCoord2f( GLcontext *ctx, GLfloat, GLfloat );46 39 extern void gl_End( GLcontext *ctx ); 40 extern void gl_Vertex2f( GLcontext *ctx, GLfloat x, GLfloat y); 41 42 43 extern void 44 _mesa_Begin( GLenum p ); 45 46 extern void 47 _mesa_End( void ); 48 49 50 51 extern void _mesa_Color3b(GLbyte red, GLbyte green, GLbyte blue); 52 53 extern void _mesa_Color3d(GLdouble red, GLdouble green, GLdouble blue); 54 55 extern void _mesa_Color3f(GLfloat red, GLfloat green, GLfloat blue); 56 57 extern void _mesa_Color3i(GLint red, GLint green, GLint blue); 58 59 extern void _mesa_Color3s(GLshort red, GLshort green, GLshort blue); 60 61 extern void _mesa_Color3ub(GLubyte red, GLubyte green, GLubyte blue); 62 63 extern void _mesa_Color3ui(GLuint red, GLuint green, GLuint blue); 64 65 extern void _mesa_Color3us(GLushort red, GLushort green, GLushort blue); 66 67 extern void _mesa_Color4b(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha); 68 69 extern void _mesa_Color4d(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha); 70 71 extern void _mesa_Color4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); 72 73 extern void _mesa_Color4i(GLint red, GLint green, GLint blue, GLint alpha); 74 75 extern void _mesa_Color4s(GLshort red, GLshort green, GLshort blue, GLshort alpha); 76 77 extern void _mesa_Color4ub(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha); 78 79 extern void _mesa_Color4ui(GLuint red, GLuint green, GLuint blue, GLuint alpha); 80 81 extern void _mesa_Color4us(GLushort red, GLushort green, GLushort blue, GLushort alpha); 82 83 extern void _mesa_Color3bv(const GLbyte *v); 84 85 extern void _mesa_Color3dv(const GLdouble *v); 86 87 extern void _mesa_Color3fv(const GLfloat *v); 88 89 extern void _mesa_Color3iv(const GLint *v); 90 91 extern void _mesa_Color3sv(const GLshort *v); 92 93 extern void _mesa_Color3ubv(const GLubyte *v); 94 95 extern void _mesa_Color3uiv(const GLuint *v); 96 97 extern void _mesa_Color3usv(const GLushort *v); 98 99 extern void _mesa_Color4bv(const GLbyte *v); 100 101 extern void _mesa_Color4dv(const GLdouble *v); 102 103 extern void _mesa_Color4fv(const GLfloat *v); 104 105 extern void _mesa_Color4iv(const GLint *v); 106 107 extern void _mesa_Color4sv(const GLshort *v); 108 109 extern void _mesa_Color4ubv(const GLubyte *v); 110 111 extern void _mesa_Color4uiv(const GLuint *v); 112 113 extern void _mesa_Color4usv(const GLushort *v); 114 115 116 117 extern void _mesa_EdgeFlag( GLboolean flag ); 118 119 extern void _mesa_EdgeFlagv( const GLboolean *flag ); 120 121 122 123 extern void _mesa_Indexd(GLdouble c); 124 125 extern void _mesa_Indexdv(const GLdouble *c); 126 127 extern void _mesa_Indexf(GLfloat c); 128 129 extern void _mesa_Indexfv(const GLfloat *c); 130 131 extern void _mesa_Indexi(GLint c); 132 133 extern void _mesa_Indexiv(const GLint *c); 134 135 extern void _mesa_Indexs(GLshort c); 136 137 extern void _mesa_Indexsv(const GLshort *c); 138 139 extern void _mesa_Indexub(GLubyte b); 140 141 extern void _mesa_Indexubv(const GLubyte *b); 142 143 144 145 extern void _mesa_Normal3b(GLbyte nx, GLbyte ny, GLbyte nz); 146 147 extern void _mesa_Normal3bv(const GLbyte *v); 148 149 extern void _mesa_Normal3d(GLdouble nx, GLdouble ny, GLdouble nz); 150 151 extern void _mesa_Normal3dv(const GLdouble *v); 152 153 extern void _mesa_Normal3f(GLfloat nx, GLfloat ny, GLfloat nz); 154 155 extern void _mesa_Normal3fv(const GLfloat *v); 156 157 extern void _mesa_Normal3i(GLint nx, GLint ny, GLint nz); 158 159 extern void _mesa_Normal3iv(const GLint *v); 160 161 extern void _mesa_Normal3s(GLshort nx, GLshort ny, GLshort nz); 162 163 extern void _mesa_Normal3sv(const GLshort *v); 164 165 166 167 extern void _mesa_TexCoord1d(GLdouble s); 168 169 extern void _mesa_TexCoord1dv(const GLdouble *v); 170 171 extern void _mesa_TexCoord1f(GLfloat s); 172 173 extern void _mesa_TexCoord1fv(const GLfloat *v); 174 175 extern void _mesa_TexCoord1i(GLint s); 176 177 extern void _mesa_TexCoord1iv(const GLint *v); 178 179 extern void _mesa_TexCoord1s(GLshort s); 180 181 extern void _mesa_TexCoord1sv(const GLshort *v); 182 183 extern void _mesa_TexCoord2d(GLdouble s, GLdouble t); 184 185 extern void _mesa_TexCoord2dv(const GLdouble *v); 186 187 extern void _mesa_TexCoord2f(GLfloat s, GLfloat t); 188 189 extern void _mesa_TexCoord2fv(const GLfloat *v); 190 191 extern void _mesa_TexCoord2s(GLshort s, GLshort t); 192 193 extern void _mesa_TexCoord2sv(const GLshort *v); 194 195 extern void _mesa_TexCoord2i(GLint s, GLint t); 196 197 extern void _mesa_TexCoord2iv(const GLint *v); 198 199 extern void _mesa_TexCoord3d(GLdouble s, GLdouble t, GLdouble r); 200 201 extern void _mesa_TexCoord3dv(const GLdouble *v); 202 203 extern void _mesa_TexCoord3f(GLfloat s, GLfloat t, GLfloat r); 204 205 extern void _mesa_TexCoord3fv(const GLfloat *v); 206 207 extern void _mesa_TexCoord3i(GLint s, GLint t, GLint r); 208 209 extern void _mesa_TexCoord3iv(const GLint *v); 210 211 extern void _mesa_TexCoord3s(GLshort s, GLshort t, GLshort r); 212 213 extern void _mesa_TexCoord3sv(const GLshort *v); 214 215 extern void _mesa_TexCoord4d(GLdouble s, GLdouble t, GLdouble r, GLdouble q); 216 217 extern void _mesa_TexCoord4dv(const GLdouble *v); 218 219 extern void _mesa_TexCoord4f(GLfloat s, GLfloat t, GLfloat r, GLfloat q); 220 221 extern void _mesa_TexCoord4fv(const GLfloat *v); 222 223 extern void _mesa_TexCoord4i(GLint s, GLint t, GLint r, GLint q); 224 225 extern void _mesa_TexCoord4iv(const GLint *v); 226 227 extern void _mesa_TexCoord4s(GLshort s, GLshort t, GLshort r, GLshort q); 228 229 extern void _mesa_TexCoord4sv(const GLshort *v); 230 231 232 233 extern void _mesa_Vertex2d(GLdouble x, GLdouble y); 234 235 extern void _mesa_Vertex2dv(const GLdouble *v); 236 237 extern void _mesa_Vertex2f(GLfloat x, GLfloat y); 238 239 extern void _mesa_Vertex2fv(const GLfloat *v); 240 241 extern void _mesa_Vertex2i(GLint x, GLint y); 242 243 extern void _mesa_Vertex2iv(const GLint *v); 244 245 extern void _mesa_Vertex2s(GLshort x, GLshort y); 246 247 extern void _mesa_Vertex2sv(const GLshort *v); 248 249 extern void _mesa_Vertex3d(GLdouble x, GLdouble y, GLdouble z); 250 251 extern void _mesa_Vertex3dv(const GLdouble *v); 252 253 extern void _mesa_Vertex3f(GLfloat x, GLfloat y, GLfloat z); 254 255 extern void _mesa_Vertex3fv(const GLfloat *v); 256 257 extern void _mesa_Vertex3i(GLint x, GLint y, GLint z); 258 259 extern void _mesa_Vertex3iv(const GLint *v); 260 261 extern void _mesa_Vertex3s(GLshort x, GLshort y, GLshort z); 262 263 extern void _mesa_Vertex3sv(const GLshort *v); 264 265 extern void _mesa_Vertex4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w); 266 267 extern void _mesa_Vertex4dv(const GLdouble *v); 268 269 extern void _mesa_Vertex4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w); 270 271 extern void _mesa_Vertex4fv(const GLfloat *v); 272 273 extern void _mesa_Vertex4i(GLint x, GLint y, GLint z, GLint w); 274 275 extern void _mesa_Vertex4iv(const GLint *v); 276 277 extern void _mesa_Vertex4s(GLshort x, GLshort y, GLshort z, GLshort w); 278 279 extern void _mesa_Vertex4sv(const GLshort *v); 280 281 282 283 extern void _mesa_MultiTexCoord1dARB(GLenum target, GLdouble s); 284 285 extern void _mesa_MultiTexCoord1dvARB(GLenum target, const GLdouble *v); 286 287 extern void _mesa_MultiTexCoord1fARB(GLenum target, GLfloat s); 288 289 extern void _mesa_MultiTexCoord1fvARB(GLenum target, const GLfloat *v); 290 291 extern void _mesa_MultiTexCoord1iARB(GLenum target, GLint s); 292 293 extern void _mesa_MultiTexCoord1ivARB(GLenum target, const GLint *v); 294 295 extern void _mesa_MultiTexCoord1sARB(GLenum target, GLshort s); 296 297 extern void _mesa_MultiTexCoord1svARB(GLenum target, const GLshort *v); 298 299 extern void _mesa_MultiTexCoord2dARB(GLenum target, GLdouble s, GLdouble t); 300 301 extern void _mesa_MultiTexCoord2dvARB(GLenum target, const GLdouble *v); 302 303 extern void _mesa_MultiTexCoord2fARB(GLenum target, GLfloat s, GLfloat t); 304 305 extern void _mesa_MultiTexCoord2fvARB(GLenum target, const GLfloat *v); 306 307 extern void _mesa_MultiTexCoord2iARB(GLenum target, GLint s, GLint t); 308 309 extern void _mesa_MultiTexCoord2ivARB(GLenum target, const GLint *v); 310 311 extern void _mesa_MultiTexCoord2sARB(GLenum target, GLshort s, GLshort t); 312 313 extern void _mesa_MultiTexCoord2svARB(GLenum target, const GLshort *v); 314 315 extern void _mesa_MultiTexCoord3dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r); 316 317 extern void _mesa_MultiTexCoord3dvARB(GLenum target, const GLdouble *v); 318 319 extern void _mesa_MultiTexCoord3fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r); 320 321 extern void _mesa_MultiTexCoord3fvARB(GLenum target, const GLfloat *v); 322 323 extern void _mesa_MultiTexCoord3iARB(GLenum target, GLint s, GLint t, GLint r); 324 325 extern void _mesa_MultiTexCoord3ivARB(GLenum target, const GLint *v); 326 327 extern void _mesa_MultiTexCoord3sARB(GLenum target, GLshort s, GLshort t, GLshort r); 328 329 extern void _mesa_MultiTexCoord3svARB(GLenum target, const GLshort *v); 330 331 extern void _mesa_MultiTexCoord4dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); 332 333 extern void _mesa_MultiTexCoord4dvARB(GLenum target, const GLdouble *v); 334 335 extern void _mesa_MultiTexCoord4fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); 336 337 extern void _mesa_MultiTexCoord4fvARB(GLenum target, const GLfloat *v); 338 339 extern void _mesa_MultiTexCoord4iARB(GLenum target, GLint s, GLint t, GLint r, GLint q); 340 341 extern void _mesa_MultiTexCoord4ivARB(GLenum target, const GLint *v); 342 343 extern void _mesa_MultiTexCoord4sARB(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); 344 345 extern void _mesa_MultiTexCoord4svARB(GLenum target, const GLshort *v); 346 47 347 48 348 -
trunk/src/opengl/mesa/vector.h
r2938 r3597 1 /* $Id: vector.h,v 1. 1 2000-02-29 00:48:43 sandervlExp $ */1 /* $Id: vector.h,v 1.2 2000-05-23 20:35:00 jeroen Exp $ */ 2 2 3 3 /* 4 4 * Mesa 3-D graphics library 5 * Version: 3. 15 * Version: 3.3 6 6 * 7 7 * Copyright (C) 1999 Brian Paul All Rights Reserved. … … 33 33 #define _VECTOR_H_ 34 34 35 #include "gl.h"36 37 35 /* Wrap all the information about vertices up in a struct. Has 38 36 * additional fields compared to the other vectors to help us track of … … 48 46 GLfloat *start; 49 47 GLuint count; 50 GLuint stride; /* start to start */51 GLuint size; /* 2-4 for vertices and 1-4 for texcoords */52 GLuint flags; /* which columns are dirty */48 GLuint stride; /* start to start */ 49 GLuint size; /* 2-4 for vertices and 1-4 for texcoords */ 50 GLuint flags; /* which columns are dirty */ 53 51 void *storage; 54 52 } GLvector4f; … … 57 55 extern void gl_vector4f_print( GLvector4f *v, GLubyte *, GLboolean ); 58 56 extern void gl_vector4f_init( GLvector4f *v, GLuint flags, 59 GLfloat (*storage)[4] );57 GLfloat (*storage)[4] ); 60 58 extern void gl_vector4f_alloc( GLvector4f *v, GLuint sz, GLuint flags, 61 GLuint count, GLuint alignment );59 GLuint count, GLuint alignment ); 62 60 extern void gl_vector4f_free( GLvector4f *v ); 63 61 extern void gl_vector4f_clean_elem( GLvector4f *vec, GLuint nr, GLuint elt ); 64 62 65 63 66 #define VEC_DIRTY_0 0x1 /* dirty flags not really used any more */64 #define VEC_DIRTY_0 0x1 /* dirty flags not really used any more */ 67 65 #define VEC_DIRTY_1 0x2 68 66 #define VEC_DIRTY_2 0x4 69 67 #define VEC_DIRTY_3 0x8 70 68 #define VEC_MALLOC 0x10 71 #define VEC_WRITABLE 0x20 /* keep both + and - bits for easy testing */69 #define VEC_WRITABLE 0x20 /* keep both + and - bits for easy testing */ 72 70 #define VEC_NOT_WRITABLE 0x40 73 #define VEC_GOOD_STRIDE 0x80 71 #define VEC_GOOD_STRIDE 0x80 74 72 #define VEC_BAD_STRIDE 0x100 75 73 … … 100 98 extern void gl_vector3f_init( GLvector3f *v, GLuint flags, GLfloat (*)[3] ); 101 99 extern void gl_vector3f_alloc( GLvector3f *v, GLuint flags, GLuint count, 102 GLuint alignment );100 GLuint alignment ); 103 101 104 102 … … 109 107 GLubyte *start; 110 108 GLuint count; 111 GLuint stride; 109 GLuint stride; 112 110 GLuint flags; 113 111 void *storage; … … 115 113 116 114 extern void gl_vector4ub_init( GLvector4ub *v, GLuint flags, 117 GLubyte (*storage)[4] );115 GLubyte (*storage)[4] ); 118 116 extern void gl_vector4ub_free( GLvector4ub * ); 119 117 extern void gl_vector4ub_alloc( GLvector4ub *v, GLuint flags, GLuint count, 120 GLuint alignment );118 GLuint alignment ); 121 119 122 120 … … 129 127 GLubyte *start; 130 128 GLuint count; 131 GLuint stride; 129 GLuint stride; 132 130 GLuint flags; 133 131 void *storage; … … 137 135 extern void gl_vector1ub_free( GLvector1ub * ); 138 136 extern void gl_vector1ub_alloc( GLvector1ub *v, GLuint flags, GLuint count, 139 GLuint alignment );137 GLuint alignment ); 140 138 141 139 … … 156 154 extern void gl_vector1ui_free( GLvector1ui * ); 157 155 extern void gl_vector1ui_alloc( GLvector1ui *v, GLuint flags, GLuint count, 158 GLuint alignment );156 GLuint alignment ); 159 157 160 158 -
trunk/src/opengl/mesa/vertices.h
r2962 r3597 1 /* $Id: vertices.h,v 1. 2 2000-03-01 18:49:39jeroen Exp $ */1 /* $Id: vertices.h,v 1.3 2000-05-23 20:35:00 jeroen Exp $ */ 2 2 3 3 /* 4 4 * Mesa 3-D graphics library 5 * Version: 3. 15 * Version: 3.3 6 6 * 7 7 * Copyright (C) 1999 Brian Paul All Rights Reserved. … … 29 29 #define VERTICES_H_ 30 30 31 #ifdef USE_X86_ASM 32 #define _PROJAPI _ASMAPI 33 #define _PROJAPIP _ASMAPIP 34 #else 35 #define _PROJAPI 36 #define _PROJAPIP * 37 #endif 31 38 32 typedef void ( * __cdeclgl_transform_func)( GLfloat *first_vert,39 typedef void (_PROJAPIP gl_transform_func)( GLfloat *first_vert, 33 40 const GLfloat *m, 34 41 const GLfloat *src, … … 36 43 GLuint count ); 37 44 38 typedef void ( * __cdeclgl_cliptest_func)( GLfloat *first_vert,39 GLfloat *last_vert, /* use count instead? */45 typedef void (_PROJAPIP gl_cliptest_func)( GLfloat *first_vert, 46 GLfloat *last_vert, /* use count instead?*/ 40 47 GLubyte *or_mask, 41 48 GLubyte *and_mask, 42 49 GLubyte *clip_mask ); 43 50 44 typedef void ( *gl_project_clipped_func)( GLfloat *first,45 GLfloat *last,46 const GLfloat *m,47 GLuint stride,48 const GLubyte *clipmask );51 typedef void (_PROJAPIP gl_project_clipped_func)( GLfloat *first, 52 GLfloat *last, 53 const GLfloat *m, 54 GLuint stride, 55 const GLubyte *clipmask ); 49 56 50 typedef void ( *gl_project_func)( GLfloat *first,51 GLfloat *last,52 const GLfloat *m,53 GLuint stride );57 typedef void (_PROJAPIP gl_project_func)( GLfloat *first, 58 GLfloat *last, 59 const GLfloat *m, 60 GLuint stride ); 54 61 55 62 … … 57 64 */ 58 65 extern gl_transform_func gl_xform_points3_v16_general; 59 extern gl_cliptest_func gl_cliptest_points4_v16; 60 extern gl_project_clipped_func gl_project_clipped_v16; 61 extern gl_project_func gl_project_v16; 66 extern gl_cliptest_func gl_cliptest_points4_v16; 67 extern gl_project_clipped_func gl_project_clipped_v16; 68 extern gl_project_func gl_project_v16; 62 69 63 70 … … 67 74 68 75 typedef void (*gl_vertex_interp_func)( GLfloat t, 69 GLfloat *result,70 const GLfloat *in,71 const GLfloat *out );72 76 GLfloat *result, 77 const GLfloat *in, 78 const GLfloat *out ); 79 73 80 74 81 #endif -
trunk/src/opengl/mesa/winpos.h
r2938 r3597 1 /* $Id: winpos.h,v 1. 1 2000-02-29 00:48:44 sandervlExp $ */1 /* $Id: winpos.h,v 1.2 2000-05-23 20:35:00 jeroen Exp $ */ 2 2 3 3 /* 4 4 * Mesa 3-D graphics library 5 * Version: 3. 15 * Version: 3.3 6 6 * 7 7 * Copyright (C) 1999 Brian Paul All Rights Reserved. … … 37 37 38 38 39 #ifndef GL_MESA_window_pos 39 extern void 40 _mesa_WindowPos2dMESA(GLdouble x, GLdouble y); 40 41 41 extern void glWindowPos2iMESA( GLint x, GLint y ); 42 extern void glWindowPos2fMESA( GLfloat x, GLfloat y ); 43 extern void glWindowPos2dMESA( GLdouble x, GLdouble y ); 42 extern void 43 _mesa_WindowPos2fMESA(GLfloat x, GLfloat y); 44 44 45 extern void glWindowPos2ivMESA( const GLint *p ); 46 extern void glWindowPos2fvMESA( const GLfloat *p ); 47 extern void glWindowPos2dvMESA( const GLdouble *p ); 45 extern void 46 _mesa_WindowPos2iMESA(GLint x, GLint y); 48 47 49 extern void glWindowPos3iMESA( GLint x, GLint y, GLint z ); 50 extern void glWindowPos3fMESA( GLfloat x, GLfloat y, GLfloat z ); 51 extern void glWindowPos3dMESA( GLdouble x, GLdouble y, GLdouble z ); 48 extern void 49 _mesa_WindowPos2sMESA(GLshort x, GLshort y); 52 50 53 extern void glWindowPos3ivMESA( const GLint *p ); 54 extern void glWindowPos3fvMESA( const GLfloat *p ); 55 extern void glWindowPos3dvMESA( const GLdouble *p ); 51 extern void 52 _mesa_WindowPos3dMESA(GLdouble x, GLdouble y, GLdouble z); 56 53 57 extern void glWindowPos4iMESA( GLint x, GLint y, GLint z, GLint w ); 58 extern void glWindowPos4fMESA( GLfloat x, GLfloat y, GLfloat z, GLfloat w ); 59 extern void glWindowPos4dMESA( GLdouble x, GLdouble y, GLdouble z, GLdouble w); 54 extern void 55 _mesa_WindowPos3fMESA(GLfloat x, GLfloat y, GLfloat z); 60 56 61 extern void glWindowPos4ivMESA( const GLint *p ); 62 extern void glWindowPos4fvMESA( const GLfloat *p ); 63 extern void glWindowPos4dvMESA( const GLdouble *p ); 57 extern void 58 _mesa_WindowPos3iMESA(GLint x, GLint y, GLint z); 59 60 extern void 61 _mesa_WindowPos3sMESA(GLshort x, GLshort y, GLshort z); 62 63 extern void 64 _mesa_WindowPos4dMESA(GLdouble x, GLdouble y, GLdouble z, GLdouble w); 65 66 extern void 67 _mesa_WindowPos4fMESA(GLfloat x, GLfloat y, GLfloat z, GLfloat w); 68 69 extern void 70 _mesa_WindowPos4iMESA(GLint x, GLint y, GLint z, GLint w); 71 72 extern void 73 _mesa_WindowPos4sMESA(GLshort x, GLshort y, GLshort z, GLshort w); 74 75 extern void 76 _mesa_WindowPos2dvMESA(const GLdouble *v); 77 78 extern void 79 _mesa_WindowPos2fvMESA(const GLfloat *v); 80 81 extern void 82 _mesa_WindowPos2ivMESA(const GLint *v); 83 84 extern void 85 _mesa_WindowPos2svMESA(const GLshort *v); 86 87 extern void 88 _mesa_WindowPos3dvMESA(const GLdouble *v); 89 90 extern void 91 _mesa_WindowPos3fvMESA(const GLfloat *v); 92 93 extern void 94 _mesa_WindowPos3ivMESA(const GLint *v); 95 96 extern void 97 _mesa_WindowPos3svMESA(const GLshort *v); 98 99 extern void 100 _mesa_WindowPos4dvMESA(const GLdouble *v); 101 102 extern void 103 _mesa_WindowPos4fvMESA(const GLfloat *v); 104 105 extern void 106 _mesa_WindowPos4ivMESA(const GLint *v); 107 108 extern void 109 _mesa_WindowPos4svMESA(const GLshort *v); 110 64 111 65 112 #endif 66 67 68 extern void gl_WindowPos4fMESA( GLcontext *ctx,69 GLfloat x, GLfloat y, GLfloat z, GLfloat w );70 71 #endif -
trunk/src/opengl/mesa/wmesadef.h
r2962 r3597 1 /* $Id: wmesadef.h,v 1. 2 2000-03-01 18:49:40 jeroen Exp $ */1 /* $Id: wmesadef.h,v 1.3 2000-05-23 20:35:00 jeroen Exp $ */ 2 2 /* File name : wmesadef.h 3 3 * Version : 2.3 … … 20 20 /* 21 21 * $Log: wmesadef.h,v $ 22 * Revision 1.2 2000-03-01 18:49:40 jeroen 22 * Revision 1.3 2000-05-23 20:35:00 jeroen 23 * *** empty log message *** 24 * 25 * Revision 1.2 2000/03/01 18:49:40 jeroen 23 26 * *** empty log message *** 24 27 * … … 37 40 /* 38 41 * $Log: wmesadef.h,v $ 39 * Revision 1.2 2000-03-01 18:49:40 jeroen 42 * Revision 1.3 2000-05-23 20:35:00 jeroen 43 * *** empty log message *** 44 * 45 * Revision 1.2 2000/03/01 18:49:40 jeroen 40 46 * *** empty log message *** 41 47 * … … 56 62 /* 57 63 * $Log: wmesadef.h,v $ 58 * Revision 1.2 2000-03-01 18:49:40 jeroen 64 * Revision 1.3 2000-05-23 20:35:00 jeroen 65 * *** empty log message *** 66 * 67 * Revision 1.2 2000/03/01 18:49:40 jeroen 59 68 * *** empty log message *** 60 69 * … … 77 86 #define DDMESADEF_H 78 87 79 #ifdef __WIN32OS2__/* Nope, we use this hdr in DIVE code, so instead include*/80 /* os2win.h in the source if it is needed! */81 //#include <os2win.h>82 #else83 #include <windows.h>84 #endif85 86 88 #if defined(DDRAW) 87 #include <ddraw.h> 88 #endif 89 90 //#include "gl.h" 91 //#include "context.h" 92 //#include "profile.h" 89 #ifdef __WIN32OS2__ 90 #define __WINE_DD_OBJ_BASE_H/* Don't include dd_obj_base.h, or the file won't*/ 91 #endif /* compile due to redefined symbols.*/ 92 #include <ddraw.h> /* Is this a bug in the Odin DDRAW implementation??*/ 93 #endif 93 94 94 95 #define REDBITS 0x03 … … 99 100 #define BLUESHIFT 0x06 100 101 102 typedef HANDLE ULONG; 103 101 104 typedef struct _dibSection{ 102 HDC hDC;105 HDC hDC; 103 106 HANDLE hFileMap; 104 107 BOOL fFlushed; … … 120 123 ULONG hDiveInstance; /* This actually is a DIVE Handle */ 121 124 ULONG BackBufferNumber; 122 PVOID ppFrameBuffer; 125 PVOID ppFrameBuffer; /* FrameBuffer address - used for DIRECT access to screen only */ 123 126 ULONG ScanLineBytes,ScanLines; 124 127 POINT WinPos; … … 130 133 HDC hps; 131 134 BOOL BackBufferOwnAllocation; 132 GLint awidth,aheight; /* Allocated w/h for ImageBuffer*/135 GLint awidth,aheight;/* Allocated w/h for ImageBuffer */ 133 136 #endif 134 137 PBYTE pbPixels; … … 149 152 GLvisual *gl_visual; /* Describes the buffers*/ 150 153 GLframebuffer *gl_buffer; /* Depth, stencil, accum, etc buffers*/ 154 155 /* 3D projection stuff */ 151 156 RECT drawRect; 152 157 UINT uiDIBoffset; 153 PBYTE ScreenMem; /* WinG memory */ 154 HPALETTE hPal; /* Current Palette */ 155 HPALETTE hPalHalfTone; 158 /* OpenGL stuff */ 156 159 HPALETTE hGLPalette; 157 WMDIBSECTION dib; 158 BITMAPINFO *IndexFormat; 160 PBYTE ScreenMem; /* WinG memory */ 161 BITMAPINFO *IndexFormat; 162 HPALETTE hPal; /* Current Palette */ 163 HPALETTE hPalHalfTone; 164 165 166 WMDIBSECTION dib; 159 167 BITMAPINFO bmi; 160 168 HBITMAP hbmDIB; 161 169 HBITMAP hOldBitmap; 162 HBITMAP Old_Compat_BM; 163 HBITMAP Compat_BM; /* Bitmap for double buffering */ 170 HBITMAP Old_Compat_BM; 171 HBITMAP Compat_BM;/* Bitmap for double buffering*/ 172 164 173 HWND Window; 165 174 HDC hDC; -
trunk/src/opengl/mesa/xform.h
r2962 r3597 1 /* $Id: xform.h,v 1. 2 2000-03-01 18:49:41jeroen Exp $ */1 /* $Id: xform.h,v 1.3 2000-05-23 20:35:00 jeroen Exp $ */ 2 2 3 3 /* 4 4 * Mesa 3-D graphics library 5 * Version: 3. 15 * Version: 3.3 6 6 * 7 7 * Copyright (C) 1999 Brian Paul All Rights Reserved. … … 35 35 #include "types.h" 36 36 37 #ifdef USE_X86_ASM 38 #define _XFORMAPI _ASMAPI 39 #define _XFORMAPIP _ASMAPIP 40 #else 41 #define _XFORMAPI 42 #define _XFORMAPIP * 43 #endif 37 44 38 45 /* 39 46 * Transform a point (column vector) by a matrix: Q = M * P 40 47 */ 41 #define TRANSFORM_POINT( Q, M, P ) \42 Q[0] = M[0] * P[0] + M[4] * P[1] + M[8] * P[2] + M[12] * P[3]; \43 Q[1] = M[1] * P[0] + M[5] * P[1] + M[9] * P[2] + M[13] * P[3]; \44 Q[2] = M[2] * P[0] + M[6] * P[1] + M[10] * P[2] + M[14] * P[3]; \48 #define TRANSFORM_POINT( Q, M, P ) \ 49 Q[0] = M[0] * P[0] + M[4] * P[1] + M[8] * P[2] + M[12] * P[3]; \ 50 Q[1] = M[1] * P[0] + M[5] * P[1] + M[9] * P[2] + M[13] * P[3]; \ 51 Q[2] = M[2] * P[0] + M[6] * P[1] + M[10] * P[2] + M[14] * P[3]; \ 45 52 Q[3] = M[3] * P[0] + M[7] * P[1] + M[11] * P[2] + M[15] * P[3]; 46 53 47 54 48 #define TRANSFORM_POINT3( Q, M, P ) \49 Q[0] = M[0] * P[0] + M[4] * P[1] + M[8] * P[2] + M[12]; \50 Q[1] = M[1] * P[0] + M[5] * P[1] + M[9] * P[2] + M[13]; \51 Q[2] = M[2] * P[0] + M[6] * P[1] + M[10] * P[2] + M[14]; \55 #define TRANSFORM_POINT3( Q, M, P ) \ 56 Q[0] = M[0] * P[0] + M[4] * P[1] + M[8] * P[2] + M[12]; \ 57 Q[1] = M[1] * P[0] + M[5] * P[1] + M[9] * P[2] + M[13]; \ 58 Q[2] = M[2] * P[0] + M[6] * P[1] + M[10] * P[2] + M[14]; \ 52 59 Q[3] = M[3] * P[0] + M[7] * P[1] + M[11] * P[2] + M[15]; 53 60 … … 56 63 * Transform a normal (row vector) by a matrix: [NX NY NZ] = N * MAT 57 64 */ 58 #define TRANSFORM_NORMAL( TO, N, MAT ) \59 do { \60 TO[0] = N[0] * MAT[0] + N[1] * MAT[1] + N[2] * MAT[2]; \61 TO[1] = N[0] * MAT[4] + N[1] * MAT[5] + N[2] * MAT[6]; \62 TO[2] = N[0] * MAT[8] + N[1] * MAT[9] + N[2] * MAT[10]; \65 #define TRANSFORM_NORMAL( TO, N, MAT ) \ 66 do { \ 67 TO[0] = N[0] * MAT[0] + N[1] * MAT[1] + N[2] * MAT[2]; \ 68 TO[1] = N[0] * MAT[4] + N[1] * MAT[5] + N[2] * MAT[6]; \ 69 TO[2] = N[0] * MAT[8] + N[1] * MAT[9] + N[2] * MAT[10]; \ 63 70 } while (0) 64 71 65 72 66 73 extern void gl_transform_vector( GLfloat u[4], 67 const GLfloat v[4],74 const GLfloat v[4], 68 75 const GLfloat m[16] ); 69 76 … … 104 111 * automatically available. 105 112 */ 106 typedef GLvector4f * (* __cdeclclip_func)( GLvector4f *vClip,113 typedef GLvector4f * (_XFORMAPIP clip_func)( GLvector4f *vClip, 107 114 GLvector4f *vProj, 108 115 GLubyte clipMask[], 109 116 GLubyte *orMask, 110 117 GLubyte *andMask ); 111 112 118 113 119 typedef void (*dotprod_func)( GLvector4f *out_vec, … … 129 135 * parameter, to allow a unified interface. 130 136 */ 131 typedef void ( * __cdecltransform_func)( GLvector4f *to_vec,137 typedef void (_XFORMAPIP transform_func)( GLvector4f *to_vec, 132 138 const GLmatrix *mat, 133 139 const GLvector4f *from_vec, … … 141 147 extern void gl_transform_bounds3( GLubyte *orMask, GLubyte *andMask, 142 148 const GLmatrix *mat, 143 CONST GLfloat src[][3] );149 CONST GLfloat src[][3] ); 144 150 145 151 extern void gl_transform_bounds2( GLubyte *orMask, GLubyte *andMask, 146 const GLmatrix *mat,147 CONST GLfloat src[][3] );152 const GLmatrix *mat, 153 CONST GLfloat src[][3] ); 148 154 149 155 … … 160 166 161 167 extern void gl_transform_point_sz( GLfloat Q[4], const GLfloat M[16], 162 const GLfloat P[4], GLuint sz );168 const GLfloat P[4], GLuint sz ); 163 169 164 170 … … 169 175 #define Transform( to, mat, from, mask, cull ) \ 170 176 ( (*gl_transform_tab[cull!=0][(from)->size][(mat)->type])( to, mat, from, mask, cull ), \ 171 (to) )177 (to) ) 172 178 173 179 -
trunk/src/opengl/mesa/xform_tmp.h
r2962 r3597 1 /* $Id: xform_tmp.h,v 1. 2 2000-03-01 18:49:41jeroen Exp $ */1 /* $Id: xform_tmp.h,v 1.3 2000-05-23 20:35:00 jeroen Exp $ */ 2 2 3 3 /* … … 66 66 */ 67 67 68 static void _ _cdeclTAG(transform_points1_general)( GLvector4f *to_vec,68 static void _XFORMAPI TAG(transform_points1_general)( GLvector4f *to_vec, 69 69 const GLmatrix *mat, 70 70 const GLvector4f *from_vec, … … 86 86 STRIDE_LOOP { 87 87 CLIP_CHECK { 88 const GLfloat ox = from[0];89 to[i][0] = m0 * ox + m12;88 const GLfloat ox = from[0]; 89 to[i][0] = m0 * ox + m12; 90 90 to[i][1] = m1 * ox + m13; 91 91 to[i][2] = m2 * ox + m14; … … 99 99 } 100 100 101 static void _ _cdeclTAG(transform_points1_identity)( GLvector4f *to_vec,101 static void _XFORMAPI TAG(transform_points1_identity)( GLvector4f *to_vec, 102 102 const GLmatrix *mat, 103 103 const GLvector4f *from_vec, … … 126 126 } 127 127 128 static void _ _cdeclTAG(transform_points1_2d)( GLvector4f *to_vec,128 static void _XFORMAPI TAG(transform_points1_2d)( GLvector4f *to_vec, 129 129 const GLmatrix *mat, 130 130 const GLvector4f *from_vec, … … 155 155 } 156 156 157 static void _ _cdeclTAG(transform_points1_2d_no_rot)( GLvector4f *to_vec,157 static void _XFORMAPI TAG(transform_points1_2d_no_rot)( GLvector4f *to_vec, 158 158 const GLmatrix *mat, 159 159 const GLvector4f *from_vec, … … 184 184 } 185 185 186 static void _ _cdeclTAG(transform_points1_3d)( GLvector4f *to_vec,186 static void _XFORMAPI TAG(transform_points1_3d)( GLvector4f *to_vec, 187 187 const GLmatrix *mat, 188 188 const GLvector4f *from_vec, … … 203 203 STRIDE_LOOP { 204 204 CLIP_CHECK { 205 const GLfloat ox = from[0];205 const GLfloat ox = from[0]; 206 206 to[i][0] = m0 * ox + m12; 207 207 to[i][1] = m1 * ox + m13; … … 215 215 216 216 217 static void _ _cdeclTAG(transform_points1_3d_no_rot)( GLvector4f *to_vec,217 static void _XFORMAPI TAG(transform_points1_3d_no_rot)( GLvector4f *to_vec, 218 218 const GLmatrix *mat, 219 219 const GLvector4f *from_vec, … … 245 245 } 246 246 247 static void _ _cdeclTAG(transform_points1_perspective)( GLvector4f *to_vec,247 static void _XFORMAPI TAG(transform_points1_perspective)( GLvector4f *to_vec, 248 248 const GLmatrix *mat, 249 249 const GLvector4f *from_vec, … … 263 263 STRIDE_LOOP { 264 264 CLIP_CHECK { 265 const GLfloat ox = from[0];266 to[i][0] = m0 * ox ;267 to[i][1] = 0 ;268 to[i][2] = m14;269 to[i][3] = 0;265 const GLfloat ox = from[0]; 266 to[i][0] = m0 * ox ; 267 to[i][1] = 0 ; 268 to[i][2] = m14; 269 to[i][3] = 0; 270 270 } 271 271 } … … 282 282 * texture pipeline. 283 283 */ 284 static void _ _cdeclTAG(transform_points2_general)( GLvector4f *to_vec,284 static void _XFORMAPI TAG(transform_points2_general)( GLvector4f *to_vec, 285 285 const GLmatrix *mat, 286 286 const GLvector4f *from_vec, … … 302 302 STRIDE_LOOP { 303 303 CLIP_CHECK { 304 const GLfloat ox = from[0], oy = from[1];304 const GLfloat ox = from[0], oy = from[1]; 305 305 to[i][0] = m0 * ox + m4 * oy + m12; 306 306 to[i][1] = m1 * ox + m5 * oy + m13; … … 314 314 } 315 315 316 static void _ _cdeclTAG(transform_points2_identity)( GLvector4f *to_vec,316 static void _XFORMAPI TAG(transform_points2_identity)( GLvector4f *to_vec, 317 317 const GLmatrix *mat, 318 318 const GLvector4f *from_vec, … … 341 341 } 342 342 343 static void _ _cdeclTAG(transform_points2_2d)( GLvector4f *to_vec,343 static void _XFORMAPI TAG(transform_points2_2d)( GLvector4f *to_vec, 344 344 const GLmatrix *mat, 345 345 const GLvector4f *from_vec, … … 371 371 } 372 372 373 static void _ _cdeclTAG(transform_points2_2d_no_rot)( GLvector4f *to_vec,373 static void _XFORMAPI TAG(transform_points2_2d_no_rot)( GLvector4f *to_vec, 374 374 const GLmatrix *mat, 375 375 const GLvector4f *from_vec, … … 400 400 } 401 401 402 static void _ _cdeclTAG(transform_points2_3d)( GLvector4f *to_vec,402 static void _XFORMAPI TAG(transform_points2_3d)( GLvector4f *to_vec, 403 403 const GLmatrix *mat, 404 404 const GLvector4f *from_vec, … … 419 419 STRIDE_LOOP { 420 420 CLIP_CHECK { 421 const GLfloat ox = from[0], oy = from[1];422 to[i][0] = m0 * ox + m4 * oy + m12;423 to[i][1] = m1 * ox + m5 * oy + m13;424 to[i][2] = m2 * ox + m6 * oy + m14;421 const GLfloat ox = from[0], oy = from[1]; 422 to[i][0] = m0 * ox + m4 * oy + m12; 423 to[i][1] = m1 * ox + m5 * oy + m13; 424 to[i][2] = m2 * ox + m6 * oy + m14; 425 425 } 426 426 } … … 434 434 * a texture transformation point of view. 435 435 */ 436 static void _ _cdeclTAG(transform_points2_3d_no_rot)( GLvector4f *to_vec,436 static void _XFORMAPI TAG(transform_points2_3d_no_rot)( GLvector4f *to_vec, 437 437 const GLmatrix *mat, 438 438 const GLvector4f *from_vec, … … 453 453 STRIDE_LOOP { 454 454 CLIP_CHECK { 455 const GLfloat ox = from[0], oy = from[1];456 to[i][0] = m0 * ox + m12;457 to[i][1] = m5 * oy + m13;458 to[i][2] = m14;455 const GLfloat ox = from[0], oy = from[1]; 456 to[i][0] = m0 * ox + m12; 457 to[i][1] = m5 * oy + m13; 458 to[i][2] = m14; 459 459 } 460 460 } … … 473 473 * attached to the assertions that have appeared in them. 474 474 */ 475 static void _ _cdeclTAG(transform_points2_perspective)( GLvector4f *to_vec,475 static void _XFORMAPI TAG(transform_points2_perspective)( GLvector4f *to_vec, 476 476 const GLmatrix *mat, 477 477 const GLvector4f *from_vec, … … 491 491 STRIDE_LOOP { 492 492 CLIP_CHECK { 493 const GLfloat ox = from[0], oy = from[1];494 to[i][0] = m0 * ox ;495 to[i][1] = m5 * oy ;493 const GLfloat ox = from[0], oy = from[1]; 494 to[i][0] = m0 * ox ; 495 to[i][1] = m5 * oy ; 496 496 to[i][2] = m14; 497 497 to[i][3] = 0; … … 505 505 506 506 507 static void _ _cdeclTAG(transform_points3_general)( GLvector4f *to_vec,507 static void _XFORMAPI TAG(transform_points3_general)( GLvector4f *to_vec, 508 508 const GLmatrix *mat, 509 509 const GLvector4f *from_vec, … … 538 538 } 539 539 540 static void _ _cdeclTAG(transform_points3_identity)( GLvector4f *to_vec,540 static void _XFORMAPI TAG(transform_points3_identity)( GLvector4f *to_vec, 541 541 const GLmatrix *mat, 542 542 const GLvector4f *from_vec, … … 566 566 } 567 567 568 static void _ _cdeclTAG(transform_points3_2d)( GLvector4f *to_vec,568 static void _XFORMAPI TAG(transform_points3_2d)( GLvector4f *to_vec, 569 569 const GLmatrix *mat, 570 570 const GLvector4f *from_vec, … … 596 596 } 597 597 598 static void _ _cdeclTAG(transform_points3_2d_no_rot)( GLvector4f *to_vec,598 static void _XFORMAPI TAG(transform_points3_2d_no_rot)( GLvector4f *to_vec, 599 599 const GLmatrix *mat, 600 600 const GLvector4f *from_vec, … … 625 625 } 626 626 627 static void _ _cdeclTAG(transform_points3_3d)( GLvector4f *to_vec,627 static void _XFORMAPI TAG(transform_points3_3d)( GLvector4f *to_vec, 628 628 const GLmatrix *mat, 629 629 const GLvector4f *from_vec, … … 658 658 /* previously known as ortho... 659 659 */ 660 static void _ _cdeclTAG(transform_points3_3d_no_rot)( GLvector4f *to_vec,660 static void _XFORMAPI TAG(transform_points3_3d_no_rot)( GLvector4f *to_vec, 661 661 const GLmatrix *mat, 662 662 const GLvector4f *from_vec, … … 688 688 } 689 689 690 static void _ _cdeclTAG(transform_points3_perspective)( GLvector4f *to_vec,690 static void _XFORMAPI TAG(transform_points3_perspective)( GLvector4f *to_vec, 691 691 const GLmatrix *mat, 692 692 const GLvector4f *from_vec, … … 721 721 722 722 723 static void _ _cdeclTAG(transform_points4_general)( GLvector4f *to_vec,723 static void _XFORMAPI TAG(transform_points4_general)( GLvector4f *to_vec, 724 724 const GLmatrix *mat, 725 725 const GLvector4f *from_vec, … … 754 754 } 755 755 756 static void _ _cdeclTAG(transform_points4_identity)( GLvector4f *to_vec,756 static void _XFORMAPI TAG(transform_points4_identity)( GLvector4f *to_vec, 757 757 const GLmatrix *mat, 758 758 const GLvector4f *from_vec, … … 783 783 } 784 784 785 static void _ _cdeclTAG(transform_points4_2d)( GLvector4f *to_vec,785 static void _XFORMAPI TAG(transform_points4_2d)( GLvector4f *to_vec, 786 786 const GLmatrix *mat, 787 787 const GLvector4f *from_vec, … … 814 814 } 815 815 816 static void _ _cdeclTAG(transform_points4_2d_no_rot)( GLvector4f *to_vec,816 static void _XFORMAPI TAG(transform_points4_2d_no_rot)( GLvector4f *to_vec, 817 817 const GLmatrix *mat, 818 818 const GLvector4f *from_vec, … … 844 844 } 845 845 846 static void _ _cdeclTAG(transform_points4_3d)( GLvector4f *to_vec,846 static void _XFORMAPI TAG(transform_points4_3d)( GLvector4f *to_vec, 847 847 const GLmatrix *mat, 848 848 const GLvector4f *from_vec, … … 876 876 } 877 877 878 static void _ _cdeclTAG(transform_points4_3d_no_rot)( GLvector4f *to_vec,878 static void _XFORMAPI TAG(transform_points4_3d_no_rot)( GLvector4f *to_vec, 879 879 const GLmatrix *mat, 880 880 const GLvector4f *from_vec, … … 907 907 } 908 908 909 static void _ _cdeclTAG(transform_points4_perspective)( GLvector4f *to_vec,909 static void _XFORMAPI TAG(transform_points4_perspective)( GLvector4f *to_vec, 910 910 const GLmatrix *mat, 911 911 const GLvector4f *from_vec, … … 939 939 } 940 940 941 static transform_func TAG(transform_tab_1)[7];942 static transform_func TAG(transform_tab_2)[7];943 static transform_func TAG(transform_tab_3)[7];944 static transform_func TAG(transform_tab_4)[7];941 static transform_func /* _XFORMAPI */ TAG(transform_tab_1)[7]; 942 static transform_func /* _XFORMAPI */ TAG(transform_tab_2)[7]; 943 static transform_func /* _XFORMAPI */ TAG(transform_tab_3)[7]; 944 static transform_func /* _XFORMAPI */ TAG(transform_tab_4)[7]; 945 945 946 946 /* Similar functions could be called several times, with more highly … … 948 948 * startup. 949 949 */ 950 static void TAG(init_c_transformations)( void )950 static void _XFORMAPI TAG(init_c_transformations)( void ) 951 951 { 952 952 #define TAG_TAB gl_transform_tab[IDX] -
trunk/src/opengl/mesa/zoom.h
r2938 r3597 1 /* $Id: zoom.h,v 1. 1 2000-02-29 00:48:45 sandervlExp $ */1 /* $Id: zoom.h,v 1.2 2000-05-23 20:35:01 jeroen Exp $ */ 2 2 3 3 4 4 /* 5 5 * Mesa 3-D graphics library 6 * Version: 3. 16 * Version: 3.3 7 7 * 8 8 * Copyright (C) 1999 Brian Paul All Rights Reserved.
Note:
See TracChangeset
for help on using the changeset viewer.
