1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
|
/*
* $RCSfile$
*
* Copyright (c) 2004 Sun Microsystems, Inc. All rights reserved.
*
* Use is subject to license terms.
*
* $Revision$
* $Date$
* $State$
*/
#ifndef _Java3D_gldefs_h_
#define _Java3D_gldefs_h_
/*
* Portions of this code were derived from work done by the Blackdown
* group (www.blackdown.org), who did the initial Linux implementation
* of the Java 3D API.
*/
#include <math.h>
#include <stdlib.h>
#include <string.h>
#if defined(SOLARIS) || defined(__linux__)
#define GLX_GLEXT_PROTOTYPES
#define GLX_GLXEXT_PROTOTYPES
#include <limits.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <GL/gl.h>
#include <GL/glx.h>
#include "gl_1_2.h"
#include "glext.h"
#endif
#ifdef WIN32
#include <windows.h>
#ifndef _WIN32
#define _WIN32
#endif
#define M_PI 3.14159265358979323846
/* Some constant defined in those javax_media_j3d_*.h */
/* TODO: remove those constant when D3D automatically include those *.h files */
#ifdef D3D
/* used in GeometryArrayRetained, execute geometry in by REFERENCE case */
#ifndef javax_media_j3d_GeometryArrayRetained_COORD_FLOAT
#define javax_media_j3d_GeometryArrayRetained_COORD_FLOAT 1L
#endif
#ifndef javax_media_j3d_GeometryArrayRetained_COORD_DOUBLE
#define javax_media_j3d_GeometryArrayRetained_COORD_DOUBLE 2L
#endif
#ifndef javax_media_j3d_GeometryArrayRetained_COLOR_FLOAT
#define javax_media_j3d_GeometryArrayRetained_COLOR_FLOAT 4L
#endif
#ifndef javax_media_j3d_GeometryArrayRetained_COLOR_BYTE
#define javax_media_j3d_GeometryArrayRetained_COLOR_BYTE 8L
#endif
#ifndef javax_media_j3d_GeometryArrayRetained_NORMAL_FLOAT
#define javax_media_j3d_GeometryArrayRetained_NORMAL_FLOAT 16L
#endif
#ifndef javax_media_j3d_GeometryArrayRetained_TEXCOORD_FLOAT
#define javax_media_j3d_GeometryArrayRetained_TEXCOORD_FLOAT 32L
#endif
#endif /* end of ifdef D3D */
#ifndef D3D
#include <GL/gl.h>
#include "gl_1_2.h"
#include "glext.h"
#endif
#endif /* WIN32 */
/* include those .h files generated by javah */
#include "javax_media_j3d_Background.h"
#include "javax_media_j3d_Canvas3D.h"
#include "javax_media_j3d_ColoringAttributes.h"
#include "javax_media_j3d_ColoringAttributesRetained.h"
#include "javax_media_j3d_CompressedGeometryRetained.h"
#include "javax_media_j3d_DepthComponentRetained.h"
#include "javax_media_j3d_DetailTextureImage.h"
#include "javax_media_j3d_DirectionalLightRetained.h"
#include "javax_media_j3d_DisplayListRenderMethod.h"
#include "javax_media_j3d_DrawingSurfaceObjectAWT.h"
#include "javax_media_j3d_ExponentialFogRetained.h"
#include "javax_media_j3d_GeometryRetained.h"
#include "javax_media_j3d_GeometryArray.h"
#include "javax_media_j3d_GeometryArrayRetained.h"
#include "javax_media_j3d_GraphicsContext3D.h"
#include "javax_media_j3d_ImageComponent.h"
#include "javax_media_j3d_ImageComponentRetained.h"
#include "javax_media_j3d_ImageComponent2DRetained.h"
#include "javax_media_j3d_IndexedGeometryArrayRetained.h"
#include "javax_media_j3d_LineAttributes.h"
#include "javax_media_j3d_LineAttributesRetained.h"
#include "javax_media_j3d_LinearFogRetained.h"
#include "javax_media_j3d_MasterControl.h"
#include "javax_media_j3d_Material.h"
#include "javax_media_j3d_MaterialRetained.h"
#include "javax_media_j3d_ModelClipRetained.h"
#include "javax_media_j3d_NativeConfigTemplate3D.h"
#include "javax_media_j3d_NodeRetained.h"
#include "javax_media_j3d_PointAttributesRetained.h"
#include "javax_media_j3d_PointLightRetained.h"
#include "javax_media_j3d_PolygonAttributes.h"
#include "javax_media_j3d_PolygonAttributesRetained.h"
#include "javax_media_j3d_Raster.h"
#include "javax_media_j3d_RasterRetained.h"
#include "javax_media_j3d_Renderer.h"
#include "javax_media_j3d_RenderingAttributes.h"
#include "javax_media_j3d_RenderingAttributesRetained.h"
#include "javax_media_j3d_RenderMolecule.h"
#include "javax_media_j3d_SpotLightRetained.h"
#include "javax_media_j3d_TexCoordGeneration.h"
#include "javax_media_j3d_TexCoordGenerationRetained.h"
#include "javax_media_j3d_Texture.h"
#include "javax_media_j3d_Texture2D.h"
#include "javax_media_j3d_Texture2DRetained.h"
#include "javax_media_j3d_Texture3DRetained.h"
#include "javax_media_j3d_TextureAttributes.h"
#include "javax_media_j3d_TextureAttributesRetained.h"
#include "javax_media_j3d_TextureCubeMapRetained.h"
#include "javax_media_j3d_TextureRetained.h"
#include "javax_media_j3d_TextureUnitStateRetained.h"
#include "javax_media_j3d_TransparencyAttributes.h"
#include "javax_media_j3d_TransparencyAttributesRetained.h"
#ifndef GL_SUNX_geometry_compression
#define GL_COMPRESSED_GEOM_ACCELERATED_SUNX 0x81D0
#endif /* GL_SUNX_geometry_compression */
/*
* Define these constants here as a workaround for conflicting
* glext.h files between Mesa and Solaris
*/
#ifndef GL_CLAMP_TO_BORDER_SGIS
#define GL_CLAMP_TO_BORDER_SGIS 0x812D
#endif
#ifndef GL_VIDEO_RESIZE_COMPENSATION_SUN
#define GL_VIDEO_RESIZE_COMPENSATION_SUN 0x85CD
#endif
/*
* End constant workaround
*/
/* Used to compare floating point values close to 0.0 */
#define J3D_SMALL_FLOAT 0.00001f
/*
* General purpose assertion macro
*/
#define J3D_ASSERT(expr) \
if (!(expr)) { \
fprintf(stderr, \
"\nAssertion failed in module '%s' at line %d\n", \
__FILE__, __LINE__); \
fprintf(stderr, "\t%s\n\n", #expr); \
}
#define EPSILON 1e-2
#define J3D_FNE(a,b) ((a)>((b)+EPSILON)||(a)<((b)-EPSILON))
/*
* Macro to copy and transpose one matrix to another.
*
* NOTE: the source and dest must not be the same (no aliasing check
* is performed).
*/
#define COPY_TRANSPOSE(src,dst) { \
(dst)[0] = (src)[0]; \
(dst)[1] = (src)[4]; \
(dst)[2] = (src)[8]; \
(dst)[3] = (src)[12]; \
(dst)[4] = (src)[1]; \
(dst)[5] = (src)[5]; \
(dst)[6] = (src)[9]; \
(dst)[7] = (src)[13]; \
(dst)[8] = (src)[2]; \
(dst)[9] = (src)[6]; \
(dst)[10] = (src)[10]; \
(dst)[11] = (src)[14]; \
(dst)[12] = (src)[3]; \
(dst)[13] = (src)[7]; \
(dst)[14] = (src)[11]; \
(dst)[15] = (src)[15]; \
}
/*
* These match the constants in GeometryRetained
*/
#define GEO_TYPE_NONE javax_media_j3d_GeometryRetained_GEO_TYPE_NONE
#define GEO_TYPE_QUAD_SET javax_media_j3d_GeometryRetained_GEO_TYPE_QUAD_SET
#define GEO_TYPE_TRI_SET javax_media_j3d_GeometryRetained_GEO_TYPE_TRI_SET
#define GEO_TYPE_POINT_SET javax_media_j3d_GeometryRetained_GEO_TYPE_POINT_SET
#define GEO_TYPE_LINE_SET javax_media_j3d_GeometryRetained_GEO_TYPE_LINE_SET
#define GEO_TYPE_TRI_STRIP_SET javax_media_j3d_GeometryRetained_GEO_TYPE_TRI_STRIP_SET
#define GEO_TYPE_TRI_FAN_SET javax_media_j3d_GeometryRetained_GEO_TYPE_TRI_FAN_SET
#define GEO_TYPE_LINE_STRIP_SET javax_media_j3d_GeometryRetained_GEO_TYPE_LINE_STRIP_SET
#define GEO_TYPE_INDEXED_QUAD_SET javax_media_j3d_GeometryRetained_GEO_TYPE_INDEXED_QUAD_SET
#define GEO_TYPE_INDEXED_TRI_SET javax_media_j3d_GeometryRetained_GEO_TYPE_INDEXED_TRI_SET
#define GEO_TYPE_INDEXED_POINT_SET javax_media_j3d_GeometryRetained_GEO_TYPE_INDEXED_POINT_SET
#define GEO_TYPE_INDEXED_LINE_SET javax_media_j3d_GeometryRetained_GEO_TYPE_INDEXED_LINE_SET
#define GEO_TYPE_INDEXED_TRI_STRIP_SET javax_media_j3d_GeometryRetained_GEO_TYPE_INDEXED_TRI_STRIP_SET
#define GEO_TYPE_INDEXED_TRI_FAN_SET javax_media_j3d_GeometryRetained_GEO_TYPE_INDEXED_TRI_FAN_SET
#define GEO_TYPE_INDEXED_LINE_STRIP_SET javax_media_j3d_GeometryRetained_GEO_TYPE_INDEXED_LINE_STRIP_SET
#define GEO_TYPE_RASTER javax_media_j3d_GeometryRetained_GEO_TYPE_RASTER
#define GEO_TYPE_TEXT3D javax_media_j3d_GeometryRetained_GEO_TYPE_TEXT3D
#define GEO_TYPE_COMPRESSED javax_media_j3d_GeometryRetained_GEO_TYPE_COMPRESSED
#define GEO_TYPE_TOTAL javax_media_j3d_GeometryRetained_GEO_TYPE_TOTAL
/*
* These match the constants in ImageComponent
*/
#define FORMAT_RGB javax_media_j3d_ImageComponent_FORMAT_RGB
#define FORMAT_RGBA javax_media_j3d_ImageComponent_FORMAT_RGBA
#define FORMAT_RGB5 javax_media_j3d_ImageComponent_FORMAT_RGB5
#define FORMAT_RGB5_A1 javax_media_j3d_ImageComponent_FORMAT_RGB5_A1
#define FORMAT_RGB4 javax_media_j3d_ImageComponent_FORMAT_RGB4
#define FORMAT_RGBA4 javax_media_j3d_ImageComponent_FORMAT_RGBA4
#define FORMAT_LUM4_ALPHA4 javax_media_j3d_ImageComponent_FORMAT_LUM4_ALPHA4
#define FORMAT_LUM8_ALPHA8 javax_media_j3d_ImageComponent_FORMAT_LUM8_ALPHA8
#define FORMAT_R3_G3_B2 javax_media_j3d_ImageComponent_FORMAT_R3_G3_B2
#define FORMAT_CHANNEL8 javax_media_j3d_ImageComponent_FORMAT_CHANNEL8
/* now the imagecomponent formats are reduced the ones below */
#define FORMAT_BYTE_RGBA javax_media_j3d_ImageComponentRetained_BYTE_RGBA
#define FORMAT_BYTE_ABGR javax_media_j3d_ImageComponentRetained_BYTE_ABGR
#define FORMAT_BYTE_GRAY javax_media_j3d_ImageComponentRetained_BYTE_GRAY
#define FORMAT_USHORT_GRAY javax_media_j3d_ImageComponentRetained_USHORT_GRAY
#define FORMAT_BYTE_LA javax_media_j3d_ImageComponentRetained_BYTE_LA
#define FORMAT_BYTE_BGR javax_media_j3d_ImageComponentRetained_BYTE_BGR
#define FORMAT_BYTE_RGB javax_media_j3d_ImageComponentRetained_BYTE_RGB
/* These match the definitions in GeometryArray.java */
/* These have a GA prefix to avoid confusion with TEXTURE_COORDINATE_2 above */
#define GA_COORDINATES javax_media_j3d_GeometryArray_COORDINATES
#define GA_NORMALS javax_media_j3d_GeometryArray_NORMALS
#define GA_COLOR javax_media_j3d_GeometryArray_COLOR
#define GA_WITH_ALPHA javax_media_j3d_GeometryArray_WITH_ALPHA
#define GA_TEXTURE_COORDINATE_2 javax_media_j3d_GeometryArray_TEXTURE_COORDINATE_2
#define GA_TEXTURE_COORDINATE_3 javax_media_j3d_GeometryArray_TEXTURE_COORDINATE_3
#define GA_TEXTURE_COORDINATE_4 javax_media_j3d_GeometryArray_TEXTURE_COORDINATE_4
#define GA_TEXTURE_COORDINATE javax_media_j3d_GeometryArray_TEXTURE_COORDINATE
#define GA_BY_REFERENCE javax_media_j3d_GeometryArray_BY_REFERENCE
/*
* These match the constants in NativeConfigTemplate3D
*/
#define RED_SIZE javax_media_j3d_NativeConfigTemplate3D_RED_SIZE
#define GREEN_SIZE javax_media_j3d_NativeConfigTemplate3D_GREEN_SIZE
#define BLUE_SIZE javax_media_j3d_NativeConfigTemplate3D_BLUE_SIZE
#define ALPHA_SIZE javax_media_j3d_NativeConfigTemplate3D_ALPHA_SIZE
#define ACCUM_BUFFER javax_media_j3d_NativeConfigTemplate3D_ACCUM_BUFFER
#define DEPTH_SIZE javax_media_j3d_NativeConfigTemplate3D_DEPTH_SIZE
/* this maps to GLX_ACCUM_RED, */
/* GLX_ACCUM_GREEN and */
/* GLX_ACCUM_BLUE so NUM_ITEMS */
/* must be incremented by 3 for */
/* this attribute. */
#define DOUBLEBUFFER javax_media_j3d_NativeConfigTemplate3D_DOUBLEBUFFER
#define STEREO javax_media_j3d_NativeConfigTemplate3D_STEREO
#define ANTIALIASING javax_media_j3d_NativeConfigTemplate3D_ANTIALIASING
/* set this to the number of indices (from above) */
#define NUM_ITEMS (javax_media_j3d_NativeConfigTemplate3D_NUM_ITEMS + 2)
/* total + 2 beacause of */
/* DEPTH_SIZE */
/* values for "enum" entries for GraphicsConfiguration */
#define REQUIRED 1
#define PREFERRED 2
#define UNNECESSARY 3
#define INTENSITY javax_media_j3d_Texture_INTENSITY
#define LUMINANCE javax_media_j3d_Texture_LUMINANCE
#define ALPHA javax_media_j3d_Texture_ALPHA
#define LUMINANCE_ALPHA javax_media_j3d_Texture_LUMINANCE_ALPHA
#define J3D_RGB javax_media_j3d_Texture_RGB
#define J3D_RGBA javax_media_j3d_Texture_RGBA
#ifndef D3D
#if defined(SOLARIS) || defined(__linux__)
extern void APIENTRY glBlendColor (GLclampf, GLclampf, GLclampf, GLclampf);
extern void APIENTRY glBlendColorEXT (GLclampf, GLclampf, GLclampf, GLclampf);
extern void APIENTRY glColorTable (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
extern void APIENTRY glColorTableSGI (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *);
extern void APIENTRY glGetColorTableParameterivSGI (GLenum, GLenum, GLint *);
extern void APIENTRY glGetColorTableParameterfv (GLenum, GLenum, GLfloat *);
extern void APIENTRY glMultiDrawArraysEXT (GLenum, GLint *, GLsizei *, GLsizei);
extern void APIENTRY glMultiDrawArraysSUN (GLenum, GLint *, GLsizei *, GLsizei);
extern void APIENTRY glMultiDrawElementsEXT (GLenum, GLsizei *, GLenum, const GLvoid**, GLsizei);
extern void APIENTRY glMultiDrawElementsSUN (GLenum, GLsizei *, GLenum, const GLvoid**, GLsizei);
extern void APIENTRY glLockArraysEXT (GLint first, GLsizei count);
extern void APIENTRY glUnlockArraysEXT (void);
extern void APIENTRY glClientActiveTextureARB (GLenum);
extern void APIENTRY glMultiTexCoord2fvARB (GLenum, const GLfloat *);
extern void APIENTRY glMultiTexCoord3fvARB (GLenum, const GLfloat *);
extern void APIENTRY glMultiTexCoord4fvARB (GLenum, const GLfloat *);
extern void APIENTRY glGlobalAlphaFactorfSUN (GLfloat);
extern void APIENTRY glLoadTransposeMatrixdARB (const GLdouble *);
extern void APIENTRY glMultTransposeMatrixdARB (const GLdouble *);
extern void APIENTRY glActiveTextureARB (GLenum);
extern void APIENTRY glSharpenTexFuncSGIS(GLenum, GLsizei, const GLfloat *);
extern void APIENTRY glDetailTexFuncSGIS(GLenum, GLsizei, const GLfloat *);
extern void APIENTRY glTexFilterFuncSGIS(GLenum, GLenum, GLsizei, const GLfloat *);
extern void APIENTRY glCombinerInputNV (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum);
extern void APIENTRY glCombinerOutputNV (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLboolean, GLboolean, GLboolean);
extern void APIENTRY glFinalCombinerInputNV (GLenum, GLenum, GLenum, GLenum);
extern void APIENTRY glCombinerParameterfvNV (GLenum, const GLfloat *);
extern void APIENTRY glCombinerParameterivNV (GLenum, const GLint *);
extern void APIENTRY glCombinerParameterfNV (GLenum, GLfloat);
extern void APIENTRY glCombinerParameteriNV (GLenum, GLint);
extern void APIENTRY glTexImage3DEXT (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
extern void APIENTRY glTexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
#ifndef GLX_SUN_video_resize
#define GLX_SUN_video_resize 1
extern int glXVideoResizeSUN( Display *, GLXDrawable, float);
extern int glXgetVideoResizeSUN( Display *, GLXDrawable, float *);
#endif
#pragma weak glXVideoResizeSUN
#pragma weak glBlendColor
#pragma weak glBlendColorEXT
#pragma weak glColorTable
#pragma weak glColorTableSGI
#pragma weak glGetColorTableParameterivSGI
#pragma weak glGetColorTableParameteriv
#pragma weak glMultiDrawArraysSUN
#pragma weak glMultiDrawArraysEXT
#pragma weak glMultiDrawElementsSUN
#pragma weak glMultiDrawElementsEXT
#pragma weak glLockArraysEXT
#pragma weak glUnlockArraysEXT
#pragma weak glClientActiveTextureARB
#pragma weak glMultiTexCoord2fvARB
#pragma weak glMultiTexCoord3fvARB
#pragma weak glMultiTexCoord4fvARB
#pragma weak glGlobalAlphaFactorfSUN
#pragma weak glLoadTransposeMatrixdARB
#pragma weak glMultTransposeMatrixdARB
#pragma weak glActiveTextureARB
#pragma weak glCombinerInputNV
#pragma weak glCombinerOutputNV
#pragma weak glFinalCombinerInputNV
#pragma weak glCombinerParameterfvNV
#pragma weak glCombinerParameterivNV
#pragma weak glCombinerParameterfNV
#pragma weak glCombinerParameteriNV
#pragma weak glSharpenTexFuncSGIS
#pragma weak glDetailTexFuncSGIS
#pragma weak glTexFilterFuncSGIS
/* [jk] mostly needed by older NVIDIA drivers */
#pragma weak glTexImage3DEXT
#pragma weak glTexSubImage3DEXT
#pragma weak glTexImage3D
#pragma weak glTexSubImage3D
#endif /* SOLARIS */
#ifndef APIENTRY
#define APIENTRY
#endif
#ifdef WIN32
/* declare function prototype for WGL related functions*/
typedef const char * (APIENTRY * PFNWGLGETEXTENSIONSSTRINGEXTPROC) (HDC hdc);
typedef BOOL (APIENTRY * PFNWGLCHOOSEPIXELFORMATEXTPROC)(HDC hdc,
const int *piAttribIList,
const FLOAT *pfAttriFList,
UINT nMaxFormats,
int *piFormats,
UINT *nNumFormats);
typedef BOOL (APIENTRY * PFNWGLGETPIXELFORMATATTRIBIVEXTPROC)(HDC hdc,
int iPixelFormat,
int iLayerPlane,
UINT nAttributes,
const int *piAttributes,
int *piValues);
#endif /* WIN32 */
/* define function prototypes */
typedef void (APIENTRY * MYPFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green,
GLclampf blue, GLclampf alpha);
typedef void (APIENTRY * MYPFNGLBLENDCOLOREXTPROC) (GLclampf red, GLclampf green,
GLclampf blue, GLclampf alpha);
typedef void (APIENTRY * MYPFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
typedef void (APIENTRY * MYPFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
typedef void (APIENTRY * MYPFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table);
typedef void (APIENTRY * MYPFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture);
typedef void (APIENTRY * MYPFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount);
typedef void (APIENTRY * MYPFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum, GLsizei *, GLenum, const GLvoid**, GLsizei);
typedef void (APIENTRY * MYPFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count);
typedef void (APIENTRY * MYPFNGLUNLOCKARRAYSEXTPROC) (void);
typedef void (APIENTRY * MYPFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v);
typedef void (APIENTRY * MYPFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v);
typedef void (APIENTRY * MYPFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v);
typedef void (APIENTRY * MYPFNGLLOADTRANSPOSEMATRIXDARBPROC) (const GLdouble *m);
typedef void (APIENTRY * MYPFNGLMULTTRANSPOSEMATRIXDARBPROC) (const GLdouble *m);
typedef void (APIENTRY * MYPFNGLACTIVETEXTUREARBPROC) (GLenum texture);
typedef void (APIENTRY * MYPFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
typedef void (APIENTRY * MYPFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
typedef void (APIENTRY * MYPFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor);
typedef void (APIENTRY * MYPFNGLCOMBINERINPUTNV) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);
typedef void (APIENTRY * MYPFNGLFINALCOMBINERINPUTNV) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);
typedef void (APIENTRY * MYPFNGLCOMBINEROUTPUTNV) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum);
typedef void (APIENTRY * MYPFNGLCOMBINERPARAMETERFVNV) (GLenum pname, const GLfloat *params);
typedef void (APIENTRY * MYPFNGLCOMBINERPARAMETERIVNV) (GLenum pname, const GLint *params);
typedef void (APIENTRY * MYPFNGLCOMBINERPARAMETERFNV) (GLenum pname, GLfloat param);
typedef void (APIENTRY * MYPFNGLCOMBINERPARAMETERINV) (GLenum pname, GLint param);
typedef void (APIENTRY * MYPFNGLSHARPENTEXFUNCSGI) (GLenum target, GLsizei n, const GLfloat *points);
typedef void (APIENTRY * MYPFNGLDETAILTEXFUNCSGI) (GLenum target, GLsizei n, const GLfloat *points);
typedef void (APIENTRY * MYPFNGLTEXFILTERFUNCSGI) (GLenum target, GLenum filter, GLsizei n, const GLfloat *points);
/* define the structure to hold the properties of graphics context */
typedef struct {
jlong context;
/* version and extension info */
char *versionStr;
char *extensionStr;
int versionNumbers[2];
/* both in 1.2 core part and 1.1 extensions */
/* GL_EXT_rescale_normal or GL_RESCALE_NORMAL */
jboolean rescale_normal_ext;
GLenum rescale_normal_ext_enum;
/* GL_BGR_EXT or GL_BGR */
jboolean bgr_ext;
GLenum bgr_ext_enum;
/* GL_EXT_texture3D or GL_TEXTURE3D */
jboolean texture3DAvailable;
GLenum texture_3D_ext_enum;
GLenum texture_wrap_r_ext_enum;
/* GL_ARB_imaging subset */
/* GL_EXT_blend_color or GL_BLEND_COLOR */
jboolean blend_color_ext;
GLenum blendFunctionTable[8];
/* GL_SGI_color_table or GL_COLOR_TABLE */
jboolean color_table_ext;
/* GL_EXT_separate_specular_color */
jboolean seperate_specular_color;
GLenum light_model_color_control_enum;
GLenum single_color_enum;
GLenum seperate_specular_color_enum;
/* GL_CLAMP_TO_EDGE or GL_EXT_texture_edge_clamp or
GL_SGIS_texture_edge_clamp */
GLenum texture_clamp_to_edge_enum;
/* GL_SGIS_texture_lod */
jboolean textureLodAvailable;
GLenum texture_min_lod_enum;
GLenum texture_max_lod_enum;
GLenum texture_base_level_enum;
GLenum texture_max_level_enum;
/* ***********1.1 extension or 1.2 extensions ********************/
/* GL_ARB_texture_border_clamp or GL_SGIS_texture_border_clamp */
GLenum texture_clamp_to_border_enum;
/* GL_SUN_multi_draw_arrays */
jboolean multi_draw_arrays_sun;
/* GLX_SUN_video_resize */
jboolean videoResizeAvailable;
/* GL_SUN_global_alpha */
jboolean global_alpha_sun;
/* GL_SUNX_constant_data */
jboolean constant_data_sun;
/* GL_SUNX_geometry_compression */
jboolean geometry_compression_sunx;
/* GL_EXT_abgr */
jboolean abgr_ext;
/* GL_EXT_multi_draw_arrays */
jboolean multi_draw_arrays_ext;
/* GL_EXT_compiled_vertex_array */
jboolean compiled_vertex_array_ext;
/* GL_ARB_transpose_matrix */
jboolean arb_transpose_matrix;
/* GL_ARB_multitexture */
jboolean arb_multitexture;
int textureUnitCount;
/* GL_SGI_texture_color_table */
jboolean textureColorTableAvailable;
int textureColorTableSize;
/* GL_ARB_texture_env_combine */
/* GL_EXT_texture_env_combine */
jboolean textureEnvCombineAvailable;
jboolean textureCombineDot3Available;
jboolean textureCombineSubtractAvailable;
/* GL_NV_register_combiners */
jboolean textureRegisterCombinersAvailable;
GLenum currentTextureUnit;
GLenum currentCombinerUnit;
/* save the enum for the combine modes since the enums between
ARB & EXT might be different.
*/
GLenum combine_enum;
GLenum combine_add_signed_enum;
GLenum combine_interpolate_enum;
GLenum combine_subtract_enum;
GLenum combine_dot3_rgb_enum;
GLenum combine_dot3_rgba_enum;
/* GL_ARB_texture_cube_map */
/* GL_EXT_texture_cube_map */
jboolean textureCubeMapAvailable;
GLenum texture_cube_map_ext_enum;
/* GL_ARB_mulitsample */
jboolean arb_multisample;
/*
By default, full scene antialiasing is disable if
multisampling pixel format (or visual) is chosen.
To honor display driver multisampling antialiasing
setting (e.g. force scene antialiasing), set the
implicit multisample flag to true in this case.
This cause Java3D not to invoke any native
multisampling API to enable/disable scene antialiasing.
*/
jboolean implicit_multisample;
/* GL_SGIS_sharpen_texture */
jboolean textureSharpenAvailable;
GLenum linear_sharpen_enum;
GLenum linear_sharpen_rgb_enum;
GLenum linear_sharpen_alpha_enum;
/* GL_SGIS_detail_texture */
jboolean textureDetailAvailable;
GLenum texture_detail_ext_enum;
GLenum linear_detail_enum;
GLenum linear_detail_rgb_enum;
GLenum linear_detail_alpha_enum;
GLenum texture_detail_mode_enum;
GLenum texture_detail_level_enum;
/* GL_SGIS_texture_filter4 */
jboolean textureFilter4Available;
GLenum filter4_enum;
/* GL_EXT_texture_filter_anisotropic */
jboolean textureAnisotropicFilterAvailable;
GLenum texture_filter_anisotropic_ext_enum;
GLenum max_texture_filter_anisotropy_enum;
/* GL_SGIX_texture_lod_bias */
jboolean textureLodBiasAvailable;
jboolean geometry_compression_accelerated;
int geometry_compression_accelerated_major_version;
int geometry_compression_accelerated_minor_version;
int geometry_compression_accelerated_subminor_version;
/* extension mask */
jint extMask;
jint textureExtMask;
/* function pointers */
MYPFNGLBLENDCOLORPROC glBlendColor;
MYPFNGLBLENDCOLOREXTPROC glBlendColorEXT;
MYPFNGLCOLORTABLEPROC glColorTable;
MYPFNGLGETCOLORTABLEPARAMETERIVPROC glGetColorTableParameteriv;
MYPFNGLTEXIMAGE3DPROC glTexImage3DEXT;
MYPFNGLTEXSUBIMAGE3DPROC glTexSubImage3DEXT;
MYPFNGLCLIENTACTIVETEXTUREARBPROC glClientActiveTextureARB;
MYPFNGLACTIVETEXTUREARBPROC glActiveTextureARB;
MYPFNGLMULTIDRAWARRAYSEXTPROC glMultiDrawArraysEXT;
MYPFNGLMULTIDRAWELEMENTSEXTPROC glMultiDrawElementsEXT;
MYPFNGLLOCKARRAYSEXTPROC glLockArraysEXT;
MYPFNGLUNLOCKARRAYSEXTPROC glUnlockArraysEXT;
MYPFNGLMULTITEXCOORD2FVARBPROC glMultiTexCoord2fvARB;
MYPFNGLMULTITEXCOORD3FVARBPROC glMultiTexCoord3fvARB;
MYPFNGLMULTITEXCOORD4FVARBPROC glMultiTexCoord4fvARB;
MYPFNGLLOADTRANSPOSEMATRIXDARBPROC glLoadTransposeMatrixdARB;
MYPFNGLMULTTRANSPOSEMATRIXDARBPROC glMultTransposeMatrixdARB;
MYPFNGLGLOBALALPHAFACTORFSUNPROC glGlobalAlphaFactorfSUN;
MYPFNGLCOMBINERINPUTNV glCombinerInputNV;
MYPFNGLCOMBINEROUTPUTNV glCombinerOutputNV;
MYPFNGLFINALCOMBINERINPUTNV glFinalCombinerInputNV;
MYPFNGLCOMBINERPARAMETERFVNV glCombinerParameterfvNV;
MYPFNGLCOMBINERPARAMETERIVNV glCombinerParameterivNV;
MYPFNGLCOMBINERPARAMETERFNV glCombinerParameterfNV;
MYPFNGLCOMBINERPARAMETERINV glCombinerParameteriNV;
MYPFNGLSHARPENTEXFUNCSGI glSharpenTexFuncSGIS;
MYPFNGLDETAILTEXFUNCSGI glDetailTexFuncSGIS;
MYPFNGLTEXFILTERFUNCSGI glTexFilterFuncSGIS;
} GraphicsContextPropertiesInfo;
#endif /* J3D_BUILDVERTICES */
#endif /* _Java3D_gldefs_h_ */
|