2 ** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
3 ** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
4 ** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
5 ** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE
6 ** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com).
7 ** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
8 ** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
9 ** FULL TEXT OF THE NON-WARRANTY PROVISIONS.
11 ** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
12 ** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
13 ** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
14 ** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
15 ** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
18 ** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
24 ** The following #defines are relevant when using Glide:
26 ** One of the following "platform constants" must be defined during
29 ** __DOS__ Defined for 32-bit DOS applications
30 ** __WIN32__ Defined for 32-bit Windows applications
31 ** __sparc__ Defined for Sun Solaris/SunOS
32 ** __linux__ Defined for Linux applications
33 ** __FreeBSD__ Defined for FreeBSD applications
34 ** __NetBSD__ Defined for NetBSD applications
35 ** __OpenBSD__ Defined for OpenBSD applications
36 ** __IRIX__ Defined for SGI Irix applications
51 ** -----------------------------------------------------------------------
53 ** -----------------------------------------------------------------------
55 typedef FxU32 GrColor_t;
56 typedef FxU8 GrAlpha_t;
57 typedef FxU32 GrMipMapId_t;
58 typedef FxU32 GrStipplePattern_t;
60 typedef FxU32 GrContext_t;
61 typedef int (FX_CALL *GrProc)();
68 ** -----------------------------------------------------------------------
69 ** CONSTANTS AND TYPES
70 ** -----------------------------------------------------------------------
72 #define GR_NULL_MIPMAP_HANDLE ((GrMipMapId_t) -1)
74 #define GR_MIPMAPLEVELMASK_EVEN FXBIT(0)
75 #define GR_MIPMAPLEVELMASK_ODD FXBIT(1)
76 #define GR_MIPMAPLEVELMASK_BOTH (GR_MIPMAPLEVELMASK_EVEN | GR_MIPMAPLEVELMASK_ODD )
78 #define GR_LODBIAS_BILINEAR 0.5
79 #define GR_LODBIAS_TRILINEAR 0.0
81 typedef FxI32 GrChipID_t;
88 typedef FxI32 GrCombineFunction_t;
89 #define GR_COMBINE_FUNCTION_ZERO 0x0
90 #define GR_COMBINE_FUNCTION_NONE GR_COMBINE_FUNCTION_ZERO
91 #define GR_COMBINE_FUNCTION_LOCAL 0x1
92 #define GR_COMBINE_FUNCTION_LOCAL_ALPHA 0x2
93 #define GR_COMBINE_FUNCTION_SCALE_OTHER 0x3
94 #define GR_COMBINE_FUNCTION_BLEND_OTHER GR_COMBINE_FUNCTION_SCALE_OTHER
95 #define GR_COMBINE_FUNCTION_SCALE_OTHER_ADD_LOCAL 0x4
96 #define GR_COMBINE_FUNCTION_SCALE_OTHER_ADD_LOCAL_ALPHA 0x5
97 #define GR_COMBINE_FUNCTION_SCALE_OTHER_MINUS_LOCAL 0x6
98 #define GR_COMBINE_FUNCTION_SCALE_OTHER_MINUS_LOCAL_ADD_LOCAL 0x7
99 #define GR_COMBINE_FUNCTION_BLEND GR_COMBINE_FUNCTION_SCALE_OTHER_MINUS_LOCAL_ADD_LOCAL
100 #define GR_COMBINE_FUNCTION_SCALE_OTHER_MINUS_LOCAL_ADD_LOCAL_ALPHA 0x8
101 #define GR_COMBINE_FUNCTION_SCALE_MINUS_LOCAL_ADD_LOCAL 0x9
102 #define GR_COMBINE_FUNCTION_BLEND_LOCAL GR_COMBINE_FUNCTION_SCALE_MINUS_LOCAL_ADD_LOCAL
103 #define GR_COMBINE_FUNCTION_SCALE_MINUS_LOCAL_ADD_LOCAL_ALPHA 0x10
105 typedef FxI32 GrCombineFactor_t;
106 #define GR_COMBINE_FACTOR_ZERO 0x0
107 #define GR_COMBINE_FACTOR_NONE GR_COMBINE_FACTOR_ZERO
108 #define GR_COMBINE_FACTOR_LOCAL 0x1
109 #define GR_COMBINE_FACTOR_OTHER_ALPHA 0x2
110 #define GR_COMBINE_FACTOR_LOCAL_ALPHA 0x3
111 #define GR_COMBINE_FACTOR_TEXTURE_ALPHA 0x4
112 #define GR_COMBINE_FACTOR_TEXTURE_RGB 0x5
113 #define GR_COMBINE_FACTOR_DETAIL_FACTOR GR_COMBINE_FACTOR_TEXTURE_ALPHA
114 #define GR_COMBINE_FACTOR_LOD_FRACTION 0x5
115 #define GR_COMBINE_FACTOR_ONE 0x8
116 #define GR_COMBINE_FACTOR_ONE_MINUS_LOCAL 0x9
117 #define GR_COMBINE_FACTOR_ONE_MINUS_OTHER_ALPHA 0xa
118 #define GR_COMBINE_FACTOR_ONE_MINUS_LOCAL_ALPHA 0xb
119 #define GR_COMBINE_FACTOR_ONE_MINUS_TEXTURE_ALPHA 0xc
120 #define GR_COMBINE_FACTOR_ONE_MINUS_DETAIL_FACTOR GR_COMBINE_FACTOR_ONE_MINUS_TEXTURE_ALPHA
121 #define GR_COMBINE_FACTOR_ONE_MINUS_LOD_FRACTION 0xd
124 typedef FxI32 GrCombineLocal_t;
125 #define GR_COMBINE_LOCAL_ITERATED 0x0
126 #define GR_COMBINE_LOCAL_CONSTANT 0x1
127 #define GR_COMBINE_LOCAL_NONE GR_COMBINE_LOCAL_CONSTANT
128 #define GR_COMBINE_LOCAL_DEPTH 0x2
130 typedef FxI32 GrCombineOther_t;
131 #define GR_COMBINE_OTHER_ITERATED 0x0
132 #define GR_COMBINE_OTHER_TEXTURE 0x1
133 #define GR_COMBINE_OTHER_CONSTANT 0x2
134 #define GR_COMBINE_OTHER_NONE GR_COMBINE_OTHER_CONSTANT
137 typedef FxI32 GrAlphaSource_t;
138 #define GR_ALPHASOURCE_CC_ALPHA 0x0
139 #define GR_ALPHASOURCE_ITERATED_ALPHA 0x1
140 #define GR_ALPHASOURCE_TEXTURE_ALPHA 0x2
141 #define GR_ALPHASOURCE_TEXTURE_ALPHA_TIMES_ITERATED_ALPHA 0x3
144 typedef FxI32 GrColorCombineFnc_t;
145 #define GR_COLORCOMBINE_ZERO 0x0
146 #define GR_COLORCOMBINE_CCRGB 0x1
147 #define GR_COLORCOMBINE_ITRGB 0x2
148 #define GR_COLORCOMBINE_ITRGB_DELTA0 0x3
149 #define GR_COLORCOMBINE_DECAL_TEXTURE 0x4
150 #define GR_COLORCOMBINE_TEXTURE_TIMES_CCRGB 0x5
151 #define GR_COLORCOMBINE_TEXTURE_TIMES_ITRGB 0x6
152 #define GR_COLORCOMBINE_TEXTURE_TIMES_ITRGB_DELTA0 0x7
153 #define GR_COLORCOMBINE_TEXTURE_TIMES_ITRGB_ADD_ALPHA 0x8
154 #define GR_COLORCOMBINE_TEXTURE_TIMES_ALPHA 0x9
155 #define GR_COLORCOMBINE_TEXTURE_TIMES_ALPHA_ADD_ITRGB 0xa
156 #define GR_COLORCOMBINE_TEXTURE_ADD_ITRGB 0xb
157 #define GR_COLORCOMBINE_TEXTURE_SUB_ITRGB 0xc
158 #define GR_COLORCOMBINE_CCRGB_BLEND_ITRGB_ON_TEXALPHA 0xd
159 #define GR_COLORCOMBINE_DIFF_SPEC_A 0xe
160 #define GR_COLORCOMBINE_DIFF_SPEC_B 0xf
161 #define GR_COLORCOMBINE_ONE 0x10
163 typedef FxI32 GrAlphaBlendFnc_t;
164 #define GR_BLEND_ZERO 0x0
165 #define GR_BLEND_SRC_ALPHA 0x1
166 #define GR_BLEND_SRC_COLOR 0x2
167 #define GR_BLEND_DST_COLOR GR_BLEND_SRC_COLOR
168 #define GR_BLEND_DST_ALPHA 0x3
169 #define GR_BLEND_ONE 0x4
170 #define GR_BLEND_ONE_MINUS_SRC_ALPHA 0x5
171 #define GR_BLEND_ONE_MINUS_SRC_COLOR 0x6
172 #define GR_BLEND_ONE_MINUS_DST_COLOR GR_BLEND_ONE_MINUS_SRC_COLOR
173 #define GR_BLEND_ONE_MINUS_DST_ALPHA 0x7
174 #define GR_BLEND_RESERVED_8 0x8
175 #define GR_BLEND_RESERVED_9 0x9
176 #define GR_BLEND_RESERVED_A 0xa
177 #define GR_BLEND_RESERVED_B 0xb
178 #define GR_BLEND_RESERVED_C 0xc
179 #define GR_BLEND_RESERVED_D 0xd
180 #define GR_BLEND_RESERVED_E 0xe
181 #define GR_BLEND_ALPHA_SATURATE 0xf
182 #define GR_BLEND_PREFOG_COLOR GR_BLEND_ALPHA_SATURATE
184 typedef FxI32 GrAspectRatio_t;
185 #define GR_ASPECT_LOG2_8x1 3 /* 8W x 1H */
186 #define GR_ASPECT_LOG2_4x1 2 /* 4W x 1H */
187 #define GR_ASPECT_LOG2_2x1 1 /* 2W x 1H */
188 #define GR_ASPECT_LOG2_1x1 0 /* 1W x 1H */
189 #define GR_ASPECT_LOG2_1x2 -1 /* 1W x 2H */
190 #define GR_ASPECT_LOG2_1x4 -2 /* 1W x 4H */
191 #define GR_ASPECT_LOG2_1x8 -3 /* 1W x 8H */
193 typedef FxI32 GrBuffer_t;
194 #define GR_BUFFER_FRONTBUFFER 0x0
195 #define GR_BUFFER_BACKBUFFER 0x1
196 #define GR_BUFFER_AUXBUFFER 0x2
197 #define GR_BUFFER_DEPTHBUFFER 0x3
198 #define GR_BUFFER_ALPHABUFFER 0x4
199 #define GR_BUFFER_TRIPLEBUFFER 0x5
201 typedef FxI32 GrChromakeyMode_t;
202 #define GR_CHROMAKEY_DISABLE 0x0
203 #define GR_CHROMAKEY_ENABLE 0x1
205 typedef FxI32 GrChromaRangeMode_t;
206 #define GR_CHROMARANGE_RGB_ALL_EXT 0x0
208 #define GR_CHROMARANGE_DISABLE_EXT 0x00
209 #define GR_CHROMARANGE_ENABLE_EXT 0x01
211 typedef FxI32 GrTexChromakeyMode_t;
212 #define GR_TEXCHROMA_DISABLE_EXT 0x0
213 #define GR_TEXCHROMA_ENABLE_EXT 0x1
215 #define GR_TEXCHROMARANGE_RGB_ALL_EXT 0x0
217 typedef FxI32 GrCmpFnc_t;
218 #define GR_CMP_NEVER 0x0
219 #define GR_CMP_LESS 0x1
220 #define GR_CMP_EQUAL 0x2
221 #define GR_CMP_LEQUAL 0x3
222 #define GR_CMP_GREATER 0x4
223 #define GR_CMP_NOTEQUAL 0x5
224 #define GR_CMP_GEQUAL 0x6
225 #define GR_CMP_ALWAYS 0x7
227 typedef FxI32 GrColorFormat_t;
228 #define GR_COLORFORMAT_ARGB 0x0
229 #define GR_COLORFORMAT_ABGR 0x1
231 #define GR_COLORFORMAT_RGBA 0x2
232 #define GR_COLORFORMAT_BGRA 0x3
234 typedef FxI32 GrCullMode_t;
235 #define GR_CULL_DISABLE 0x0
236 #define GR_CULL_NEGATIVE 0x1
237 #define GR_CULL_POSITIVE 0x2
239 typedef FxI32 GrDepthBufferMode_t;
240 #define GR_DEPTHBUFFER_DISABLE 0x0
241 #define GR_DEPTHBUFFER_ZBUFFER 0x1
242 #define GR_DEPTHBUFFER_WBUFFER 0x2
243 #define GR_DEPTHBUFFER_ZBUFFER_COMPARE_TO_BIAS 0x3
244 #define GR_DEPTHBUFFER_WBUFFER_COMPARE_TO_BIAS 0x4
246 typedef FxI32 GrDitherMode_t;
247 #define GR_DITHER_DISABLE 0x0
248 #define GR_DITHER_2x2 0x1
249 #define GR_DITHER_4x4 0x2
251 typedef FxI32 GrStippleMode_t;
252 #define GR_STIPPLE_DISABLE 0x0
253 #define GR_STIPPLE_PATTERN 0x1
254 #define GR_STIPPLE_ROTATE 0x2
256 typedef FxI32 GrFogMode_t;
257 #define GR_FOG_DISABLE 0x0
258 #define GR_FOG_WITH_TABLE_ON_FOGCOORD_EXT 0x1
259 #define GR_FOG_WITH_TABLE_ON_Q 0x2
260 #define GR_FOG_WITH_TABLE_ON_W GR_FOG_WITH_TABLE_ON_Q
261 #define GR_FOG_WITH_ITERATED_Z 0x3
262 #define GR_FOG_WITH_ITERATED_ALPHA_EXT 0x4
263 #define GR_FOG_MULT2 0x100
264 #define GR_FOG_ADD2 0x200
266 typedef FxU32 GrLock_t;
267 #define GR_LFB_READ_ONLY 0x00
268 #define GR_LFB_WRITE_ONLY 0x01
269 #define GR_LFB_IDLE 0x00
270 #define GR_LFB_NOIDLE 0x10
272 #define GR_LFB_WRITE_ONLY_EXPLICIT_EXT 0x02 /* explicitly not allow reading from the lfb pointer */
274 typedef FxI32 GrLfbBypassMode_t;
275 #define GR_LFBBYPASS_DISABLE 0x0
276 #define GR_LFBBYPASS_ENABLE 0x1
278 typedef FxI32 GrLfbWriteMode_t;
279 #define GR_LFBWRITEMODE_565 0x0 /* RGB:RGB */
280 #define GR_LFBWRITEMODE_555 0x1 /* RGB:RGB */
281 #define GR_LFBWRITEMODE_1555 0x2 /* ARGB:ARGB */
282 #define GR_LFBWRITEMODE_RESERVED1 0x3
283 #define GR_LFBWRITEMODE_888 0x4 /* RGB */
284 #define GR_LFBWRITEMODE_8888 0x5 /* ARGB */
285 #define GR_LFBWRITEMODE_RESERVED2 0x6
286 #define GR_LFBWRITEMODE_RESERVED3 0x7
287 #define GR_LFBWRITEMODE_RESERVED4 0x8
288 #define GR_LFBWRITEMODE_RESERVED5 0x9
289 #define GR_LFBWRITEMODE_RESERVED6 0xa
290 #define GR_LFBWRITEMODE_RESERVED7 0xb
291 #define GR_LFBWRITEMODE_565_DEPTH 0xc /* RGB:DEPTH */
292 #define GR_LFBWRITEMODE_555_DEPTH 0xd /* RGB:DEPTH */
293 #define GR_LFBWRITEMODE_1555_DEPTH 0xe /* ARGB:DEPTH */
294 #define GR_LFBWRITEMODE_ZA16 0xf /* DEPTH:DEPTH */
295 #define GR_LFBWRITEMODE_ANY 0xFF
298 typedef FxI32 GrOriginLocation_t;
299 #define GR_ORIGIN_UPPER_LEFT 0x0
300 #define GR_ORIGIN_LOWER_LEFT 0x1
301 #define GR_ORIGIN_ANY 0xFF
307 GrLfbWriteMode_t writeMode;
308 GrOriginLocation_t origin;
311 typedef FxI32 GrLOD_t;
312 #define GR_LOD_LOG2_256 0x8
313 #define GR_LOD_LOG2_128 0x7
314 #define GR_LOD_LOG2_64 0x6
315 #define GR_LOD_LOG2_32 0x5
316 #define GR_LOD_LOG2_16 0x4
317 #define GR_LOD_LOG2_8 0x3
318 #define GR_LOD_LOG2_4 0x2
319 #define GR_LOD_LOG2_2 0x1
320 #define GR_LOD_LOG2_1 0x0
322 typedef FxI32 GrMipMapMode_t;
323 #define GR_MIPMAP_DISABLE 0x0 /* no mip mapping */
324 #define GR_MIPMAP_NEAREST 0x1 /* use nearest mipmap */
325 #define GR_MIPMAP_NEAREST_DITHER 0x2 /* GR_MIPMAP_NEAREST + LOD dith */
327 typedef FxI32 GrSmoothingMode_t;
328 #define GR_SMOOTHING_DISABLE 0x0
329 #define GR_SMOOTHING_ENABLE 0x1
331 typedef FxI32 GrTextureClampMode_t;
332 #define GR_TEXTURECLAMP_WRAP 0x0
333 #define GR_TEXTURECLAMP_CLAMP 0x1
334 #define GR_TEXTURECLAMP_MIRROR_EXT 0x2
336 typedef FxI32 GrTextureCombineFnc_t;
337 #define GR_TEXTURECOMBINE_ZERO 0x0 /* texout = 0 */
338 #define GR_TEXTURECOMBINE_DECAL 0x1 /* texout = texthis */
339 #define GR_TEXTURECOMBINE_OTHER 0x2 /* this TMU in passthru mode */
340 #define GR_TEXTURECOMBINE_ADD 0x3 /* tout = tthis + t(this+1) */
341 #define GR_TEXTURECOMBINE_MULTIPLY 0x4 /* texout = tthis * t(this+1) */
342 #define GR_TEXTURECOMBINE_SUBTRACT 0x5 /* Sutract from upstream TMU */
343 #define GR_TEXTURECOMBINE_DETAIL 0x6 /* detail--detail on tthis */
344 #define GR_TEXTURECOMBINE_DETAIL_OTHER 0x7 /* detail--detail on tthis+1 */
345 #define GR_TEXTURECOMBINE_TRILINEAR_ODD 0x8 /* trilinear--odd levels tthis*/
346 #define GR_TEXTURECOMBINE_TRILINEAR_EVEN 0x9 /*trilinear--even levels tthis*/
347 #define GR_TEXTURECOMBINE_ONE 0xa /* texout = 0xFFFFFFFF */
349 typedef FxI32 GrTextureFilterMode_t;
350 #define GR_TEXTUREFILTER_POINT_SAMPLED 0x0
351 #define GR_TEXTUREFILTER_BILINEAR 0x1
353 typedef FxI32 GrTextureFormat_t;
355 #define GR_TEXFMT_8BIT 0x0
356 #define GR_TEXFMT_RGB_332 GR_TEXFMT_8BIT
357 #define GR_TEXFMT_YIQ_422 0x1
358 #define GR_TEXFMT_ALPHA_8 0x2 /* (0..0xFF) alpha */
359 #define GR_TEXFMT_INTENSITY_8 0x3 /* (0..0xFF) intensity */
360 #define GR_TEXFMT_ALPHA_INTENSITY_44 0x4
361 #define GR_TEXFMT_P_8 0x5 /* 8-bit palette */
362 #define GR_TEXFMT_RSVD0 0x6 /* GR_TEXFMT_P_8_RGBA */
363 #define GR_TEXFMT_P_8_6666 GR_TEXFMT_RSVD0
364 #define GR_TEXFMT_P_8_6666_EXT GR_TEXFMT_RSVD0
365 #define GR_TEXFMT_RSVD1 0x7
366 #define GR_TEXFMT_16BIT 0x8
367 #define GR_TEXFMT_ARGB_8332 GR_TEXFMT_16BIT
368 #define GR_TEXFMT_AYIQ_8422 0x9
369 #define GR_TEXFMT_RGB_565 0xa
370 #define GR_TEXFMT_ARGB_1555 0xb
371 #define GR_TEXFMT_ARGB_4444 0xc
372 #define GR_TEXFMT_ALPHA_INTENSITY_88 0xd
373 #define GR_TEXFMT_AP_88 0xe /* 8-bit alpha 8-bit palette */
374 #define GR_TEXFMT_RSVD2 0xf
375 #define GR_TEXFMT_RSVD4 GR_TEXFMT_RSVD2
377 typedef FxU32 GrTexTable_t;
378 #define GR_TEXTABLE_NCC0 0x0
379 #define GR_TEXTABLE_NCC1 0x1
380 #define GR_TEXTABLE_PALETTE 0x2
381 #define GR_TEXTABLE_PALETTE_6666_EXT 0x3
383 typedef FxU32 GrNCCTable_t;
384 #define GR_NCCTABLE_NCC0 0x0
385 #define GR_NCCTABLE_NCC1 0x1
387 typedef FxU32 GrTexBaseRange_t;
388 #define GR_TEXBASE_256 0x3
389 #define GR_TEXBASE_128 0x2
390 #define GR_TEXBASE_64 0x1
391 #define GR_TEXBASE_32_TO_1 0x0
394 typedef FxU32 GrEnableMode_t;
395 #define GR_MODE_DISABLE 0x0
396 #define GR_MODE_ENABLE 0x1
398 #define GR_AA_ORDERED 0x01
399 #define GR_ALLOW_MIPMAP_DITHER 0x02
400 #define GR_PASSTHRU 0x03
401 #define GR_SHAMELESS_PLUG 0x04
402 #define GR_VIDEO_SMOOTHING 0x05
404 typedef FxU32 GrCoordinateSpaceMode_t;
405 #define GR_WINDOW_COORDS 0x00
406 #define GR_CLIP_COORDS 0x01
408 /* Types of data in strips */
412 /* Parameters for strips */
413 #define GR_PARAM_XY 0x01
414 #define GR_PARAM_Z 0x02
415 #define GR_PARAM_W 0x03
416 #define GR_PARAM_Q 0x04
417 #define GR_PARAM_FOG_EXT 0x05
419 #define GR_PARAM_A 0x10
421 #define GR_PARAM_RGB 0x20
423 #define GR_PARAM_PARGB 0x30
425 #define GR_PARAM_ST0 0x40
426 #define GR_PARAM_ST1 GR_PARAM_ST0+1
427 #define GR_PARAM_ST2 GR_PARAM_ST0+2
429 #define GR_PARAM_Q0 0x50
430 #define GR_PARAM_Q1 GR_PARAM_Q0+1
431 #define GR_PARAM_Q2 GR_PARAM_Q0+2
433 #define GR_PARAM_DISABLE 0x00
434 #define GR_PARAM_ENABLE 0x01
437 ** grDrawVertexArray/grDrawVertexArrayContiguous primitive type
440 #define GR_LINE_STRIP 1
443 #define GR_TRIANGLE_STRIP 4
444 #define GR_TRIANGLE_FAN 5
445 #define GR_TRIANGLES 6
446 #define GR_TRIANGLE_STRIP_CONTINUE 7
447 #define GR_TRIANGLE_FAN_CONTINUE 8
450 ** grGet/grReset types
452 #define GR_BITS_DEPTH 0x01
453 #define GR_BITS_RGBA 0x02
454 #define GR_FIFO_FULLNESS 0x03
455 #define GR_FOG_TABLE_ENTRIES 0x04
456 #define GR_GAMMA_TABLE_ENTRIES 0x05
457 #define GR_GLIDE_STATE_SIZE 0x06
458 #define GR_GLIDE_VERTEXLAYOUT_SIZE 0x07
459 #define GR_IS_BUSY 0x08
460 #define GR_LFB_PIXEL_PIPE 0x09
461 #define GR_MAX_TEXTURE_SIZE 0x0a
462 #define GR_MAX_TEXTURE_ASPECT_RATIO 0x0b
463 #define GR_MEMORY_FB 0x0c
464 #define GR_MEMORY_TMU 0x0d
465 #define GR_MEMORY_UMA 0x0e
466 #define GR_NUM_BOARDS 0x0f
467 #define GR_NON_POWER_OF_TWO_TEXTURES 0x10
468 #define GR_NUM_FB 0x11
469 #define GR_NUM_SWAP_HISTORY_BUFFER 0x12
470 #define GR_NUM_TMU 0x13
471 #define GR_PENDING_BUFFERSWAPS 0x14
472 #define GR_REVISION_FB 0x15
473 #define GR_REVISION_TMU 0x16
474 #define GR_STATS_LINES 0x17 /* grGet/grReset */
475 #define GR_STATS_PIXELS_AFUNC_FAIL 0x18
476 #define GR_STATS_PIXELS_CHROMA_FAIL 0x19
477 #define GR_STATS_PIXELS_DEPTHFUNC_FAIL 0x1a
478 #define GR_STATS_PIXELS_IN 0x1b
479 #define GR_STATS_PIXELS_OUT 0x1c
480 #define GR_STATS_PIXELS 0x1d /* grReset */
481 #define GR_STATS_POINTS 0x1e /* grGet/grReset */
482 #define GR_STATS_TRIANGLES_IN 0x1f
483 #define GR_STATS_TRIANGLES_OUT 0x20
484 #define GR_STATS_TRIANGLES 0x21 /* grReset */
485 #define GR_SWAP_HISTORY 0x22
486 #define GR_SUPPORTS_PASSTHRU 0x23
487 #define GR_TEXTURE_ALIGN 0x24
488 #define GR_VIDEO_POSITION 0x25
489 #define GR_VIEWPORT 0x26
490 #define GR_WDEPTH_MIN_MAX 0x27
491 #define GR_ZDEPTH_MIN_MAX 0x28
492 #define GR_VERTEX_PARAMETER 0x29
493 #define GR_BITS_GAMMA 0x2a
494 #define GR_GET_RESERVED_1 0x1000
499 #define GR_EXTENSION 0xa0
500 #define GR_HARDWARE 0xa1
501 #define GR_RENDERER 0xa2
502 #define GR_VENDOR 0xa3
503 #define GR_VERSION 0xa4
506 ** -----------------------------------------------------------------------
508 ** -----------------------------------------------------------------------
512 GrLOD_t smallLodLog2;
513 GrLOD_t largeLodLog2;
514 GrAspectRatio_t aspectRatioLog2;
515 GrTextureFormat_t format;
519 typedef struct GrSstPerfStats_s {
520 FxU32 pixelsIn; /* # pixels processed (minus buffer clears) */
521 FxU32 chromaFail; /* # pixels not drawn due to chroma key */
522 FxU32 zFuncFail; /* # pixels not drawn due to Z comparison */
523 FxU32 aFuncFail; /* # pixels not drawn due to alpha comparison */
524 FxU32 pixelsOut; /* # pixels drawn (including buffer clears) */
528 GrScreenResolution_t resolution;
529 GrScreenRefresh_t refresh;
534 typedef GrResolution GlideResolution;
536 #define GR_QUERY_ANY ((FxU32)(~0))
538 typedef FxU32 GrLfbSrcFmt_t;
539 #define GR_LFB_SRC_FMT_565 0x00
540 #define GR_LFB_SRC_FMT_555 0x01
541 #define GR_LFB_SRC_FMT_1555 0x02
542 #define GR_LFB_SRC_FMT_888 0x04
543 #define GR_LFB_SRC_FMT_8888 0x05
544 #define GR_LFB_SRC_FMT_565_DEPTH 0x0c
545 #define GR_LFB_SRC_FMT_555_DEPTH 0x0d
546 #define GR_LFB_SRC_FMT_1555_DEPTH 0x0e
547 #define GR_LFB_SRC_FMT_ZA16 0x0f
548 #define GR_LFB_SRC_FMT_RLE16 0x80
551 #define GR_HINT_H3DENABLE 4
552 #undef GR_HINTTYPE_MAX
553 #define GR_HINTTYPE_MAX 4
557 ** -----------------------------------------------------------------------
558 ** FUNCTION PROTOTYPES
559 ** -----------------------------------------------------------------------
561 #ifndef FX_GLIDE_NO_FUNC_PROTO
563 ** rendering functions
565 FX_ENTRY void FX_CALL
566 grDrawPoint( const void *pt );
568 FX_ENTRY void FX_CALL
569 grDrawLine( const void *v1, const void *v2 );
571 FX_ENTRY void FX_CALL
572 grDrawTriangle( const void *a, const void *b, const void *c );
574 FX_ENTRY void FX_CALL
575 grVertexLayout(FxU32 param, FxI32 offset, FxU32 mode);
577 FX_ENTRY void FX_CALL
578 grDrawVertexArray(FxU32 mode, FxU32 Count, void *pointers);
580 FX_ENTRY void FX_CALL
581 grDrawVertexArrayContiguous(FxU32 mode, FxU32 Count, void *pointers, FxU32 stride);
584 ** Antialiasing Functions
587 FX_ENTRY void FX_CALL
589 const void *a, const void *b, const void *c,
590 FxBool ab_antialias, FxBool bc_antialias, FxBool ca_antialias
596 FX_ENTRY void FX_CALL
597 grBufferClear( GrColor_t color, GrAlpha_t alpha, FxU32 depth );
599 FX_ENTRY void FX_CALL
600 grBufferSwap( FxU32 swap_interval );
602 FX_ENTRY void FX_CALL
603 grRenderBuffer( GrBuffer_t buffer );
608 typedef void (*GrErrorCallbackFnc_t)( const char *string, FxBool fatal );
610 FX_ENTRY void FX_CALL
611 grErrorSetCallback( GrErrorCallbackFnc_t fnc );
616 FX_ENTRY void FX_CALL
619 FX_ENTRY void FX_CALL
622 FX_ENTRY GrContext_t FX_CALL
625 GrScreenResolution_t screen_resolution,
626 GrScreenRefresh_t refresh_rate,
627 GrColorFormat_t color_format,
628 GrOriginLocation_t origin_location,
632 FX_ENTRY FxBool FX_CALL
633 grSstWinClose( GrContext_t context );
635 FX_ENTRY void FX_CALL
636 grSetNumPendingBuffers(FxI32 NumPendingBuffers);
638 FX_ENTRY FxBool FX_CALL
639 grSelectContext( GrContext_t context );
641 FX_ENTRY void FX_CALL
642 grSstOrigin(GrOriginLocation_t origin);
644 FX_ENTRY void FX_CALL
645 grSstSelect( int which_sst );
648 ** Glide configuration and special effect maintenance functions
650 FX_ENTRY void FX_CALL
651 grAlphaBlendFunction(
652 GrAlphaBlendFnc_t rgb_sf, GrAlphaBlendFnc_t rgb_df,
653 GrAlphaBlendFnc_t alpha_sf, GrAlphaBlendFnc_t alpha_df
656 FX_ENTRY void FX_CALL
658 GrCombineFunction_t function, GrCombineFactor_t factor,
659 GrCombineLocal_t local, GrCombineOther_t other,
663 FX_ENTRY void FX_CALL
664 grAlphaControlsITRGBLighting( FxBool enable );
666 FX_ENTRY void FX_CALL
667 grAlphaTestFunction( GrCmpFnc_t function );
669 FX_ENTRY void FX_CALL
670 grAlphaTestReferenceValue( GrAlpha_t value );
672 FX_ENTRY void FX_CALL
673 grChromakeyMode( GrChromakeyMode_t mode );
675 FX_ENTRY void FX_CALL
676 grChromakeyValue( GrColor_t value );
678 FX_ENTRY void FX_CALL
679 grClipWindow( FxU32 minx, FxU32 miny, FxU32 maxx, FxU32 maxy );
681 FX_ENTRY void FX_CALL
683 GrCombineFunction_t function, GrCombineFactor_t factor,
684 GrCombineLocal_t local, GrCombineOther_t other,
687 FX_ENTRY void FX_CALL
688 grColorMask( FxBool rgb, FxBool a );
690 FX_ENTRY void FX_CALL
691 grCullMode( GrCullMode_t mode );
693 FX_ENTRY void FX_CALL
694 grConstantColorValue( GrColor_t value );
696 FX_ENTRY void FX_CALL
697 grDepthBiasLevel( FxI32 level );
699 FX_ENTRY void FX_CALL
700 grDepthBufferFunction( GrCmpFnc_t function );
702 FX_ENTRY void FX_CALL
703 grDepthBufferMode( GrDepthBufferMode_t mode );
705 FX_ENTRY void FX_CALL
706 grDepthMask( FxBool mask );
708 FX_ENTRY void FX_CALL
709 grDisableAllEffects( void );
711 FX_ENTRY void FX_CALL
712 grDitherMode( GrDitherMode_t mode );
714 FX_ENTRY void FX_CALL
715 grFogColorValue( GrColor_t fogcolor );
717 FX_ENTRY void FX_CALL
718 grFogMode( GrFogMode_t mode );
720 FX_ENTRY void FX_CALL
721 grFogTable( const GrFog_t ft[] );
723 FX_ENTRY void FX_CALL
724 grLoadGammaTable( FxU32 nentries, FxU32 *red, FxU32 *green, FxU32 *blue);
726 FX_ENTRY void FX_CALL
727 grSplash(float x, float y, float width, float height, FxU32 frame);
729 FX_ENTRY FxU32 FX_CALL
730 grGet( FxU32 pname, FxU32 plength, FxI32 *params );
732 FX_ENTRY const char * FX_CALL
733 grGetString( FxU32 pname );
735 FX_ENTRY FxI32 FX_CALL
736 grQueryResolutions( const GrResolution *resTemplate, GrResolution *output );
738 FX_ENTRY FxBool FX_CALL
739 grReset( FxU32 what );
741 FX_ENTRY GrProc FX_CALL
742 grGetProcAddress( char *procName );
744 FX_ENTRY void FX_CALL
745 grEnable( GrEnableMode_t mode );
747 FX_ENTRY void FX_CALL
748 grDisable( GrEnableMode_t mode );
750 FX_ENTRY void FX_CALL
751 grCoordinateSpace( GrCoordinateSpaceMode_t mode );
753 FX_ENTRY void FX_CALL
754 grDepthRange( FxFloat n, FxFloat f );
756 FX_ENTRY void FX_CALL
757 grStippleMode( GrStippleMode_t mode );
759 FX_ENTRY void FX_CALL
760 grStipplePattern( GrStipplePattern_t mode );
762 FX_ENTRY void FX_CALL
763 grViewport( FxI32 x, FxI32 y, FxI32 width, FxI32 height );
766 ** texture mapping control functions
768 FX_ENTRY FxU32 FX_CALL
769 grTexCalcMemRequired(
770 GrLOD_t lodmin, GrLOD_t lodmax,
771 GrAspectRatio_t aspect, GrTextureFormat_t fmt);
773 FX_ENTRY FxU32 FX_CALL
774 grTexTextureMemRequired( FxU32 evenOdd,
777 FX_ENTRY FxU32 FX_CALL
778 grTexMinAddress( GrChipID_t tmu );
780 FX_ENTRY FxU32 FX_CALL
781 grTexMaxAddress( GrChipID_t tmu );
783 FX_ENTRY void FX_CALL
784 grTexNCCTable( GrNCCTable_t table );
786 FX_ENTRY void FX_CALL
787 grTexSource( GrChipID_t tmu,
792 FX_ENTRY void FX_CALL
795 GrTextureClampMode_t s_clampmode,
796 GrTextureClampMode_t t_clampmode
799 FX_ENTRY void FX_CALL
802 GrCombineFunction_t rgb_function,
803 GrCombineFactor_t rgb_factor,
804 GrCombineFunction_t alpha_function,
805 GrCombineFactor_t alpha_factor,
810 FX_ENTRY void FX_CALL
818 FX_ENTRY void FX_CALL
821 GrTextureFilterMode_t minfilter_mode,
822 GrTextureFilterMode_t magfilter_mode
826 FX_ENTRY void FX_CALL
827 grTexLodBiasValue(GrChipID_t tmu, float bias );
829 FX_ENTRY void FX_CALL
830 grTexDownloadMipMap( GrChipID_t tmu,
835 FX_ENTRY void FX_CALL
836 grTexDownloadMipMapLevel( GrChipID_t tmu,
840 GrAspectRatio_t aspectRatio,
841 GrTextureFormat_t format,
845 FX_ENTRY FxBool FX_CALL
846 grTexDownloadMipMapLevelPartial( GrChipID_t tmu,
850 GrAspectRatio_t aspectRatio,
851 GrTextureFormat_t format,
857 FX_ENTRY void FX_CALL
858 grTexDownloadTable( GrTexTable_t type,
861 FX_ENTRY void FX_CALL
862 grTexDownloadTablePartial( GrTexTable_t type,
867 FX_ENTRY void FX_CALL
868 grTexMipMapMode( GrChipID_t tmu,
872 FX_ENTRY void FX_CALL
873 grTexMultibase( GrChipID_t tmu,
876 FX_ENTRY void FX_CALL
877 grTexMultibaseAddress( GrChipID_t tmu,
878 GrTexBaseRange_t range,
884 ** linear frame buffer functions
887 FX_ENTRY FxBool FX_CALL
888 grLfbLock( GrLock_t type, GrBuffer_t buffer, GrLfbWriteMode_t writeMode,
889 GrOriginLocation_t origin, FxBool pixelPipeline,
892 FX_ENTRY FxBool FX_CALL
893 grLfbUnlock( GrLock_t type, GrBuffer_t buffer );
895 FX_ENTRY void FX_CALL
896 grLfbConstantAlpha( GrAlpha_t alpha );
898 FX_ENTRY void FX_CALL
899 grLfbConstantDepth( FxU32 depth );
901 FX_ENTRY void FX_CALL
902 grLfbWriteColorSwizzle(FxBool swizzleBytes, FxBool swapWords);
904 FX_ENTRY void FX_CALL
905 grLfbWriteColorFormat(GrColorFormat_t colorFormat);
907 FX_ENTRY FxBool FX_CALL
908 grLfbWriteRegion( GrBuffer_t dst_buffer,
909 FxU32 dst_x, FxU32 dst_y,
910 GrLfbSrcFmt_t src_format,
911 FxU32 src_width, FxU32 src_height,
912 FxBool pixelPipeline,
913 FxI32 src_stride, void *src_data );
915 FX_ENTRY FxBool FX_CALL
916 grLfbReadRegion( GrBuffer_t src_buffer,
917 FxU32 src_x, FxU32 src_y,
918 FxU32 src_width, FxU32 src_height,
919 FxU32 dst_stride, void *dst_data );
922 ** glide management functions
924 FX_ENTRY void FX_CALL
927 FX_ENTRY void FX_CALL
928 grGlideShutdown( void );
930 FX_ENTRY void FX_CALL
931 grGlideGetState( void *state );
933 FX_ENTRY void FX_CALL
934 grGlideSetState( const void *state );
936 FX_ENTRY void FX_CALL
937 grGlideGetVertexLayout( void *layout );
939 FX_ENTRY void FX_CALL
940 grGlideSetVertexLayout( const void *layout );
942 #endif /* FX_GLIDE_NO_FUNC_PROTO */
948 #include <glideutl.h>
950 #endif /* __GLIDE_H__ */