initial commit
[retroray] / libs / glide / glide.h
1 /*
2 ** Copyright (c) 1995, 3Dfx Interactive, Inc.
3 ** All Rights Reserved.
4 **
5 ** This is UNPUBLISHED PROPRIETARY SOURCE CODE of 3Dfx Interactive, Inc.;
6 ** the contents of this file may not be disclosed to third parties, copied or
7 ** duplicated in any form, in whole or in part, without the prior written
8 ** permission of 3Dfx Interactive, Inc.
9 **
10 ** RESTRICTED RIGHTS LEGEND:
11 ** Use, duplication or disclosure by the Government is subject to restrictions
12 ** as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
13 ** and Computer Software clause at DFARS 252.227-7013, and/or in similar or
14 ** successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
15 ** rights reserved under the Copyright Laws of the United States.
16 */
17
18 /*
19 ** GLIDE.H
20 **
21 ** The following #defines are relevant when using Glide:
22 **
23 ** One of the following "platform constants" must be defined during
24 ** compilation:
25 **
26 **            __DOS__           Defined for 32-bit DOS applications
27 **            __WIN32__         Defined for 32-bit Windows applications
28 **            __sparc__         Defined for Sun Solaris/SunOS
29 **            __linux__         Defined for Linux applications
30 **            __IRIX__          Defined for SGI Irix applications
31 **
32 */
33 #ifndef __GLIDE_H__
34 #define __GLIDE_H__
35
36 #include <3dfx.h>
37 #include <glidesys.h>
38 #include <sst1vid.h>
39
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43
44 /*
45 ** -----------------------------------------------------------------------
46 ** TYPE DEFINITIONS
47 ** -----------------------------------------------------------------------
48 */
49 typedef FxU32 GrColor_t;
50 typedef FxU8  GrAlpha_t;
51 typedef FxU32 GrMipMapId_t;
52 typedef FxU8  GrFog_t;
53
54 /*
55 ** -----------------------------------------------------------------------
56 ** CONSTANTS AND TYPES
57 ** -----------------------------------------------------------------------
58 */
59 #define MAX_NUM_SST            4
60 #define MAX_MIPMAPS_PER_SST    1024
61 #define GR_FOG_TABLE_SIZE      64
62 #define GR_NULL_MIPMAP_HANDLE  ((GrMipMapId_t) -1)
63 #define GR_ZDEPTHVALUE_NEAREST  0xFFFF
64 #define GR_ZDEPTHVALUE_FARTHEST 0x0000
65 #define GR_WDEPTHVALUE_NEAREST  0x0000
66 #define GR_WDEPTHVALUE_FARTHEST 0xFFFF
67
68 #define GR_MIPMAPLEVELMASK_EVEN  FXBIT(0)
69 #define GR_MIPMAPLEVELMASK_ODD  FXBIT(1)
70 #define GR_MIPMAPLEVELMASK_BOTH (GR_MIPMAPLEVELMASK_EVEN | GR_MIPMAPLEVELMASK_ODD )
71
72 #define GR_LODBIAS_BILINEAR     0.5
73 #define GR_LODBIAS_TRILINEAR    0.0
74
75 typedef FxI32 GrChipID_t;
76 #define GR_TMU0         0x0
77 #define GR_TMU1         0x1
78 #define GR_TMU2         0x2
79 #define GR_FBI          0x3
80
81 typedef FxI32 GrCombineFunction_t;
82 #define GR_COMBINE_FUNCTION_ZERO        0x0
83 #define GR_COMBINE_FUNCTION_NONE        GR_COMBINE_FUNCTION_ZERO
84 #define GR_COMBINE_FUNCTION_LOCAL       0x1
85 #define GR_COMBINE_FUNCTION_LOCAL_ALPHA 0x2
86 #define GR_COMBINE_FUNCTION_SCALE_OTHER 0x3
87 #define GR_COMBINE_FUNCTION_BLEND_OTHER GR_COMBINE_FUNCTION_SCALE_OTHER
88 #define GR_COMBINE_FUNCTION_SCALE_OTHER_ADD_LOCAL 0x4
89 #define GR_COMBINE_FUNCTION_SCALE_OTHER_ADD_LOCAL_ALPHA 0x5 
90 #define GR_COMBINE_FUNCTION_SCALE_OTHER_MINUS_LOCAL 0x6
91 #define GR_COMBINE_FUNCTION_SCALE_OTHER_MINUS_LOCAL_ADD_LOCAL 0x7
92 #define GR_COMBINE_FUNCTION_BLEND GR_COMBINE_FUNCTION_SCALE_OTHER_MINUS_LOCAL_ADD_LOCAL
93 #define GR_COMBINE_FUNCTION_SCALE_OTHER_MINUS_LOCAL_ADD_LOCAL_ALPHA 0x8
94 #define GR_COMBINE_FUNCTION_SCALE_MINUS_LOCAL_ADD_LOCAL 0x9
95 #define GR_COMBINE_FUNCTION_BLEND_LOCAL GR_COMBINE_FUNCTION_SCALE_MINUS_LOCAL_ADD_LOCAL
96 #define GR_COMBINE_FUNCTION_SCALE_MINUS_LOCAL_ADD_LOCAL_ALPHA 0x10
97
98 typedef FxI32 GrCombineFactor_t;
99 #define GR_COMBINE_FACTOR_ZERO          0x0
100 #define GR_COMBINE_FACTOR_NONE          GR_COMBINE_FACTOR_ZERO
101 #define GR_COMBINE_FACTOR_LOCAL         0x1
102 #define GR_COMBINE_FACTOR_OTHER_ALPHA   0x2
103 #define GR_COMBINE_FACTOR_LOCAL_ALPHA   0x3
104 #define GR_COMBINE_FACTOR_TEXTURE_ALPHA 0x4
105 #define GR_COMBINE_FACTOR_DETAIL_FACTOR GR_COMBINE_FACTOR_TEXTURE_ALPHA
106 #define GR_COMBINE_FACTOR_LOD_FRACTION  0x5
107 #define GR_COMBINE_FACTOR_ONE           0x8
108 #define GR_COMBINE_FACTOR_ONE_MINUS_LOCAL 0x9
109 #define GR_COMBINE_FACTOR_ONE_MINUS_OTHER_ALPHA 0xa
110 #define GR_COMBINE_FACTOR_ONE_MINUS_LOCAL_ALPHA 0xb
111 #define GR_COMBINE_FACTOR_ONE_MINUS_TEXTURE_ALPHA 0xc
112 #define GR_COMBINE_FACTOR_ONE_MINUS_DETAIL_FACTOR GR_COMBINE_FACTOR_ONE_MINUS_TEXTURE_ALPHA
113 #define GR_COMBINE_FACTOR_ONE_MINUS_LOD_FRACTION 0xd
114
115
116 typedef FxI32 GrCombineLocal_t;
117 #define GR_COMBINE_LOCAL_ITERATED 0x0
118 #define GR_COMBINE_LOCAL_CONSTANT 0x1
119 #define GR_COMBINE_LOCAL_NONE GR_COMBINE_LOCAL_CONSTANT
120 #define GR_COMBINE_LOCAL_DEPTH  0x2
121
122 typedef FxI32 GrCombineOther_t;
123 #define GR_COMBINE_OTHER_ITERATED 0x0
124 #define GR_COMBINE_OTHER_TEXTURE 0x1
125 #define GR_COMBINE_OTHER_CONSTANT 0x2
126 #define GR_COMBINE_OTHER_NONE GR_COMBINE_OTHER_CONSTANT
127
128
129 typedef FxI32 GrAlphaSource_t;
130 #define GR_ALPHASOURCE_CC_ALPHA 0x0
131 #define GR_ALPHASOURCE_ITERATED_ALPHA 0x1
132 #define GR_ALPHASOURCE_TEXTURE_ALPHA 0x2
133 #define GR_ALPHASOURCE_TEXTURE_ALPHA_TIMES_ITERATED_ALPHA 0x3
134
135
136 typedef FxI32 GrColorCombineFnc_t;
137 #define GR_COLORCOMBINE_ZERO 0x0
138 #define GR_COLORCOMBINE_CCRGB 0x1
139 #define GR_COLORCOMBINE_ITRGB 0x2
140 #define GR_COLORCOMBINE_ITRGB_DELTA0 0x3
141 #define GR_COLORCOMBINE_DECAL_TEXTURE 0x4
142 #define GR_COLORCOMBINE_TEXTURE_TIMES_CCRGB 0x5
143 #define GR_COLORCOMBINE_TEXTURE_TIMES_ITRGB 0x6
144 #define GR_COLORCOMBINE_TEXTURE_TIMES_ITRGB_DELTA0 0x7
145 #define GR_COLORCOMBINE_TEXTURE_TIMES_ITRGB_ADD_ALPHA 0x8
146 #define GR_COLORCOMBINE_TEXTURE_TIMES_ALPHA 0x9
147 #define GR_COLORCOMBINE_TEXTURE_TIMES_ALPHA_ADD_ITRGB 0xa
148 #define GR_COLORCOMBINE_TEXTURE_ADD_ITRGB 0xb
149 #define GR_COLORCOMBINE_TEXTURE_SUB_ITRGB 0xc
150 #define GR_COLORCOMBINE_CCRGB_BLEND_ITRGB_ON_TEXALPHA 0xd
151 #define GR_COLORCOMBINE_DIFF_SPEC_A 0xe
152 #define GR_COLORCOMBINE_DIFF_SPEC_B 0xf
153 #define GR_COLORCOMBINE_ONE 0x10
154
155 typedef FxI32 GrAlphaBlendFnc_t;
156 #define GR_BLEND_ZERO 0x0
157 #define GR_BLEND_SRC_ALPHA 0x1
158 #define GR_BLEND_SRC_COLOR 0x2
159 #define GR_BLEND_DST_COLOR GR_BLEND_SRC_COLOR
160 #define GR_BLEND_DST_ALPHA 0x3 
161 #define GR_BLEND_ONE 0x4
162 #define GR_BLEND_ONE_MINUS_SRC_ALPHA 0x5
163 #define GR_BLEND_ONE_MINUS_SRC_COLOR 0x6
164 #define GR_BLEND_ONE_MINUS_DST_COLOR GR_BLEND_ONE_MINUS_SRC_COLOR 
165 #define GR_BLEND_ONE_MINUS_DST_ALPHA 0x7
166 #define GR_BLEND_RESERVED_8 0x8
167 #define GR_BLEND_RESERVED_9 0x9
168 #define GR_BLEND_RESERVED_A 0xa
169 #define GR_BLEND_RESERVED_B 0xb
170 #define GR_BLEND_RESERVED_C 0xc
171 #define GR_BLEND_RESERVED_D 0xd
172 #define GR_BLEND_RESERVED_E 0xe
173 #define GR_BLEND_ALPHA_SATURATE 0xf
174 #define GR_BLEND_PREFOG_COLOR GR_BLEND_ALPHA_SATURATE
175
176 typedef FxI32 GrAspectRatio_t;
177 #define GR_ASPECT_8x1 0x0       /* 8W x 1H */
178 #define GR_ASPECT_4x1 0x1       /* 4W x 1H */
179 #define GR_ASPECT_2x1 0x2       /* 2W x 1H */
180 #define GR_ASPECT_1x1 0x3       /* 1W x 1H */
181 #define GR_ASPECT_1x2 0x4       /* 1W x 2H */
182 #define GR_ASPECT_1x4 0x5       /* 1W x 4H */
183 #define GR_ASPECT_1x8 0x6       /* 1W x 8H */
184
185 typedef FxI32 GrBuffer_t;
186 #define GR_BUFFER_FRONTBUFFER   0x0
187 #define GR_BUFFER_BACKBUFFER    0x1
188 #define GR_BUFFER_AUXBUFFER     0x2
189 #define GR_BUFFER_DEPTHBUFFER   0x3
190 #define GR_BUFFER_ALPHABUFFER   0x4
191 #define GR_BUFFER_TRIPLEBUFFER  0x5
192
193 typedef FxI32 GrChromakeyMode_t;
194 #define GR_CHROMAKEY_DISABLE    0x0
195 #define GR_CHROMAKEY_ENABLE     0x1
196
197 typedef FxI32 GrCmpFnc_t;
198 #define GR_CMP_NEVER    0x0
199 #define GR_CMP_LESS     0x1
200 #define GR_CMP_EQUAL    0x2
201 #define GR_CMP_LEQUAL   0x3
202 #define GR_CMP_GREATER  0x4
203 #define GR_CMP_NOTEQUAL 0x5
204 #define GR_CMP_GEQUAL   0x6
205 #define GR_CMP_ALWAYS   0x7
206
207 typedef FxI32 GrColorFormat_t;
208 #define GR_COLORFORMAT_ARGB     0x0
209 #define GR_COLORFORMAT_ABGR     0x1
210
211 #define GR_COLORFORMAT_RGBA     0x2
212 #define GR_COLORFORMAT_BGRA     0x3
213
214 typedef FxI32 GrCullMode_t;
215 #define GR_CULL_DISABLE         0x0
216 #define GR_CULL_NEGATIVE        0x1
217 #define GR_CULL_POSITIVE        0x2
218
219 typedef FxI32 GrDepthBufferMode_t;
220 #define GR_DEPTHBUFFER_DISABLE                  0x0
221 #define GR_DEPTHBUFFER_ZBUFFER                  0x1
222 #define GR_DEPTHBUFFER_WBUFFER                  0x2
223 #define GR_DEPTHBUFFER_ZBUFFER_COMPARE_TO_BIAS  0x3
224 #define GR_DEPTHBUFFER_WBUFFER_COMPARE_TO_BIAS  0x4
225
226 typedef FxI32 GrDitherMode_t;
227 #define GR_DITHER_DISABLE       0x0
228 #define GR_DITHER_2x2           0x1
229 #define GR_DITHER_4x4           0x2
230
231 typedef FxI32 GrFogMode_t;
232 #define GR_FOG_DISABLE             0x0
233 #define GR_FOG_WITH_ITERATED_ALPHA 0x1
234 #define GR_FOG_WITH_TABLE          0x2
235 #define GR_FOG_WITH_ITERATED_Z     0x3          /* Bug 735 */
236 #define GR_FOG_MULT2               0x100
237 #define GR_FOG_ADD2                0x200
238
239 typedef FxU32 GrLock_t;
240 #define GR_LFB_READ_ONLY  0x00
241 #define GR_LFB_WRITE_ONLY 0x01
242 #define GR_LFB_IDLE       0x00
243 #define GR_LFB_NOIDLE     0x10
244
245 typedef FxI32 GrLfbBypassMode_t;
246 #define GR_LFBBYPASS_DISABLE    0x0
247 #define GR_LFBBYPASS_ENABLE     0x1
248
249 typedef FxI32 GrLfbWriteMode_t;
250 #define GR_LFBWRITEMODE_565        0x0 /* RGB:RGB */
251 #define GR_LFBWRITEMODE_555        0x1 /* RGB:RGB */
252 #define GR_LFBWRITEMODE_1555       0x2 /* ARGB:ARGB */
253 #define GR_LFBWRITEMODE_RESERVED1  0x3
254 #define GR_LFBWRITEMODE_888        0x4 /* RGB */
255 #define GR_LFBWRITEMODE_8888       0x5 /* ARGB */
256 #define GR_LFBWRITEMODE_RESERVED2  0x6
257 #define GR_LFBWRITEMODE_RESERVED3  0x7
258 #define GR_LFBWRITEMODE_RESERVED4  0x8
259 #define GR_LFBWRITEMODE_RESERVED5  0x9
260 #define GR_LFBWRITEMODE_RESERVED6  0xa
261 #define GR_LFBWRITEMODE_RESERVED7  0xb
262 #define GR_LFBWRITEMODE_565_DEPTH  0xc /* RGB:DEPTH */
263 #define GR_LFBWRITEMODE_555_DEPTH  0xd /* RGB:DEPTH */
264 #define GR_LFBWRITEMODE_1555_DEPTH 0xe /* ARGB:DEPTH */
265 #define GR_LFBWRITEMODE_ZA16       0xf /* DEPTH:DEPTH */
266 #define GR_LFBWRITEMODE_ANY        0xFF
267
268
269 typedef FxI32 GrOriginLocation_t;
270 #define GR_ORIGIN_UPPER_LEFT    0x0
271 #define GR_ORIGIN_LOWER_LEFT    0x1
272 #define GR_ORIGIN_ANY           0xFF
273
274 typedef struct {
275     int                size;
276     void               *lfbPtr;
277     FxU32              strideInBytes;        
278     GrLfbWriteMode_t   writeMode;
279     GrOriginLocation_t origin;
280 } GrLfbInfo_t;
281
282 typedef FxI32 GrLOD_t;
283 #define GR_LOD_256              0x0
284 #define GR_LOD_128              0x1
285 #define GR_LOD_64               0x2
286 #define GR_LOD_32               0x3
287 #define GR_LOD_16               0x4
288 #define GR_LOD_8                0x5
289 #define GR_LOD_4                0x6
290 #define GR_LOD_2                0x7
291 #define GR_LOD_1                0x8
292
293 typedef FxI32 GrMipMapMode_t;
294 #define GR_MIPMAP_DISABLE               0x0 /* no mip mapping  */
295 #define GR_MIPMAP_NEAREST               0x1 /* use nearest mipmap */
296 #define GR_MIPMAP_NEAREST_DITHER        0x2 /* GR_MIPMAP_NEAREST + LOD dith */
297
298
299 typedef FxI32 GrSmoothingMode_t;
300 #define GR_SMOOTHING_DISABLE    0x0
301 #define GR_SMOOTHING_ENABLE     0x1
302
303 typedef FxI32 GrTextureClampMode_t;
304 #define GR_TEXTURECLAMP_WRAP    0x0
305 #define GR_TEXTURECLAMP_CLAMP   0x1
306
307 typedef FxI32 GrTextureCombineFnc_t;
308 #define GR_TEXTURECOMBINE_ZERO          0x0 /* texout = 0 */
309 #define GR_TEXTURECOMBINE_DECAL         0x1 /* texout = texthis */
310 #define GR_TEXTURECOMBINE_OTHER         0x2 /* this TMU in passthru mode */
311 #define GR_TEXTURECOMBINE_ADD           0x3 /* tout = tthis + t(this+1) */
312 #define GR_TEXTURECOMBINE_MULTIPLY      0x4 /* texout = tthis * t(this+1) */
313 #define GR_TEXTURECOMBINE_SUBTRACT      0x5 /* Sutract from upstream TMU */
314 #define GR_TEXTURECOMBINE_DETAIL        0x6 /* detail--detail on tthis */
315 #define GR_TEXTURECOMBINE_DETAIL_OTHER  0x7 /* detail--detail on tthis+1 */
316 #define GR_TEXTURECOMBINE_TRILINEAR_ODD 0x8 /* trilinear--odd levels tthis*/
317 #define GR_TEXTURECOMBINE_TRILINEAR_EVEN 0x9 /*trilinear--even levels tthis*/
318 #define GR_TEXTURECOMBINE_ONE           0xa /* texout = 0xFFFFFFFF */
319
320 typedef FxI32 GrTextureFilterMode_t;
321 #define GR_TEXTUREFILTER_POINT_SAMPLED  0x0
322 #define GR_TEXTUREFILTER_BILINEAR       0x1
323
324 typedef FxI32 GrTextureFormat_t;
325 #define GR_TEXFMT_8BIT                  0x0
326 #define GR_TEXFMT_RGB_332 GR_TEXFMT_8BIT
327 #define GR_TEXFMT_YIQ_422               0x1
328 #define GR_TEXFMT_ALPHA_8               0x2 /* (0..0xFF) alpha     */
329 #define GR_TEXFMT_INTENSITY_8           0x3 /* (0..0xFF) intensity */
330 #define GR_TEXFMT_ALPHA_INTENSITY_44    0x4
331 #define GR_TEXFMT_P_8                   0x5 /* 8-bit palette */
332 #define GR_TEXFMT_RSVD0                 0x6
333 #define GR_TEXFMT_RSVD1                 0x7
334 #define GR_TEXFMT_16BIT                 0x8
335 #define GR_TEXFMT_ARGB_8332 GR_TEXFMT_16BIT
336 #define GR_TEXFMT_AYIQ_8422             0x9
337 #define GR_TEXFMT_RGB_565               0xa
338 #define GR_TEXFMT_ARGB_1555             0xb
339 #define GR_TEXFMT_ARGB_4444             0xc
340 #define GR_TEXFMT_ALPHA_INTENSITY_88    0xd
341 #define GR_TEXFMT_AP_88                 0xe /* 8-bit alpha 8-bit palette */
342 #define GR_TEXFMT_RSVD2                 0xf
343
344 typedef FxU32 GrTexTable_t;
345 #define GR_TEXTABLE_NCC0    0x0
346 #define GR_TEXTABLE_NCC1    0x1
347 #define GR_TEXTABLE_PALETTE 0x2
348
349 typedef FxU32 GrNCCTable_t;
350 #define GR_NCCTABLE_NCC0    0x0
351 #define GR_NCCTABLE_NCC1    0x1
352
353 typedef FxU32 GrTexBaseRange_t;
354 #define GR_TEXBASE_256      0x0
355 #define GR_TEXBASE_128      0x1
356 #define GR_TEXBASE_64       0x2
357 #define GR_TEXBASE_32_TO_1  0x3
358
359 #ifdef GLIDE3
360 #define GLIDE3_EXTRA_STATE      68
361 #else
362 #define GLIDE3_EXTRA_STATE      0
363 #endif
364
365 #define GLIDE_STATE_PAD_SIZE 312 + GLIDE3_EXTRA_STATE 
366
367 #ifdef GLIDE_LIB
368 typedef struct _GrState_s GrState;
369 #else
370 typedef struct _GrState_s {
371   char pad[GLIDE_STATE_PAD_SIZE];
372 } GrState;
373 #endif
374
375 #ifdef GLIDE3
376 /* Types of data in strips */
377 #define GR_FLOAT        0
378 #define GR_U8           1
379
380 /* Parameters for strips */
381 #define GR_VERTEX       0
382 #define GR_COLOR        1
383 #define GR_TEXTURE0     2
384 #define GR_TEXTURE1     3
385
386 /* Componenets for strips */
387 /* vertex */
388 #define GR_VERTEX_XYZ   3
389 #define GR_VERTEX_XYZW  4
390 /* Color */
391 #define GR_COLOR_RGB    3
392 #define GR_COLOR_RGBA   4
393 /* Texture */
394 #define GR_TEX_NONE     0
395 #define GR_TEX_ST       2
396 #define GR_TEX_STW      3
397
398 /* Stuf for grDrawArray */
399 #define GR_POINTS               0
400 #define GR_LINE_STRIP           1
401 #define GR_POLYGON              2
402 #define GR_TRIANGLE_STRIP       3
403 #define GR_TRIANGLE_FAN         4
404 #define GR_TRIANGLES            5
405
406 #endif
407
408 /*
409 ** -----------------------------------------------------------------------
410 ** STRUCTURES
411 ** -----------------------------------------------------------------------
412 */
413 /*
414 ** 3DF texture file structs
415 */
416 typedef struct
417 {
418   FxU32               width, height;
419   int                 small_lod, large_lod;
420   GrAspectRatio_t     aspect_ratio;
421   GrTextureFormat_t   format;
422 } Gu3dfHeader;
423
424 typedef struct
425 {
426   FxU8  yRGB[16];
427   FxI16 iRGB[4][3];
428   FxI16 qRGB[4][3];
429   FxU32 packed_data[12];
430 } GuNccTable;
431
432 typedef struct {
433     FxU32 data[256];
434 } GuTexPalette;
435
436 typedef union {
437     GuNccTable   nccTable;
438     GuTexPalette palette;
439 } GuTexTable;
440
441 typedef struct
442 {
443   Gu3dfHeader  header;
444   GuTexTable   table;
445   void        *data;
446   FxU32        mem_required;    /* memory required for mip map in bytes. */
447 } Gu3dfInfo;
448
449 typedef struct {
450     GrLOD_t           smallLod;
451     GrLOD_t           largeLod;
452     GrAspectRatio_t   aspectRatio;
453     GrTextureFormat_t format;
454     void              *data;
455 } GrTexInfo;
456
457 typedef struct
458 {
459   int           sst;                    /* SST where this texture map was stored  */
460   FxBool        valid;                  /* set when this table entry is allocated*/
461   int           width, height;
462   GrAspectRatio_t aspect_ratio;         /* aspect ratio of the mip map.  */
463   void          *data;                  /* actual texture data  */
464
465   GrTextureFormat_t  format;                    /* format of the texture table */
466   GrMipMapMode_t     mipmap_mode;               /* mip map mode for this texture */
467   GrTextureFilterMode_t   magfilter_mode;       /* filtering to be used when magnified */
468   GrTextureFilterMode_t   minfilter_mode;       /* filtering to be used with minified  */
469   GrTextureClampMode_t    s_clamp_mode;         /* how this texture should be clamped in s */
470   GrTextureClampMode_t    t_clamp_mode;         /* how this texture should be clamped in t */
471   FxU32         tLOD;                   /* Register value for tLOD register */ 
472   FxU32         tTextureMode;           /* Register value for tTextureMode register
473                                            not including non-texture specific bits */
474   FxU32         lod_bias;               /* LOD bias of the mip map in preshifted 4.2*/
475   GrLOD_t       lod_min, lod_max;       /* largest and smallest levels of detail  */
476   int           tmu;                    /* tmu on which this texture resides */
477   FxU32         odd_even_mask;          /* mask specifying levels on this tmu  */
478   FxU32         tmu_base_address;       /* base addr (in TMU mem) of this texture */
479   FxBool        trilinear;              /* should we blend by lod? */
480
481   GuNccTable    ncc_table;              /* NCC compression table (optional) */
482 } GrMipMapInfo;
483
484 typedef int GrSstType;
485 #define GR_SSTTYPE_VOODOO    0
486 #define GR_SSTTYPE_SST96     1
487 #define GR_SSTTYPE_AT3D      2
488 #define GR_SSTTYPE_Voodoo2   3
489
490 typedef struct GrTMUConfig_St {
491   int    tmuRev;                /* Rev of Texelfx chip */
492   int    tmuRam;                /* 1, 2, or 4 MB */
493 } GrTMUConfig_t;
494
495 typedef struct GrVoodooConfig_St {
496   int    fbRam;                         /* 1, 2, or 4 MB */
497   int    fbiRev;                        /* Rev of Pixelfx chip */
498   int    nTexelfx;                      /* How many texelFX chips are there? */
499   FxBool sliDetect;                     /* Is it a scan-line interleaved board? */
500   GrTMUConfig_t tmuConfig[GLIDE_NUM_TMU];   /* Configuration of the Texelfx chips */
501 } GrVoodooConfig_t;
502
503 typedef struct GrSst96Config_St {
504   int   fbRam;                  /* How much? */
505   int   nTexelfx;
506   GrTMUConfig_t tmuConfig;
507 } GrSst96Config_t;
508
509 typedef GrVoodooConfig_t GrVoodoo2Config_t;
510
511 typedef struct GrAT3DConfig_St {
512   int   rev;
513 } GrAT3DConfig_t;
514
515 typedef struct {
516   int num_sst;                  /* # of HW units in the system */
517   struct {
518     GrSstType type;             /* Which hardware is it? */
519     union SstBoard_u {
520       GrVoodooConfig_t  VoodooConfig;
521       GrSst96Config_t   SST96Config;
522       GrAT3DConfig_t    AT3DConfig;
523       GrVoodoo2Config_t Voodoo2Config;
524     } sstBoard;
525   } SSTs[MAX_NUM_SST];          /* configuration for each board */
526 } GrHwConfiguration;
527
528 typedef struct GrSstPerfStats_s {
529   FxU32  pixelsIn;              /* # pixels processed (minus buffer clears) */
530   FxU32  chromaFail;            /* # pixels not drawn due to chroma key */ 
531   FxU32  zFuncFail;             /* # pixels not drawn due to Z comparison */
532   FxU32  aFuncFail;             /* # pixels not drawn due to alpha comparison */
533   FxU32  pixelsOut;             /* # pixels drawn (including buffer clears) */
534 } GrSstPerfStats_t;
535
536
537 typedef struct {
538   float  sow;                   /* s texture ordinate (s over w) */
539   float  tow;                   /* t texture ordinate (t over w) */  
540   float  oow;                   /* 1/w (used mipmapping - really 0xfff/w) */
541 }  GrTmuVertex;
542
543 /*
544 ** GrVertex
545 ** If these are changed the C & assembly language trisetup routines MUST
546 ** be changed, for they will no longer work.
547 */
548 typedef struct
549 {
550   float x, y, z;                /* X, Y, and Z of scrn space -- Z is ignored */
551   float r, g, b;                /* R, G, B, ([0..255.0]) */
552   float ooz;                    /* 65535/Z (used for Z-buffering) */
553   float a;                      /* Alpha [0..255.0] */
554   float oow;                    /* 1/W (used for W-buffering, texturing) */
555   GrTmuVertex  tmuvtx[GLIDE_NUM_TMU];
556 } GrVertex;
557
558 /* For indexing GrVertex as a float *.
559    CHANGE THESE IF THE VERTEX STRUCTURE CHANGES!
560    */
561 #define GR_VERTEX_X_OFFSET              0
562 #define GR_VERTEX_Y_OFFSET              1
563 #define GR_VERTEX_Z_OFFSET              2
564 #define GR_VERTEX_R_OFFSET              3
565 #define GR_VERTEX_G_OFFSET              4
566 #define GR_VERTEX_B_OFFSET              5
567 #define GR_VERTEX_OOZ_OFFSET            6
568 #define GR_VERTEX_A_OFFSET              7
569 #define GR_VERTEX_OOW_OFFSET            8
570 #define GR_VERTEX_SOW_TMU0_OFFSET       9
571 #define GR_VERTEX_TOW_TMU0_OFFSET       10
572 #define GR_VERTEX_OOW_TMU0_OFFSET       11
573 #define GR_VERTEX_SOW_TMU1_OFFSET       12
574 #define GR_VERTEX_TOW_TMU1_OFFSET       13
575 #define GR_VERTEX_OOW_TMU1_OFFSET       14
576 #if (GLIDE_NUM_TMU > 2)
577 #define GR_VERTEX_SOW_TMU2_OFFSET       15
578 #define GR_VERTEX_TOW_TMU2_OFFSET       16
579 #define GR_VERTEX_OOW_TMU2_OFFSET       17
580 #endif
581
582 typedef FxU32 GrLfbSrcFmt_t;
583 #define GR_LFB_SRC_FMT_565          0x00
584 #define GR_LFB_SRC_FMT_555          0x01
585 #define GR_LFB_SRC_FMT_1555         0x02
586 #define GR_LFB_SRC_FMT_888          0x04
587 #define GR_LFB_SRC_FMT_8888         0x05
588 #define GR_LFB_SRC_FMT_565_DEPTH    0x0c
589 #define GR_LFB_SRC_FMT_555_DEPTH    0x0d
590 #define GR_LFB_SRC_FMT_1555_DEPTH   0x0e
591 #define GR_LFB_SRC_FMT_ZA16         0x0f
592 #define GR_LFB_SRC_FMT_RLE16        0x80
593
594 typedef FxI32 GrPassthruMode_t;
595 #define GR_PASSTHRU_SHOW_VGA    0x0
596 #define GR_PASSTHRU_SHOW_SST1   0x1
597
598 typedef FxU32 GrHint_t;
599 #define GR_HINTTYPE_MIN                 0
600 #define GR_HINT_STWHINT                 0
601 #define GR_HINT_FIFOCHECKHINT           1
602 #define GR_HINT_FPUPRECISION            2
603 #define GR_HINT_ALLOW_MIPMAP_DITHER     3
604 #define GR_HINTTYPE_MAX                 3
605
606 typedef FxU32 GrSTWHint_t;
607 #define GR_STWHINT_W_DIFF_FBI   FXBIT(0)
608 #define GR_STWHINT_W_DIFF_TMU0  FXBIT(1)
609 #define GR_STWHINT_ST_DIFF_TMU0 FXBIT(2)
610 #define GR_STWHINT_W_DIFF_TMU1  FXBIT(3)
611 #define GR_STWHINT_ST_DIFF_TMU1 FXBIT(4)
612 #define GR_STWHINT_W_DIFF_TMU2  FXBIT(5)
613 #define GR_STWHINT_ST_DIFF_TMU2 FXBIT(6)
614
615 typedef FxU32 GrControl_t;
616 #define GR_CONTROL_ACTIVATE   0x1
617 #define GR_CONTROL_DEACTIVATE 0x2
618 #define GR_CONTROL_RESIZE     0x3
619 #define GR_CONTROL_MOVE       0x4
620
621 #define GR_GENERATE_FIFOCHECK_HINT_MASK(swHWM, swLWM) \
622   (((swHWM & 0xffff) << 16) | (swLWM & 0xffff))
623
624 /*
625 ** -----------------------------------------------------------------------
626 ** FUNCTION PROTOTYPES
627 ** -----------------------------------------------------------------------
628 */
629 #ifndef FX_GLIDE_NO_FUNC_PROTO
630 /*
631 ** rendering functions
632 */
633 FX_ENTRY void FX_CALL
634 grDrawLine( const GrVertex *v1, const GrVertex *v2 );
635
636 FX_ENTRY void FX_CALL
637 grDrawPlanarPolygon( int nverts, const int ilist[], const GrVertex vlist[] );
638
639 FX_ENTRY void FX_CALL
640 grDrawPlanarPolygonVertexList( int nverts, const GrVertex vlist[] );
641
642 FX_ENTRY void FX_CALL
643 grDrawPoint( const GrVertex *pt );
644
645 FX_ENTRY void FX_CALL
646 grDrawPolygon( int nverts, const int ilist[], const GrVertex vlist[] );
647
648 FX_ENTRY void FX_CALL
649 grDrawPolygonVertexList( int nverts, const GrVertex vlist[] );
650
651 FX_ENTRY void FX_CALL
652 grDrawTriangle( const GrVertex *a, const GrVertex *b, const GrVertex *c );
653
654 /*
655 ** buffer management
656 */
657 FX_ENTRY void FX_CALL
658 grBufferClear( GrColor_t color, GrAlpha_t alpha, FxU16 depth );
659
660 FX_ENTRY int FX_CALL
661 grBufferNumPending( void );
662
663 FX_ENTRY void FX_CALL
664 grBufferSwap( int swap_interval );
665
666 FX_ENTRY void FX_CALL
667 grRenderBuffer( GrBuffer_t buffer );
668
669 /*
670 ** error management
671 */
672 typedef void (*GrErrorCallbackFnc_t)( const char *string, FxBool fatal );
673
674 FX_ENTRY void FX_CALL 
675 grErrorSetCallback( GrErrorCallbackFnc_t fnc );
676
677 /*
678 ** SST routines
679 */
680 FX_ENTRY void FX_CALL 
681 grSstIdle(void);
682
683 FX_ENTRY FxU32 FX_CALL 
684 grSstVideoLine( void );
685
686 FX_ENTRY FxBool FX_CALL 
687 grSstVRetraceOn( void );
688
689 FX_ENTRY FxBool FX_CALL 
690 grSstIsBusy( void );
691
692 FX_ENTRY FxBool FX_CALL 
693 grSstWinOpen(
694           FxU32                hWnd,
695           GrScreenResolution_t screen_resolution,
696           GrScreenRefresh_t    refresh_rate,
697           GrColorFormat_t      color_format,
698           GrOriginLocation_t   origin_location,
699           int                  nColBuffers,
700           int                  nAuxBuffers);
701
702 FX_ENTRY void FX_CALL
703 grSstWinClose( void );
704
705 FX_ENTRY FxBool FX_CALL
706 grSstControl( FxU32 code );
707
708 FX_ENTRY FxBool FX_CALL 
709 grSstQueryHardware( GrHwConfiguration *hwconfig );
710
711 FX_ENTRY FxBool FX_CALL 
712 grSstQueryBoards( GrHwConfiguration *hwconfig );
713
714 FX_ENTRY void FX_CALL
715 grSstOrigin(GrOriginLocation_t  origin);
716
717 FX_ENTRY void FX_CALL 
718 grSstSelect( int which_sst );
719
720 FX_ENTRY FxU32 FX_CALL 
721 grSstScreenHeight( void );
722
723 FX_ENTRY FxU32 FX_CALL 
724 grSstScreenWidth( void );
725
726 FX_ENTRY FxU32 FX_CALL 
727 grSstStatus( void );
728
729 /*
730 **  Drawing Statistics
731 */
732 FX_ENTRY void FX_CALL
733 grSstPerfStats(GrSstPerfStats_t *pStats);
734
735 FX_ENTRY void FX_CALL
736 grSstResetPerfStats(void);
737
738 FX_ENTRY void FX_CALL
739 grResetTriStats();
740
741 FX_ENTRY void FX_CALL
742 grTriStats(FxU32 *trisProcessed, FxU32 *trisDrawn);
743
744 /*
745 ** Glide configuration and special effect maintenance functions
746 */
747 FX_ENTRY void FX_CALL
748 grAlphaBlendFunction(
749                      GrAlphaBlendFnc_t rgb_sf,   GrAlphaBlendFnc_t rgb_df,
750                      GrAlphaBlendFnc_t alpha_sf, GrAlphaBlendFnc_t alpha_df
751                      );
752
753 FX_ENTRY void FX_CALL
754 grAlphaCombine(
755                GrCombineFunction_t function, GrCombineFactor_t factor,
756                GrCombineLocal_t local, GrCombineOther_t other,
757                FxBool invert
758                );
759
760 FX_ENTRY void FX_CALL
761 grAlphaControlsITRGBLighting( FxBool enable );
762
763 FX_ENTRY void FX_CALL
764 grAlphaTestFunction( GrCmpFnc_t function );
765
766 FX_ENTRY void FX_CALL
767 grAlphaTestReferenceValue( GrAlpha_t value );
768
769 FX_ENTRY void FX_CALL 
770 grChromakeyMode( GrChromakeyMode_t mode );
771
772 FX_ENTRY void FX_CALL 
773 grChromakeyValue( GrColor_t value );
774
775 FX_ENTRY void FX_CALL 
776 grClipWindow( FxU32 minx, FxU32 miny, FxU32 maxx, FxU32 maxy );
777
778 FX_ENTRY void FX_CALL 
779 grColorCombine(
780                GrCombineFunction_t function, GrCombineFactor_t factor,
781                GrCombineLocal_t local, GrCombineOther_t other,
782                FxBool invert );
783
784 FX_ENTRY void FX_CALL
785 grColorMask( FxBool rgb, FxBool a );
786
787 FX_ENTRY void FX_CALL 
788 grCullMode( GrCullMode_t mode );
789
790 FX_ENTRY void FX_CALL 
791 grConstantColorValue( GrColor_t value );
792
793 FX_ENTRY void FX_CALL 
794 grConstantColorValue4( float a, float r, float g, float b );
795
796 FX_ENTRY void FX_CALL 
797 grDepthBiasLevel( FxI16 level );
798
799 FX_ENTRY void FX_CALL 
800 grDepthBufferFunction( GrCmpFnc_t function );
801
802 FX_ENTRY void FX_CALL 
803 grDepthBufferMode( GrDepthBufferMode_t mode );
804
805 FX_ENTRY void FX_CALL 
806 grDepthMask( FxBool mask );
807
808 FX_ENTRY void FX_CALL 
809 grDisableAllEffects( void );
810
811 FX_ENTRY void FX_CALL 
812 grDitherMode( GrDitherMode_t mode );
813
814 FX_ENTRY void FX_CALL 
815 grFogColorValue( GrColor_t fogcolor );
816
817 FX_ENTRY void FX_CALL 
818 grFogMode( GrFogMode_t mode );
819
820 FX_ENTRY void FX_CALL 
821 grFogTable( const GrFog_t ft[GR_FOG_TABLE_SIZE] );
822
823 FX_ENTRY void FX_CALL 
824 grGammaCorrectionValue( float value );
825
826 FX_ENTRY void FX_CALL
827 grSplash(float x, float y, float width, float height, FxU32 frame);
828
829 /*
830 ** texture mapping control functions
831 */
832 FX_ENTRY FxU32 FX_CALL 
833 grTexCalcMemRequired(
834                      GrLOD_t lodmin, GrLOD_t lodmax,
835                      GrAspectRatio_t aspect, GrTextureFormat_t fmt);
836
837 FX_ENTRY FxU32 FX_CALL 
838 grTexTextureMemRequired( FxU32     evenOdd,
839                                  GrTexInfo *info   );
840
841 FX_ENTRY FxU32 FX_CALL 
842 grTexMinAddress( GrChipID_t tmu );
843
844
845 FX_ENTRY FxU32 FX_CALL 
846 grTexMaxAddress( GrChipID_t tmu );
847
848
849 FX_ENTRY void FX_CALL 
850 grTexNCCTable( GrChipID_t tmu, GrNCCTable_t table );
851
852 FX_ENTRY void FX_CALL 
853 grTexSource( GrChipID_t tmu,
854              FxU32      startAddress,
855              FxU32      evenOdd,
856              GrTexInfo  *info );
857
858 FX_ENTRY void FX_CALL 
859 grTexClampMode(
860                GrChipID_t tmu,
861                GrTextureClampMode_t s_clampmode,
862                GrTextureClampMode_t t_clampmode
863                );
864
865 FX_ENTRY void FX_CALL 
866 grTexCombine(
867              GrChipID_t tmu,
868              GrCombineFunction_t rgb_function,
869              GrCombineFactor_t rgb_factor, 
870              GrCombineFunction_t alpha_function,
871              GrCombineFactor_t alpha_factor,
872              FxBool rgb_invert,
873              FxBool alpha_invert
874              );
875
876 FX_ENTRY void FX_CALL 
877 grTexCombineFunction(
878                      GrChipID_t tmu,
879                      GrTextureCombineFnc_t fnc
880                      );
881
882 FX_ENTRY void FX_CALL 
883 grTexDetailControl(
884                    GrChipID_t tmu,
885                    int lod_bias,
886                    FxU8 detail_scale,
887                    float detail_max
888                    );
889
890 FX_ENTRY void FX_CALL 
891 grTexFilterMode(
892                 GrChipID_t tmu,
893                 GrTextureFilterMode_t minfilter_mode,
894                 GrTextureFilterMode_t magfilter_mode
895                 );
896
897
898 FX_ENTRY void FX_CALL 
899 grTexLodBiasValue(GrChipID_t tmu, float bias );
900
901 FX_ENTRY void FX_CALL 
902 grTexDownloadMipMap( GrChipID_t tmu,
903                      FxU32      startAddress,
904                      FxU32      evenOdd,
905                      GrTexInfo  *info );
906
907 FX_ENTRY void FX_CALL 
908 grTexDownloadMipMapLevel( GrChipID_t        tmu,
909                           FxU32             startAddress,
910                           GrLOD_t           thisLod,
911                           GrLOD_t           largeLod,
912                           GrAspectRatio_t   aspectRatio,
913                           GrTextureFormat_t format,
914                           FxU32             evenOdd,
915                           void              *data );
916
917 FX_ENTRY void FX_CALL 
918 grTexDownloadMipMapLevelPartial( GrChipID_t        tmu,
919                                  FxU32             startAddress,
920                                  GrLOD_t           thisLod,
921                                  GrLOD_t           largeLod,
922                                  GrAspectRatio_t   aspectRatio,
923                                  GrTextureFormat_t format,
924                                  FxU32             evenOdd,
925                                  void              *data,
926                                  int               start,
927                                  int               end );
928
929
930 FX_ENTRY void FX_CALL 
931 ConvertAndDownloadRle( GrChipID_t        tmu,
932                         FxU32             startAddress,
933                         GrLOD_t           thisLod,
934                         GrLOD_t           largeLod,
935                         GrAspectRatio_t   aspectRatio,
936                         GrTextureFormat_t format,
937                         FxU32             evenOdd,
938                         FxU8              *bm_data,
939                         long              bm_h,
940                         FxU32             u0,
941                         FxU32             v0,
942                         FxU32             width,
943                         FxU32             height,
944                         FxU32             dest_width,
945                         FxU32             dest_height,
946                         FxU16             *tlut);
947
948 FX_ENTRY void FX_CALL 
949 grCheckForRoom(FxI32 n);
950
951 FX_ENTRY void FX_CALL
952 grTexDownloadTable( GrChipID_t   tmu,
953                     GrTexTable_t type, 
954                     void         *data );
955
956 FX_ENTRY void FX_CALL
957 grTexDownloadTablePartial( GrChipID_t   tmu,
958                            GrTexTable_t type, 
959                            void         *data,
960                            int          start,
961                            int          end );
962
963 FX_ENTRY void FX_CALL 
964 grTexMipMapMode( GrChipID_t     tmu, 
965                  GrMipMapMode_t mode,
966                  FxBool         lodBlend );
967
968 FX_ENTRY void FX_CALL 
969 grTexMultibase( GrChipID_t tmu,
970                 FxBool     enable );
971
972 FX_ENTRY void FX_CALL
973 grTexMultibaseAddress( GrChipID_t       tmu,
974                        GrTexBaseRange_t range,
975                        FxU32            startAddress,
976                        FxU32            evenOdd,
977                        GrTexInfo        *info );
978
979 /*
980 ** utility texture functions
981 */
982 FX_ENTRY GrMipMapId_t FX_CALL 
983 guTexAllocateMemory(
984                     GrChipID_t tmu,
985                     FxU8 odd_even_mask,
986                     int width, int height,
987                     GrTextureFormat_t fmt,
988                     GrMipMapMode_t mm_mode,
989                     GrLOD_t smallest_lod, GrLOD_t largest_lod,
990                     GrAspectRatio_t aspect,
991                     GrTextureClampMode_t s_clamp_mode,
992                     GrTextureClampMode_t t_clamp_mode,
993                     GrTextureFilterMode_t minfilter_mode,
994                     GrTextureFilterMode_t magfilter_mode,
995                     float lod_bias,
996                     FxBool trilinear
997                     );
998
999 FX_ENTRY FxBool FX_CALL 
1000 guTexChangeAttributes(
1001                       GrMipMapId_t mmid,
1002                       int width, int height,
1003                       GrTextureFormat_t fmt,
1004                       GrMipMapMode_t mm_mode,
1005                       GrLOD_t smallest_lod, GrLOD_t largest_lod,
1006                       GrAspectRatio_t aspect,
1007                       GrTextureClampMode_t s_clamp_mode,
1008                       GrTextureClampMode_t t_clamp_mode,
1009                       GrTextureFilterMode_t minFilterMode,
1010                       GrTextureFilterMode_t magFilterMode
1011                       );
1012
1013 FX_ENTRY void FX_CALL 
1014 guTexCombineFunction(
1015                      GrChipID_t tmu,
1016                      GrTextureCombineFnc_t fnc
1017                      );
1018
1019 FX_ENTRY GrMipMapId_t FX_CALL 
1020 guTexGetCurrentMipMap( GrChipID_t tmu );
1021
1022 FX_ENTRY GrMipMapInfo * FX_CALL 
1023 guTexGetMipMapInfo( GrMipMapId_t mmid );
1024
1025 FX_ENTRY FxU32 FX_CALL 
1026 guTexMemQueryAvail( GrChipID_t tmu );
1027
1028 FX_ENTRY void FX_CALL 
1029 guTexMemReset( void );
1030
1031 FX_ENTRY void FX_CALL 
1032 guTexDownloadMipMap(
1033                     GrMipMapId_t mmid,
1034                     const void *src,
1035                     const GuNccTable *table
1036                     );
1037
1038 FX_ENTRY void FX_CALL 
1039 guTexDownloadMipMapLevel(
1040                          GrMipMapId_t mmid,
1041                          GrLOD_t lod,
1042                          const void **src
1043                          );
1044 FX_ENTRY void FX_CALL 
1045 guTexSource( GrMipMapId_t id );
1046
1047 /*
1048 ** linear frame buffer functions
1049 */
1050
1051 FX_ENTRY FxBool FX_CALL
1052 grLfbLock( GrLock_t type, GrBuffer_t buffer, GrLfbWriteMode_t writeMode,
1053            GrOriginLocation_t origin, FxBool pixelPipeline, 
1054            GrLfbInfo_t *info );
1055
1056 FX_ENTRY FxBool FX_CALL
1057 grLfbUnlock( GrLock_t type, GrBuffer_t buffer );
1058
1059 FX_ENTRY void FX_CALL 
1060 grLfbConstantAlpha( GrAlpha_t alpha );
1061
1062 FX_ENTRY void FX_CALL 
1063 grLfbConstantDepth( FxU16 depth );
1064
1065 FX_ENTRY void FX_CALL 
1066 grLfbWriteColorSwizzle(FxBool swizzleBytes, FxBool swapWords);
1067
1068 FX_ENTRY void FX_CALL
1069 grLfbWriteColorFormat(GrColorFormat_t colorFormat);
1070
1071
1072 FX_ENTRY FxBool FX_CALL
1073 grLfbWriteRegion( GrBuffer_t dst_buffer, 
1074                   FxU32 dst_x, FxU32 dst_y, 
1075                   GrLfbSrcFmt_t src_format, 
1076                   FxU32 src_width, FxU32 src_height, 
1077                   FxI32 src_stride, void *src_data );
1078
1079 FX_ENTRY FxBool FX_CALL
1080 grLfbReadRegion( GrBuffer_t src_buffer,
1081                  FxU32 src_x, FxU32 src_y,
1082                  FxU32 src_width, FxU32 src_height,
1083                  FxU32 dst_stride, void *dst_data );
1084
1085
1086 /*
1087 **  Antialiasing Functions
1088 */
1089 FX_ENTRY void FX_CALL
1090 grAADrawLine(const GrVertex *v1, const GrVertex *v2);
1091
1092 FX_ENTRY void FX_CALL
1093 grAADrawPoint(const GrVertex *pt );
1094
1095 FX_ENTRY void FX_CALL
1096 grAADrawPolygon(const int nverts, const int ilist[], const GrVertex vlist[]);
1097
1098 FX_ENTRY void FX_CALL
1099 grAADrawPolygonVertexList(const int nverts, const GrVertex vlist[]);
1100
1101 FX_ENTRY void FX_CALL
1102 grAADrawTriangle(
1103                  const GrVertex *a, const GrVertex *b, const GrVertex *c,
1104                  FxBool ab_antialias, FxBool bc_antialias, FxBool ca_antialias
1105                  );
1106
1107 /*
1108 ** glide management functions
1109 */
1110 FX_ENTRY void FX_CALL
1111 grGlideInit( void );
1112
1113 FX_ENTRY void FX_CALL
1114 grGlideShutdown( void );
1115
1116 FX_ENTRY void FX_CALL
1117 grGlideGetVersion( char version[80] );
1118
1119 FX_ENTRY void FX_CALL
1120 grGlideGetState( GrState *state );
1121
1122 FX_ENTRY void FX_CALL
1123 grGlideSetState( const GrState *state );
1124
1125 FX_ENTRY void FX_CALL
1126 grGlideShamelessPlug(const FxBool on);
1127
1128 FX_ENTRY void FX_CALL
1129 grHints(GrHint_t hintType, FxU32 hintMask);
1130
1131 #ifdef GLIDE3
1132 FX_ENTRY void FX_CALL
1133 grParameterData(FxU32 param, FxU32 components, FxU32 type, FxI32 offset);
1134
1135 FX_ENTRY void FX_CALL 
1136 grDrawArray(FxU32 mode, FxU32 Count, void *pointers[]);
1137 #endif
1138
1139 #endif /* FX_GLIDE_NO_FUNC_PROTO */
1140
1141 #ifdef __cplusplus
1142 }
1143 #endif
1144
1145 #include <glideutl.h>
1146
1147 #endif /* __GLIDE_H__ */