JOGL v2.6.0-rc-20250706
JOGL, High-Performance Graphics Binding for Java™ (public API).
GLU.java
Go to the documentation of this file.
1/* !---- DO NOT EDIT: This file autogenerated by com/jogamp/gluegen/opengl/GLEmitter.java on Sun Jul 06 17:48:43 CEST 2025 ----! */
2/* !---- Java-Unit: [pkg com.jogamp.opengl.glu, cls GLU], ../build/jogl/gensrc/classes/com/jogamp/opengl/glu/GLU.java ----! */
3
4package com.jogamp.opengl.glu;
5
6import jogamp.opengl.glu.error.Error;
7import jogamp.opengl.glu.registry.Registry;
8import com.jogamp.opengl.*;
9import com.jogamp.opengl.glu.*;
10import com.jogamp.opengl.util.glsl.ShaderState;
11import jogamp.opengl.*;
12import jogamp.opengl.glu.*;
13import jogamp.opengl.glu.tessellator.GLUtessellatorImpl;
14import jogamp.opengl.ProjectFloat;
15import com.jogamp.common.util.ReflectionUtil;
16import java.lang.reflect.*;
17import com.jogamp.gluegen.runtime.*;
18import com.jogamp.common.os.*;
19import com.jogamp.common.nio.*;
20import java.nio.*;
21import com.jogamp.common.util.*;
22import java.util.Set;
23import java.util.Map;
24import java.util.HashMap;
25import java.nio.charset.Charset;
26import java.nio.charset.StandardCharsets;
27
28 /**
29 * Provides access to the OpenGL Utility Library (GLU). This library
30 * provides standard methods for setting up view volumes, building
31 * mipmaps and performing other common operations. The GLU NURBS
32 * routines are not currently exposed.
33 *
34 * <P>
35 *
36 * Notes from the Reference Implementation for this class:
37 * Thanks to the contributions of many individuals, this class is a
38 * pure Java port of SGI's original C sources. All of the projection,
39 * mipmap, scaling, and tessellation routines that are exposed are
40 * compatible with the GLU 1.3 specification. The GLU NURBS routines
41 * are not currently exposed.
42 */
43public class GLU {
44
45 // --- Begin CustomJavaCode .cfg declarations
46 /**
47 * Returns true if the specified GLU core- or extension-function can be
48 * successfully used through this GLU instance. By "successfully" we mean
49 * that the function is both <i>callable</i> on the machine running the
50 * program and <i>available</i> on the current display.<P>
51 *
52 * A GLU function is <i>callable</i> if it is a GLU core- or extension-function
53 * that is supported by the underlying GLU implementation. The function is
54 * <i>available</i> if the OpenGL implementation on the display meets the
55 * requirements of the GLU function being called (because GLU functions utilize
56 * OpenGL functions). <P>
57 *
58 * Whether or not a GLU function is <i>callable</i> is determined as follows:
59 * <ul>
60 * <li>If the function is a GLU core function (i.e., not an
61 * extension), <code>gluGetString(GLU_VERSION)</code> is used to determine the
62 * version number of the underlying GLU implementation on the host.
63 * then the function name is cross-referenced with that specification to
64 * see if it is part of that version's specification.
65 *
66 * <li> If the function is a GLU extension, the function name is
67 * cross-referenced with the list returned by
68 * <code>gluGetString(GLU_EXTENSIONS)</code> to see if the function is one of
69 * the extensions that is supported by the underlying GLU implementation.
70 * </ul>
71 *
72 * Whether or not a GLU function is <i>available</i> is determined as follows:
73 * <ul>
74 * <li>If the function is a GLU core function then the function is first
75 * cross-referenced with the GLU specifications to find the minimum GLU
76 * version required to <i>call</i> that GLU function. Then the following table
77 * is consulted to determine the minimum GL version required for that version
78 * of GLU:
79 * <ul>
80 * <li> GLU 1.0 requires OpenGL 1.0
81 * <li> GLU 1.1 requires OpenGL 1.0
82 * <li> GLU 1.2 requires OpenGL 1.1
83 * <li> GLU 1.3 requires OpenGL 1.2
84 * </ul>
85 * Finally, <code>glGetString(GL_VERSION)</code> is used to determine the
86 * highest OpenGL version that both host and display support, and from that it
87 * is possible to determine if the GL facilities required by the GLU function
88 * are <i>available</i> on the display.
89 *
90 * <li> If the function is a GLU extension, the function name is
91 * cross-referenced with the list returned by
92 * <code>gluGetString(GLU_EXTENSIONS)</code> to see if the function is one of
93 * the extensions that is supported by the underlying GLU implementation.
94 * </ul>
95 *
96 * <b>NOTE:</b>The availability of a function may change at runtime in
97 * response to changes in the display environment. For example, when a window
98 * is dragged from one display to another on a multi-display system, or when
99 * the properties of the display device are modified (e.g., changing the color
100 * depth of the display). Any application that is concerned with handling
101 * these situations correctly should confirm availability after a display
102 * change before calling a questionable OpenGL function. To detect a change in
103 * the display device, please see {@link
104 * GLEventListener#displayChanged(GLAutoDrawable,boolean,boolean)}.
105 *
106 * @param gluFunctionName the name of the OpenGL function (e.g., use
107 * "gluNurbsCallbackDataEXT" to check if the <code>
108 * gluNurbsCallbackDataEXT(GLUnurbs, GLvoid)</code> extension is available).
109 */
110 public boolean isFunctionAvailable(String gluFunctionName)
111 {
112 // if (useJavaMipmapCode) {
113 // All GLU functions are available in Java port
114 return true;
115 // }
116 // return (gluProcAddressTable.getAddressFor(gluFunctionName) != 0);
117 }
118
119
120 //----------------------------------------------------------------------
121 // Utility routines
122 //
123
124 private static final Class gl2Class;
125 private static final Class gl2es1Class;
126
127 static {
128 Class _gl2Class=null;
129 Class _gl2es1Class=null;
130 try {
131 final ClassLoader cl = GLU.class.getClassLoader();
132 _gl2Class = Class.forName("com.jogamp.opengl.glu.gl2.GLUgl2", false, cl);
133 _gl2es1Class = Class.forName("com.jogamp.opengl.glu.gl2es1.GLUgl2es1", false, cl);
134 } catch (Throwable t) {}
135 gl2Class = _gl2Class;
136 gl2es1Class = _gl2es1Class;
137 /** Not required nor forced
138 if( !initializeImpl() ) {
139 throw new RuntimeException("Initialization failure");
140 } */
141 }
142
143 /**
144 * Instantiates a GLU implementation object in respect to the given GL profile
145 * of this thread current GL.
146 */
147 public static final GLU createGLU() throws GLException {
148 return createGLU(getCurrentGL());
149 }
150
151 /**
152 * Instantiates a GLU implementation object in respect to the given GL profile
153 * of the given GL.
154 */
155 public static final GLU createGLU(GL gl) throws GLException {
156 try {
157 Class c = null;
158 if(gl.isGL2() && null!=gl2Class) {
159 c = gl2Class;
160 } else if(gl.isGL2ES1() && null!=gl2es1Class) {
161 c = gl2es1Class;
162 /** There is no specialized ES 2 GLU at this time
163 } else if(gl.isGL2ES2() && null!=gl2es2Class) {
164 c = gl2es2Class; */
165 } else {
166 c = GLU.class;
167 }
168 return (GLU) c.newInstance();
169 } catch (Exception e) {
170 throw new GLException(e);
171 }
172 }
173
174 public GLU()
175 {
176 project = new ProjectFloat();
177 }
178
179 public static final GL getCurrentGL() throws GLException {
180 GLContext curContext = GLContext.getCurrent();
181 if (curContext == null) {
182 throw new GLException("No OpenGL context current on this thread");
183 }
184 return curContext.getGL();
185 }
186
187 public final String gluErrorString(int errorCode) {
188 return Error.gluErrorString(errorCode);
189 }
190
191 /* extName is an extension name.
192 * extString is a string of extensions separated by blank(s). There may or
193 * may not be leading or trailing blank(s) in extString.
194 * This works in cases of extensions being prefixes of another like
195 * GL_EXT_texture and GL_EXT_texture3D.
196 * Returns true if extName is found otherwise it returns false.
197 */
198 public final boolean gluCheckExtension(java.lang.String extName, java.lang.String extString) {
199 return Registry.gluCheckExtension(extName, extString);
200 }
201
202 public final String gluGetString(int name) {
203 return Registry.gluGetString(name);
204 }
205
206 //----------------------------------------------------------------------
207 // Tessellation routines
208 //
209
210 protected static boolean availableGLUtessellatorImpl = false;
211 protected static boolean checkedGLUtessellatorImpl = false;
212
213 protected static final void validateGLUtessellatorImpl() {
215 availableGLUtessellatorImpl = ReflectionUtil.isClassAvailable("jogamp.opengl.glu.tessellator.GLUtessellatorImpl", GLU.class.getClassLoader());
217 }
219 throw new GLException("GLUtessellator not available (GLUtessellatorImpl)");
220 }
221 }
222
223 /*****************************************************************************
224 * <b>gluNewTess</b> creates and returns a new tessellation object. This
225 * object must be referred to when calling tesselation methods. A return
226 * value of null means that there was not enough memeory to allocate the
227 * object.
228 *
229 * Optional, throws GLException if not available in profile
230 *
231 * @return A new tessellation object.
232 *
233 * @see #gluTessBeginPolygon gluTessBeginPolygon
234 * @see #gluDeleteTess gluDeleteTess
235 * @see #gluTessCallback gluTessCallback
236 ****************************************************************************/
237 public static final GLUtessellator gluNewTess() {
239 return GLUtessellatorImpl.gluNewTess();
240 }
241
242 /*****************************************************************************
243 * <b>gluDeleteTess</b> destroys the indicated tessellation object (which was
244 * created with {@link #gluNewTess gluNewTess}).
245 *
246 * Optional, throws GLException if not available in profile
247 *
248 * @param tessellator
249 * Specifies the tessellation object to destroy.
250 *
251 * @see #gluBeginPolygon gluBeginPolygon
252 * @see #gluNewTess gluNewTess
253 * @see #gluTessCallback gluTessCallback
254 ****************************************************************************/
255 public static final void gluDeleteTess(GLUtessellator tessellator) {
257 GLUtessellatorImpl tess = (GLUtessellatorImpl) tessellator;
258 tess.gluDeleteTess();
259 }
260
261 /*****************************************************************************
262 * <b>gluTessProperty</b> is used to control properites stored in a
263 * tessellation object. These properties affect the way that the polygons are
264 * interpreted and rendered. The legal value for <i>which</i> are as
265 * follows:<P>
266 *
267 * Optional, throws GLException if not available in profile
268 *
269 * <b>GLU_TESS_WINDING_RULE</b>
270 * <UL>
271 * Determines which parts of the polygon are on the "interior".
272 * <em>value</em> may be set to one of
273 * <BR><b>GLU_TESS_WINDING_ODD</b>,
274 * <BR><b>GLU_TESS_WINDING_NONZERO</b>,
275 * <BR><b>GLU_TESS_WINDING_POSITIVE</b>, or
276 * <BR><b>GLU_TESS_WINDING_NEGATIVE</b>, or
277 * <BR><b>GLU_TESS_WINDING_ABS_GEQ_TWO</b>.<P>
278 *
279 * To understand how the winding rule works, consider that the input
280 * contours partition the plane into regions. The winding rule determines
281 * which of these regions are inside the polygon.<P>
282 *
283 * For a single contour C, the winding number of a point x is simply the
284 * signed number of revolutions we make around x as we travel once around C
285 * (where CCW is positive). When there are several contours, the individual
286 * winding numbers are summed. This procedure associates a signed integer
287 * value with each point x in the plane. Note that the winding number is
288 * the same for all points in a single region.<P>
289 *
290 * The winding rule classifies a region as "inside" if its winding number
291 * belongs to the chosen category (odd, nonzero, positive, negative, or
292 * absolute value of at least two). The previous GLU tessellator (prior to
293 * GLU 1.2) used the "odd" rule. The "nonzero" rule is another common way
294 * to define the interior. The other three rules are useful for polygon CSG
295 * operations.
296 * </UL>
297 * <BR><b>GLU_TESS_BOUNDARY_ONLY</b>
298 * <UL>
299 * Is a boolean value ("value" should be set to GL_TRUE or GL_FALSE). When
300 * set to GL_TRUE, a set of closed contours separating the polygon interior
301 * and exterior are returned instead of a tessellation. Exterior contours
302 * are oriented CCW with respect to the normal; interior contours are
303 * oriented CW. The <b>GLU_TESS_BEGIN</b> and <b>GLU_TESS_BEGIN_DATA</b>
304 * callbacks use the type GL_LINE_LOOP for each contour.
305 * </UL>
306 * <BR><b>GLU_TESS_TOLERANCE</b>
307 * <UL>
308 * Specifies a tolerance for merging features to reduce the size of the
309 * output. For example, two vertices that are very close to each other
310 * might be replaced by a single vertex. The tolerance is multiplied by the
311 * largest coordinate magnitude of any input vertex; this specifies the
312 * maximum distance that any feature can move as the result of a single
313 * merge operation. If a single feature takes part in several merge
314 * operations, the toal distance moved could be larger.<P>
315 *
316 * Feature merging is completely optional; the tolerance is only a hint.
317 * The implementation is free to merge in some cases and not in others, or
318 * to never merge features at all. The initial tolerance is 0.<P>
319 *
320 * The current implementation merges vertices only if they are exactly
321 * coincident, regardless of the current tolerance. A vertex is spliced
322 * into an edge only if the implementation is unable to distinguish which
323 * side of the edge the vertex lies on. Two edges are merged only when both
324 * endpoints are identical.
325 * </UL>
326 *
327 * @param tessellator
328 * Specifies the tessellation object created with
329 * {@link #gluNewTess gluNewTess}
330 * @param which
331 * Specifies the property to be set. Valid values are
332 * <b>GLU_TESS_WINDING_RULE</b>, <b>GLU_TESS_BOUNDARDY_ONLY</b>,
333 * <b>GLU_TESS_TOLERANCE</b>.
334 * @param value
335 * Specifices the value of the indicated property.
336 *
337 * @see #gluGetTessProperty gluGetTessProperty
338 * @see #gluNewTess gluNewTess
339 ****************************************************************************/
340 public static final void gluTessProperty(GLUtessellator tessellator, int which, double value) {
342 GLUtessellatorImpl tess = (GLUtessellatorImpl) tessellator;
343 tess.gluTessProperty(which, value);
344 }
345
346 /*****************************************************************************
347 * <b>gluGetTessProperty</b> retrieves properties stored in a tessellation
348 * object. These properties affect the way that tessellation objects are
349 * interpreted and rendered. See the
350 * {@link #gluTessProperty gluTessProperty} reference
351 * page for information about the properties and what they do.
352 *
353 * Optional, throws GLException if not available in profile
354 *
355 * @param tessellator
356 * Specifies the tessellation object (created with
357 * {@link #gluNewTess gluNewTess}).
358 * @param which
359 * Specifies the property whose value is to be fetched. Valid values
360 * are <b>GLU_TESS_WINDING_RULE</b>, <b>GLU_TESS_BOUNDARY_ONLY</b>,
361 * and <b>GLU_TESS_TOLERANCES</b>.
362 * @param value
363 * Specifices an array into which the value of the named property is
364 * written.
365 *
366 * @see #gluNewTess gluNewTess
367 * @see #gluTessProperty gluTessProperty
368 ****************************************************************************/
369 public static final void gluGetTessProperty(GLUtessellator tessellator, int which, double[] value, int value_offset) {
371 GLUtessellatorImpl tess = (GLUtessellatorImpl) tessellator;
372 tess.gluGetTessProperty(which, value, value_offset);
373 }
374
375 /*****************************************************************************
376 * <b>gluTessNormal</b> describes a normal for a polygon that the program is
377 * defining. All input data will be projected onto a plane perpendicular to
378 * the one of the three coordinate axes before tessellation and all output
379 * triangles will be oriented CCW with repsect to the normal (CW orientation
380 * can be obtained by reversing the sign of the supplied normal). For
381 * example, if you know that all polygons lie in the x-y plane, call
382 * <b>gluTessNormal</b>(tess, 0.0, 0.0, 0.0) before rendering any polygons.<P>
383 *
384 * If the supplied normal is (0.0, 0.0, 0.0)(the initial value), the normal
385 * is determined as follows. The direction of the normal, up to its sign, is
386 * found by fitting a plane to the vertices, without regard to how the
387 * vertices are connected. It is expected that the input data lies
388 * approximately in the plane; otherwise, projection perpendicular to one of
389 * the three coordinate axes may substantially change the geometry. The sign
390 * of the normal is chosen so that the sum of the signed areas of all input
391 * contours is nonnegative (where a CCW contour has positive area).<P>
392 *
393 * The supplied normal persists until it is changed by another call to
394 * <b>gluTessNormal</b>.
395 *
396 * Optional, throws GLException if not available in profile
397 *
398 * @param tessellator
399 * Specifies the tessellation object (created by
400 * {@link #gluNewTess gluNewTess}).
401 * @param x
402 * Specifies the first component of the normal.
403 * @param y
404 * Specifies the second component of the normal.
405 * @param z
406 * Specifies the third component of the normal.
407 *
408 * @see #gluTessBeginPolygon gluTessBeginPolygon
409 * @see #gluTessEndPolygon gluTessEndPolygon
410 ****************************************************************************/
411 public static final void gluTessNormal(GLUtessellator tessellator, double x, double y, double z) {
413 GLUtessellatorImpl tess = (GLUtessellatorImpl) tessellator;
414 tess.gluTessNormal(x, y, z);
415 }
416
417 /*****************************************************************************
418 * <b>gluTessCallback</b> is used to indicate a callback to be used by a
419 * tessellation object. If the specified callback is already defined, then it
420 * is replaced. If <i>aCallback</i> is null, then the existing callback
421 * becomes undefined.<P>
422 *
423 * Optional, throws GLException if not available in profile
424 *
425 * These callbacks are used by the tessellation object to describe how a
426 * polygon specified by the user is broken into triangles. Note that there are
427 * two versions of each callback: one with user-specified polygon data and one
428 * without. If both versions of a particular callback are specified, then the
429 * callback with user-specified polygon data will be used. Note that the
430 * polygonData parameter used by some of the methods is a copy of the
431 * reference that was specified when
432 * {@link #gluTessBeginPolygon gluTessBeginPolygon}
433 * was called. The legal callbacks are as follows:<P>
434 *
435 * <b>GLU_TESS_BEGIN</b>
436 * <UL>
437 * The begin callback is invoked like {@link com.jogamp.opengl.GL#glBegin
438 * glBegin} to indicate the start of a (triangle) primitive. The method
439 * takes a single argument of type int. If the
440 * <b>GLU_TESS_BOUNDARY_ONLY</b> property is set to <b>GL_FALSE</b>, then
441 * the argument is set to either <b>GL_TRIANGLE_FAN</b>,
442 * <b>GL_TRIANGLE_STRIP</b>, or <b>GL_TRIANGLES</b>. If the
443 * <b>GLU_TESS_BOUNDARY_ONLY</b> property is set to <b>GL_TRUE</b>, then the
444 * argument will be set to <b>GL_LINE_LOOP</b>. The method prototype for
445 * this callback is:
446 * </UL>
447 *
448 * <PRE>
449 * void begin(int type);</PRE><P>
450 *
451 * <b>GLU_TESS_BEGIN_DATA</b>
452 * <UL>
453 * The same as the <b>GLU_TESS_BEGIN</b> callback except
454 * that it takes an additional reference argument. This reference is
455 * identical to the opaque reference provided when
456 * {@link #gluTessBeginPolygon gluTessBeginPolygon}
457 * was called. The method prototype for this callback is:
458 * </UL>
459 *
460 * <PRE>
461 * void beginData(int type, Object polygonData);</PRE>
462 *
463 * <b>GLU_TESS_EDGE_FLAG</b>
464 * <UL>
465 * The edge flag callback is similar to
466 * {@link com.jogamp.opengl.GL#glEdgeFlag glEdgeFlag}. The method takes
467 * a single boolean boundaryEdge that indicates which edges lie on the
468 * polygon boundary. If the boundaryEdge is <b>GL_TRUE</b>, then each vertex
469 * that follows begins an edge that lies on the polygon boundary, that is,
470 * an edge that separates an interior region from an exterior one. If the
471 * boundaryEdge is <b>GL_FALSE</b>, then each vertex that follows begins an
472 * edge that lies in the polygon interior. The edge flag callback (if
473 * defined) is invoked before the first vertex callback.<P>
474 *
475 * Since triangle fans and triangle strips do not support edge flags, the
476 * begin callback is not called with <b>GL_TRIANGLE_FAN</b> or
477 * <b>GL_TRIANGLE_STRIP</b> if a non-null edge flag callback is provided.
478 * (If the callback is initialized to null, there is no impact on
479 * performance). Instead, the fans and strips are converted to independent
480 * triangles. The method prototype for this callback is:
481 * </UL>
482 *
483 * <PRE>
484 * void edgeFlag(boolean boundaryEdge);</PRE>
485 *
486 * <b>GLU_TESS_EDGE_FLAG_DATA</b>
487 * <UL>
488 * The same as the <b>GLU_TESS_EDGE_FLAG</b> callback except that it takes
489 * an additional reference argument. This reference is identical to the
490 * opaque reference provided when
491 * {@link #gluTessBeginPolygon gluTessBeginPolygon}
492 * was called. The method prototype for this callback is:
493 * </UL>
494 *
495 * <PRE>
496 * void edgeFlagData(boolean boundaryEdge, Object polygonData);</PRE>
497 *
498 * <b>GLU_TESS_VERTEX</b>
499 * <UL>
500 * The vertex callback is invoked between the begin and end callbacks. It is
501 * similar to {@link com.jogamp.opengl.GL#glVertex3f glVertex3f}, and it
502 * defines the vertices of the triangles created by the tessellation
503 * process. The method takes a reference as its only argument. This
504 * reference is identical to the opaque reference provided by the user when
505 * the vertex was described (see
506 * {@link #gluTessVertex gluTessVertex}). The method
507 * prototype for this callback is:
508 * </UL>
509 *
510 * <PRE>
511 * void vertex(Object vertexData);</PRE>
512 *
513 * <b>GLU_TESS_VERTEX_DATA</b>
514 * <UL>
515 * The same as the <b>GLU_TESS_VERTEX</b> callback except that it takes an
516 * additional reference argument. This reference is identical to the opaque
517 * reference provided when
518 * {@link #gluTessBeginPolygon gluTessBeginPolygon}
519 * was called. The method prototype for this callback is:
520 * </UL>
521 *
522 * <PRE>
523 * void vertexData(Object vertexData, Object polygonData);</PRE>
524 *
525 * <b>GLU_TESS_END</b>
526 * <UL>
527 * The end callback serves the same purpose as
528 * {@link com.jogamp.opengl.GL#glEnd glEnd}. It indicates the end of a
529 * primitive and it takes no arguments. The method prototype for this
530 * callback is:
531 * </UL>
532 *
533 * <PRE>
534 * void end();</PRE>
535 *
536 * <b>GLU_TESS_END_DATA</b>
537 * <UL>
538 * The same as the <b>GLU_TESS_END</b> callback except that it takes an
539 * additional reference argument. This reference is identical to the opaque
540 * reference provided when
541 * {@link #gluTessBeginPolygon gluTessBeginPolygon}
542 * was called. The method prototype for this callback is:
543 * </UL>
544 *
545 * <PRE>
546 * void endData(Object polygonData);</PRE>
547 *
548 * <b>GLU_TESS_COMBINE</b>
549 * <UL>
550 * The combine callback is called to create a new vertex when the
551 * tessellation detects an intersection, or wishes to merge features. The
552 * method takes four arguments: an array of three elements each of type
553 * double, an array of four references, an array of four elements each of
554 * type float, and a reference to a reference. The prototype is:
555 * </UL>
556 *
557 * <PRE>
558 * void combine(double[] coords, Object[] data,
559 * float[] weight, Object[] outData);</PRE>
560 *
561 * <UL>
562 * The vertex is defined as a linear combination of up to four existing
563 * vertices, stored in <i>data</i>. The coefficients of the linear
564 * combination are given by <i>weight</i>; these weights always add up to 1.
565 * All vertex pointers are valid even when some of the weights are 0.
566 * <i>coords</i> gives the location of the new vertex.<P>
567 *
568 * The user must allocate another vertex, interpolate parameters using
569 * <i>data</i> and <i>weight</i>, and return the new vertex pointer
570 * in <i>outData</i>. This handle is supplied during rendering callbacks.
571 * The user is responsible for freeing the memory some time after
572 * {@link #gluTessEndPolygon gluTessEndPolygon} is
573 * called.<P>
574 *
575 * For example, if the polygon lies in an arbitrary plane in 3-space, and a
576 * color is associated with each vertex, the <b>GLU_TESS_COMBINE</b>
577 * callback might look like this:
578 * </UL>
579 * <PRE>
580 * void myCombine(double[] coords, Object[] data,
581 * float[] weight, Object[] outData)
582 * {
583 * MyVertex newVertex = new MyVertex();
584 *
585 * newVertex.x = coords[0];
586 * newVertex.y = coords[1];
587 * newVertex.z = coords[2];
588 * newVertex.r = weight[0]*data[0].r +
589 * weight[1]*data[1].r +
590 * weight[2]*data[2].r +
591 * weight[3]*data[3].r;
592 * newVertex.g = weight[0]*data[0].g +
593 * weight[1]*data[1].g +
594 * weight[2]*data[2].g +
595 * weight[3]*data[3].g;
596 * newVertex.b = weight[0]*data[0].b +
597 * weight[1]*data[1].b +
598 * weight[2]*data[2].b +
599 * weight[3]*data[3].b;
600 * newVertex.a = weight[0]*data[0].a +
601 * weight[1]*data[1].a +
602 * weight[2]*data[2].a +
603 * weight[3]*data[3].a;
604 * outData = newVertex;
605 * }</PRE>
606 *
607 * <UL>
608 * If the tessellation detects an intersection, then the
609 * <b>GLU_TESS_COMBINE</b> or <b>GLU_TESS_COMBINE_DATA</b> callback (see
610 * below) must be defined, and it must write a non-null reference into
611 * <i>outData</i>. Otherwise the <b>GLU_TESS_NEED_COMBINE_CALLBACK</b> error
612 * occurs, and no output is generated.
613 * </UL>
614 *
615 * <b>GLU_TESS_COMBINE_DATA</b>
616 * <UL>
617 * The same as the <b>GLU_TESS_COMBINE</b> callback except that it takes an
618 * additional reference argument. This reference is identical to the opaque
619 * reference provided when
620 * {@link #gluTessBeginPolygon gluTessBeginPolygon}
621 * was called. The method prototype for this callback is:
622 * </UL>
623 *
624 * <PRE>
625 * void combineData(double[] coords, Object[] data,
626 float[] weight, Object[] outData,
627 Object polygonData);</PRE>
628 *
629 * <b>GLU_TESS_ERROR</b>
630 * <UL>
631 * The error callback is called when an error is encountered. The one
632 * argument is of type int; it indicates the specific error that occurred
633 * and will be set to one of <b>GLU_TESS_MISSING_BEGIN_POLYGON</b>,
634 * <b>GLU_TESS_MISSING_END_POLYGON</b>,
635 * <b>GLU_TESS_MISSING_BEGIN_CONTOUR</b>,
636 * <b>GLU_TESS_MISSING_END_CONTOUR</b>, <b>GLU_TESS_COORD_TOO_LARGE</b>,
637 * <b>GLU_TESS_NEED_COMBINE_CALLBACK</b> or <b>GLU_OUT_OF_MEMORY</b>.
638 * Character strings describing these errors can be retrieved with the
639 * {@link #gluErrorString gluErrorString} call. The
640 * method prototype for this callback is:
641 * </UL>
642 *
643 * <PRE>
644 * void error(int errnum);</PRE>
645 *
646 * <UL>
647 * The GLU library will recover from the first four errors by inserting the
648 * missing call(s). <b>GLU_TESS_COORD_TOO_LARGE</b> indicates that some
649 * vertex coordinate exceeded the predefined constant
650 * <b>GLU_TESS_MAX_COORD</b> in absolute value, and that the value has been
651 * clamped. (Coordinate values must be small enough so that two can be
652 * multiplied together without overflow.)
653 * <b>GLU_TESS_NEED_COMBINE_CALLBACK</b> indicates that the tessellation
654 * detected an intersection between two edges in the input data, and the
655 * <b>GLU_TESS_COMBINE</b> or <b>GLU_TESS_COMBINE_DATA</b> callback was not
656 * provided. No output is generated. <b>GLU_OUT_OF_MEMORY</b> indicates that
657 * there is not enough memory so no output is generated.
658 * </UL>
659 *
660 * <b>GLU_TESS_ERROR_DATA</b>
661 * <UL>
662 * The same as the GLU_TESS_ERROR callback except that it takes an
663 * additional reference argument. This reference is identical to the opaque
664 * reference provided when
665 * {@link #gluTessBeginPolygon gluTessBeginPolygon}
666 * was called. The method prototype for this callback is:
667 * </UL>
668 *
669 * <PRE>
670 * void errorData(int errnum, Object polygonData);</PRE>
671 *
672 * @param tessellator
673 * Specifies the tessellation object (created with
674 * {@link #gluNewTess gluNewTess}).
675 * @param which
676 * Specifies the callback being defined. The following values are
677 * valid: <b>GLU_TESS_BEGIN</b>, <b>GLU_TESS_BEGIN_DATA</b>,
678 * <b>GLU_TESS_EDGE_FLAG</b>, <b>GLU_TESS_EDGE_FLAG_DATA</b>,
679 * <b>GLU_TESS_VERTEX</b>, <b>GLU_TESS_VERTEX_DATA</b>,
680 * <b>GLU_TESS_END</b>, <b>GLU_TESS_END_DATA</b>,
681 * <b>GLU_TESS_COMBINE</b>, <b>GLU_TESS_COMBINE_DATA</b>,
682 * <b>GLU_TESS_ERROR</b>, and <b>GLU_TESS_ERROR_DATA</b>.
683 * @param aCallback
684 * Specifies the callback object to be called.
685 *
686 * @see com.jogamp.opengl.GL#glBegin glBegin
687 * @see com.jogamp.opengl.GL#glEdgeFlag glEdgeFlag
688 * @see com.jogamp.opengl.GL#glVertex3f glVertex3f
689 * @see #gluNewTess gluNewTess
690 * @see #gluErrorString gluErrorString
691 * @see #gluTessVertex gluTessVertex
692 * @see #gluTessBeginPolygon gluTessBeginPolygon
693 * @see #gluTessBeginContour gluTessBeginContour
694 * @see #gluTessProperty gluTessProperty
695 * @see #gluTessNormal gluTessNormal
696 ****************************************************************************/
697 public static final void gluTessCallback(GLUtessellator tessellator, int which, GLUtessellatorCallback aCallback) {
699 GLUtessellatorImpl tess = (GLUtessellatorImpl) tessellator;
700 tess.gluTessCallback(which, aCallback);
701 }
702
703 /*****************************************************************************
704 * <b>gluTessVertex</b> describes a vertex on a polygon that the program
705 * defines. Successive <b>gluTessVertex</b> calls describe a closed contour.
706 * For example, to describe a quadrilateral <b>gluTessVertex</b> should be
707 * called four times. <b>gluTessVertex</b> can only be called between
708 * {@link #gluTessBeginContour gluTessBeginContour} and
709 * {@link #gluTessBeginContour gluTessEndContour}.<P>
710 *
711 * Optional, throws GLException if not available in profile
712 *
713 * <b>data</b> normally references to a structure containing the vertex
714 * location, as well as other per-vertex attributes such as color and normal.
715 * This reference is passed back to the user through the
716 * <b>GLU_TESS_VERTEX</b> or <b>GLU_TESS_VERTEX_DATA</b> callback after
717 * tessellation (see the {@link #gluTessCallback
718 * gluTessCallback} reference page).
719 *
720 * @param tessellator
721 * Specifies the tessellation object (created with
722 * {@link #gluNewTess gluNewTess}).
723 * @param coords
724 * Specifies the coordinates of the vertex.
725 * @param data
726 * Specifies an opaque reference passed back to the program with the
727 * vertex callback (as specified by
728 * {@link #gluTessCallback gluTessCallback}).
729 *
730 * @see #gluTessBeginPolygon gluTessBeginPolygon
731 * @see #gluNewTess gluNewTess
732 * @see #gluTessBeginContour gluTessBeginContour
733 * @see #gluTessCallback gluTessCallback
734 * @see #gluTessProperty gluTessProperty
735 * @see #gluTessNormal gluTessNormal
736 * @see #gluTessEndPolygon gluTessEndPolygon
737 ****************************************************************************/
738 public static final void gluTessVertex(GLUtessellator tessellator, double[] coords, int coords_offset, Object data) {
740 GLUtessellatorImpl tess = (GLUtessellatorImpl) tessellator;
741 tess.gluTessVertex(coords, coords_offset, data);
742 }
743
744 /*****************************************************************************
745 * <b>gluTessBeginPolygon</b> and
746 * {@link #gluTessEndPolygon gluTessEndPolygon} delimit
747 * the definition of a convex, concave or self-intersecting polygon. Within
748 * each <b>gluTessBeginPolygon</b>/
749 * {@link #gluTessEndPolygon gluTessEndPolygon} pair,
750 * there must be one or more calls to
751 * {@link #gluTessBeginContour gluTessBeginContour}/
752 * {@link #gluTessEndContour gluTessEndContour}. Within
753 * each contour, there are zero or more calls to
754 * {@link #gluTessVertex gluTessVertex}. The vertices
755 * specify a closed contour (the last vertex of each contour is automatically
756 * linked to the first). See the {@link #gluTessVertex
757 * gluTessVertex}, {@link #gluTessBeginContour
758 * gluTessBeginContour}, and {@link #gluTessEndContour
759 * gluTessEndContour} reference pages for more details.<P>
760 *
761 * Optional, throws GLException if not available in profile
762 *
763 * <b>data</b> is a reference to a user-defined data structure. If the
764 * appropriate callback(s) are specified (see
765 * {@link #gluTessCallback gluTessCallback}), then this
766 * reference is returned to the callback method(s). Thus, it is a convenient
767 * way to store per-polygon information.<P>
768 *
769 * Once {@link #gluTessEndPolygon gluTessEndPolygon} is
770 * called, the polygon is tessellated, and the resulting triangles are
771 * described through callbacks. See
772 * {@link #gluTessCallback gluTessCallback} for
773 * descriptions of the callback methods.
774 *
775 * @param tessellator
776 * Specifies the tessellation object (created with
777 * {@link #gluNewTess gluNewTess}).
778 * @param data
779 * Specifies a reference to user polygon data.
780 *
781 * @see #gluNewTess gluNewTess
782 * @see #gluTessBeginContour gluTessBeginContour
783 * @see #gluTessVertex gluTessVertex
784 * @see #gluTessCallback gluTessCallback
785 * @see #gluTessProperty gluTessProperty
786 * @see #gluTessNormal gluTessNormal
787 * @see #gluTessEndPolygon gluTessEndPolygon
788 ****************************************************************************/
789 public static final void gluTessBeginPolygon(GLUtessellator tessellator, Object data) {
791 GLUtessellatorImpl tess = (GLUtessellatorImpl) tessellator;
792 tess.gluTessBeginPolygon(data);
793 }
794
795 /*****************************************************************************
796 * <b>gluTessBeginContour</b> and
797 * {@link #gluTessEndContour gluTessEndContour} delimit
798 * the definition of a polygon contour. Within each
799 * <b>gluTessBeginContour</b>/
800 * {@link #gluTessEndContour gluTessEndContour} pair,
801 * there can be zero or more calls to
802 * {@link #gluTessVertex gluTessVertex}. The vertices
803 * specify a closed contour (the last vertex of each contour is automatically
804 * linked to the first). See the {@link #gluTessVertex
805 * gluTessVertex} reference page for more details. <b>gluTessBeginContour</b>
806 * can only be called between
807 * {@link #gluTessBeginPolygon gluTessBeginPolygon} and
808 * {@link #gluTessEndPolygon gluTessEndPolygon}.
809 *
810 * Optional, throws GLException if not available in profile
811 *
812 * @param tessellator
813 * Specifies the tessellation object (created with
814 * {@link #gluNewTess gluNewTess}).
815 *
816 * @see #gluNewTess gluNewTess
817 * @see #gluTessBeginPolygon gluTessBeginPolygon
818 * @see #gluTessVertex gluTessVertex
819 * @see #gluTessCallback gluTessCallback
820 * @see #gluTessProperty gluTessProperty
821 * @see #gluTessNormal gluTessNormal
822 * @see #gluTessEndPolygon gluTessEndPolygon
823 ****************************************************************************/
824 public static final void gluTessBeginContour(GLUtessellator tessellator) {
826 GLUtessellatorImpl tess = (GLUtessellatorImpl) tessellator;
827 tess.gluTessBeginContour();
828 }
829
830 /*****************************************************************************
831 * <b>gluTessEndContour</b> and
832 * {@link #gluTessBeginContour gluTessBeginContour}
833 * delimit the definition of a polygon contour. Within each
834 * {@link #gluTessBeginContour gluTessBeginContour}/
835 * <b>gluTessEndContour</b> pair, there can be zero or more calls to
836 * {@link #gluTessVertex gluTessVertex}. The vertices
837 * specify a closed contour (the last vertex of each contour is automatically
838 * linked to the first). See the {@link #gluTessVertex
839 * gluTessVertex} reference page for more details.
840 * {@link #gluTessBeginContour gluTessBeginContour} can
841 * only be called between {@link #gluTessBeginPolygon
842 * gluTessBeginPolygon} and
843 * {@link #gluTessEndPolygon gluTessEndPolygon}.
844 *
845 * Optional, throws GLException if not available in profile
846 *
847 * @param tessellator
848 * Specifies the tessellation object (created with
849 * {@link #gluNewTess gluNewTess}).
850 *
851 * @see #gluNewTess gluNewTess
852 * @see #gluTessBeginPolygon gluTessBeginPolygon
853 * @see #gluTessVertex gluTessVertex
854 * @see #gluTessCallback gluTessCallback
855 * @see #gluTessProperty gluTessProperty
856 * @see #gluTessNormal gluTessNormal
857 * @see #gluTessEndPolygon gluTessEndPolygon
858 ****************************************************************************/
859 public static final void gluTessEndContour(GLUtessellator tessellator) {
861 GLUtessellatorImpl tess = (GLUtessellatorImpl) tessellator;
862 tess.gluTessEndContour();
863 }
864
865 /*****************************************************************************
866 * <b>gluTessEndPolygon</b> and
867 * {@link #gluTessBeginPolygon gluTessBeginPolygon}
868 * delimit the definition of a convex, concave or self-intersecting polygon.
869 * Within each {@link #gluTessBeginPolygon
870 * gluTessBeginPolygon}/<b>gluTessEndPolygon</b> pair, there must be one or
871 * more calls to {@link #gluTessBeginContour
872 * gluTessBeginContour}/{@link #gluTessEndContour
873 * gluTessEndContour}. Within each contour, there are zero or more calls to
874 * {@link #gluTessVertex gluTessVertex}. The vertices
875 * specify a closed contour (the last vertex of each contour is automatically
876 * linked to the first). See the {@link #gluTessVertex
877 * gluTessVertex}, {@link #gluTessBeginContour
878 * gluTessBeginContour} and {@link #gluTessEndContour
879 * gluTessEndContour} reference pages for more details.<P>
880 *
881 * Optional, throws GLException if not available in profile
882 *
883 * Once <b>gluTessEndPolygon</b> is called, the polygon is tessellated, and
884 * the resulting triangles are described through callbacks. See
885 * {@link #gluTessCallback gluTessCallback} for
886 * descriptions of the callback functions.
887 *
888 * @param tessellator
889 * Specifies the tessellation object (created with
890 * {@link #gluNewTess gluNewTess}).
891 *
892 * @see #gluNewTess gluNewTess
893 * @see #gluTessBeginContour gluTessBeginContour
894 * @see #gluTessVertex gluTessVertex
895 * @see #gluTessCallback gluTessCallback
896 * @see #gluTessProperty gluTessProperty
897 * @see #gluTessNormal gluTessNormal
898 * @see #gluTessBeginPolygon gluTessBeginPolygon
899 ****************************************************************************/
900 public static final void gluTessEndPolygon(GLUtessellator tessellator) {
902 GLUtessellatorImpl tess = (GLUtessellatorImpl) tessellator;
903 tess.gluTessEndPolygon();
904 }
905
906 /*****************************************************************************
907
908 * <b>gluBeginPolygon</b> and {@link #gluEndPolygon gluEndPolygon}
909 * delimit the definition of a nonconvex polygon. To define such a
910 * polygon, first call <b>gluBeginPolygon</b>. Then define the
911 * contours of the polygon by calling {@link #gluTessVertex
912 * gluTessVertex} for each vertex and {@link #gluNextContour
913 * gluNextContour} to start each new contour. Finally, call {@link
914 * #gluEndPolygon gluEndPolygon} to signal the end of the
915 * definition. See the {@link #gluTessVertex gluTessVertex} and {@link
916 * #gluNextContour gluNextContour} reference pages for more
917 * details.<P>
918 *
919 * Optional, throws GLException if not available in profile
920 *
921 * Once {@link #gluEndPolygon gluEndPolygon} is called,
922 * the polygon is tessellated, and the resulting triangles are described
923 * through callbacks. See {@link #gluTessCallback
924 * gluTessCallback} for descriptions of the callback methods.
925 *
926 * @param tessellator
927 * Specifies the tessellation object (created with
928 * {@link #gluNewTess gluNewTess}).
929 *
930 * @see #gluNewTess gluNewTess
931 * @see #gluNextContour gluNextContour
932 * @see #gluTessCallback gluTessCallback
933 * @see #gluTessVertex gluTessVertex
934 * @see #gluTessBeginPolygon gluTessBeginPolygon
935 * @see #gluTessBeginContour gluTessBeginContour
936 ****************************************************************************/
937 public static final void gluBeginPolygon(GLUtessellator tessellator) {
939 GLUtessellatorImpl tess = (GLUtessellatorImpl) tessellator;
940 tess.gluBeginPolygon();
941 }
942
943 /*****************************************************************************
944 * <b>gluNextContour</b> is used to describe polygons with multiple
945 * contours. After you describe the first contour through a series of
946 * {@link #gluTessVertex gluTessVertex} calls, a
947 * <b>gluNextContour</b> call indicates that the previous contour is complete
948 * and that the next contour is about to begin. Perform another series of
949 * {@link #gluTessVertex gluTessVertex} calls to
950 * describe the new contour. Repeat this process until all contours have been
951 * described.<P>
952 *
953 * Optional, throws GLException if not available in profile
954 *
955 * The type parameter defines what type of contour follows. The following
956 * values are valid. <P>
957 *
958 * <b>GLU_EXTERIOR</b>
959 * <UL>
960 * An exterior contour defines an exterior boundary of the polygon.
961 * </UL>
962 * <b>GLU_INTERIOR</b>
963 * <UL>
964 * An interior contour defines an interior boundary of the polygon (such as
965 * a hole).
966 * </UL>
967 * <b>GLU_UNKNOWN</b>
968 * <UL>
969 * An unknown contour is analyzed by the library to determine whether it is
970 * interior or exterior.
971 * </UL>
972 * <b>GLU_CCW, GLU_CW</b>
973 * <UL>
974 * The first <b>GLU_CCW</b> or <b>GLU_CW</b> contour defined is considered
975 * to be exterior. All other contours are considered to be exterior if they
976 * are oriented in the same direction (clockwise or counterclockwise) as the
977 * first contour, and interior if they are not. If one contour is of type
978 * <b>GLU_CCW</b> or <b>GLU_CW</b>, then all contours must be of the same
979 * type (if they are not, then all <b>GLU_CCW</b> and <b>GLU_CW</b> contours
980 * will be changed to <b>GLU_UNKNOWN</b>). Note that there is no
981 * real difference between the <b>GLU_CCW</b> and <b>GLU_CW</b> contour
982 * types.
983 * </UL><P>
984 *
985 * To define the type of the first contour, you can call <b>gluNextContour</b>
986 * before describing the first contour. If you do not call
987 * <b>gluNextContour</b> before the first contour, the first contour is marked
988 * <b>GLU_EXTERIOR</b>.<P>
989 *
990 * <UL>
991 * <b>Note:</b> The <b>gluNextContour</b> function is obsolete and is
992 * provided for backward compatibility only. The <b>gluNextContour</b>
993 * function is mapped to {@link #gluTessEndContour
994 * gluTessEndContour} followed by
995 * {@link #gluTessBeginContour gluTessBeginContour}.
996 * </UL>
997 *
998 * @param tessellator
999 * Specifies the tessellation object (created with
1000 * {@link #gluNewTess gluNewTess}).
1001 * @param type
1002 * The type of the contour being defined.
1003 *
1004 * @see #gluNewTess gluNewTess
1005 * @see #gluTessBeginContour gluTessBeginContour
1006 * @see #gluTessBeginPolygon gluTessBeginPolygon
1007 * @see #gluTessCallback gluTessCallback
1008 * @see #gluTessEndContour gluTessEndContour
1009 * @see #gluTessVertex gluTessVertex
1010 ****************************************************************************/
1011 public static final void gluNextContour(GLUtessellator tessellator, int type) {
1013 GLUtessellatorImpl tess = (GLUtessellatorImpl) tessellator;
1014 tess.gluNextContour(type);
1015 }
1016
1017 /*****************************************************************************
1018 * <b>gluEndPolygon</b> and {@link #gluBeginPolygon
1019 * gluBeginPolygon} delimit the definition of a nonconvex polygon. To define
1020 * such a polygon, first call {@link #gluBeginPolygon
1021 * gluBeginPolygon}. Then define the contours of the polygon by calling
1022 * {@link #gluTessVertex gluTessVertex} for each vertex
1023 * and {@link #gluNextContour gluNextContour} to start
1024 * each new contour. Finally, call <b>gluEndPolygon</b> to signal the end of
1025 * the definition. See the {@link #gluTessVertex
1026 * gluTessVertex} and {@link #gluNextContour
1027 * gluNextContour} reference pages for more details.<P>
1028 *
1029 * Optional, throws GLException if not available in profile
1030 *
1031 * Once <b>gluEndPolygon</b> is called, the polygon is tessellated, and the
1032 * resulting triangles are described through callbacks. See
1033 * {@link #gluTessCallback gluTessCallback} for
1034 * descriptions of the callback methods.
1035 *
1036 * @param tessellator
1037 * Specifies the tessellation object (created with
1038 * {@link #gluNewTess gluNewTess}).
1039 *
1040 * @see #gluNewTess gluNewTess
1041 * @see #gluNextContour gluNextContour
1042 * @see #gluTessCallback gluTessCallback
1043 * @see #gluTessVertex gluTessVertex
1044 * @see #gluTessBeginPolygon gluTessBeginPolygon
1045 * @see #gluTessBeginContour gluTessBeginContour
1046 ****************************************************************************/
1047 public static final void gluEndPolygon(GLUtessellator tessellator) {
1049 GLUtessellatorImpl tess = (GLUtessellatorImpl) tessellator;
1050 tess.gluEndPolygon();
1051 }
1052
1053 // Boolean
1054 public static final int GLU_FALSE = 0;
1055 public static final int GLU_TRUE = 1;
1056
1057 // String Name
1058 public static final int GLU_VERSION = 100800;
1059 public static final int GLU_EXTENSIONS = 100801;
1060
1061 // Extensions
1062 public static final String versionString = "1.3";
1063 public static final String extensionString = "GLU_EXT_nurbs_tessellator " +
1064 "GLU_EXT_object_space_tess ";
1065
1066 // ErrorCode
1067 public static final int GLU_INVALID_ENUM = 100900;
1068 public static final int GLU_INVALID_VALUE = 100901;
1069 public static final int GLU_OUT_OF_MEMORY = 100902;
1070 public static final int GLU_INVALID_OPERATION = 100904;
1071
1072
1073 // QuadricDrawStyle
1074 public static final int GLU_POINT = 100010;
1075 public static final int GLU_LINE = 100011;
1076 public static final int GLU_FILL = 100012;
1077 public static final int GLU_SILHOUETTE = 100013;
1078
1079 // QuadricCallback
1080 // GLU_ERROR
1081
1082 // QuadricNormal
1083 public static final int GLU_SMOOTH = 100000;
1084 public static final int GLU_FLAT = 100001;
1085 public static final int GLU_NONE = 100002;
1086
1087 // QuadricOrientation
1088 public static final int GLU_OUTSIDE = 100020;
1089 public static final int GLU_INSIDE = 100021;
1090
1091 // NurbsDisplay
1092 // GLU_FILL
1093 //public static final int GLU_OUTLINE_POLYGON = 100240;
1094 //public static final int GLU_OUTLINE_PATCH = 100241;
1095
1096 // NurbsCallback
1097 //public static final int GLU_NURBS_ERROR = 100103;
1098 public static final int GLU_ERROR = 100103;
1099 //public static final int GLU_NURBS_BEGIN = 100164;
1100 //public static final int GLU_NURBS_BEGIN_EXT = 100164;
1101 //public static final int GLU_NURBS_VERTEX = 100165;
1102 //public static final int GLU_NURBS_VERTEX_EXT = 100165;
1103 //public static final int GLU_NURBS_NORMAL = 100166;
1104 //public static final int GLU_NURBS_NORMAL_EXT = 100166;
1105 //public static final int GLU_NURBS_COLOR = 100167;
1106 //public static final int GLU_NURBS_COLOR_EXT = 100167;
1107 //public static final int GLU_NURBS_TEXTURE_COORD = 100168;
1108 //public static final int GLU_NURBS_TEX_COORD_EXT = 100168;
1109 //public static final int GLU_NURBS_END = 100169;
1110 //public static final int GLU_NURBS_END_EXT = 100169;
1111 //public static final int GLU_NURBS_BEGIN_DATA = 100170;
1112 //public static final int GLU_NURBS_BEGIN_DATA_EXT = 100170;
1113 //public static final int GLU_NURBS_VERTEX_DATA = 100171;
1114 //public static final int GLU_NURBS_VERTEX_DATA_EXT = 100171;
1115 //public static final int GLU_NURBS_NORMAL_DATA = 100172;
1116 //public static final int GLU_NURBS_NORMAL_DATA_EXT = 100172;
1117 //public static final int GLU_NURBS_COLOR_DATA = 100173;
1118 //public static final int GLU_NURBS_COLOR_DATA_EXT = 100173;
1119 //public static final int GLU_NURBS_TEXTURE_COORD_DATA = 100174;
1120 //public static final int GLU_NURBS_TEX_COORD_DATA_EXT = 100174;
1121 //public static final int GLU_NURBS_END_DATA = 100175;
1122 //public static final int GLU_NURBS_END_DATA_EXT = 100175;
1123
1124 // NurbsError
1125 //public static final int GLU_NURBS_ERROR1 = 100251;
1126 //public static final int GLU_NURBS_ERROR2 = 100252;
1127 //public static final int GLU_NURBS_ERROR3 = 100253;
1128 //public static final int GLU_NURBS_ERROR4 = 100254;
1129 //public static final int GLU_NURBS_ERROR5 = 100255;
1130 //public static final int GLU_NURBS_ERROR6 = 100256;
1131 //public static final int GLU_NURBS_ERROR7 = 100257;
1132 //public static final int GLU_NURBS_ERROR8 = 100258;
1133 //public static final int GLU_NURBS_ERROR9 = 100259;
1134 //public static final int GLU_NURBS_ERROR10 = 100260;
1135 //public static final int GLU_NURBS_ERROR11 = 100261;
1136 //public static final int GLU_NURBS_ERROR12 = 100262;
1137 //public static final int GLU_NURBS_ERROR13 = 100263;
1138 //public static final int GLU_NURBS_ERROR14 = 100264;
1139 //public static final int GLU_NURBS_ERROR15 = 100265;
1140 //public static final int GLU_NURBS_ERROR16 = 100266;
1141 //public static final int GLU_NURBS_ERROR17 = 100267;
1142 //public static final int GLU_NURBS_ERROR18 = 100268;
1143 //public static final int GLU_NURBS_ERROR19 = 100269;
1144 //public static final int GLU_NURBS_ERROR20 = 100270;
1145 //public static final int GLU_NURBS_ERROR21 = 100271;
1146 //public static final int GLU_NURBS_ERROR22 = 100272;
1147 //public static final int GLU_NURBS_ERROR23 = 100273;
1148 //public static final int GLU_NURBS_ERROR24 = 100274;
1149 //public static final int GLU_NURBS_ERROR25 = 100275;
1150 //public static final int GLU_NURBS_ERROR26 = 100276;
1151 //public static final int GLU_NURBS_ERROR27 = 100277;
1152 //public static final int GLU_NURBS_ERROR28 = 100278;
1153 //public static final int GLU_NURBS_ERROR29 = 100279;
1154 //public static final int GLU_NURBS_ERROR30 = 100280;
1155 //public static final int GLU_NURBS_ERROR31 = 100281;
1156 //public static final int GLU_NURBS_ERROR32 = 100282;
1157 //public static final int GLU_NURBS_ERROR33 = 100283;
1158 //public static final int GLU_NURBS_ERROR34 = 100284;
1159 //public static final int GLU_NURBS_ERROR35 = 100285;
1160 //public static final int GLU_NURBS_ERROR36 = 100286;
1161 //public static final int GLU_NURBS_ERROR37 = 100287;
1162
1163 // NurbsProperty
1164 //public static final int GLU_AUTO_LOAD_MATRIX = 100200;
1165 //public static final int GLU_CULLING = 100201;
1166 //public static final int GLU_SAMPLING_TOLERANCE = 100203;
1167 //public static final int GLU_DISPLAY_MODE = 100204;
1168 //public static final int GLU_PARAMETRIC_TOLERANCE = 100202;
1169 //public static final int GLU_SAMPLING_METHOD = 100205;
1170 //public static final int GLU_U_STEP = 100206;
1171 //public static final int GLU_V_STEP = 100207;
1172 //public static final int GLU_NURBS_MODE = 100160;
1173 //public static final int GLU_NURBS_MODE_EXT = 100160;
1174 //public static final int GLU_NURBS_TESSELLATOR = 100161;
1175 //public static final int GLU_NURBS_TESSELLATOR_EXT = 100161;
1176 //public static final int GLU_NURBS_RENDERER = 100162;
1177 //public static final int GLU_NURBS_RENDERER_EXT = 100162;
1178
1179 // NurbsSampling
1180 //public static final int GLU_OBJECT_PARAMETRIC_ERROR = 100208;
1181 //public static final int GLU_OBJECT_PARAMETRIC_ERROR_EXT = 100208;
1182 //public static final int GLU_OBJECT_PATH_LENGTH = 100209;
1183 //public static final int GLU_OBJECT_PATH_LENGTH_EXT = 100209;
1184 //public static final int GLU_PATH_LENGTH = 100215;
1185 //public static final int GLU_PARAMETRIC_ERROR = 100216;
1186 //public static final int GLU_DOMAIN_DISTANCE = 100217;
1187
1188 // NurbsTrim
1189 //public static final int GLU_MAP1_TRIM_2 = 100210;
1190 //public static final int GLU_MAP1_TRIM_3 = 100211;
1191
1192 // QuadricCallback
1193 // GLU_ERROR
1194
1195 // TessCallback
1196 public static final int GLU_TESS_BEGIN = 100100;
1197 public static final int GLU_BEGIN = 100100;
1198 public static final int GLU_TESS_VERTEX = 100101;
1199 public static final int GLU_VERTEX = 100101;
1200 public static final int GLU_TESS_END = 100102;
1201 public static final int GLU_END = 100102;
1202 public static final int GLU_TESS_ERROR = 100103;
1203 public static final int GLU_TESS_EDGE_FLAG = 100104;
1204 public static final int GLU_EDGE_FLAG = 100104;
1205 public static final int GLU_TESS_COMBINE = 100105;
1206 public static final int GLU_TESS_BEGIN_DATA = 100106;
1207 public static final int GLU_TESS_VERTEX_DATA = 100107;
1208 public static final int GLU_TESS_END_DATA = 100108;
1209 public static final int GLU_TESS_ERROR_DATA = 100109;
1210 public static final int GLU_TESS_EDGE_FLAG_DATA = 100110;
1211 public static final int GLU_TESS_COMBINE_DATA = 100111;
1212
1213 // TessContour
1214 public static final int GLU_CW = 100120;
1215 public static final int GLU_CCW = 100121;
1216 public static final int GLU_INTERIOR = 100122;
1217 public static final int GLU_EXTERIOR = 100123;
1218 public static final int GLU_UNKNOWN = 100124;
1219
1220 // TessProperty
1221 public static final int GLU_TESS_WINDING_RULE = 100140;
1222 public static final int GLU_TESS_BOUNDARY_ONLY = 100141;
1223 public static final int GLU_TESS_TOLERANCE = 100142;
1224 // JOGL-specific boolean property, false by default, that may improve the tessellation
1225 public static final int GLU_TESS_AVOID_DEGENERATE_TRIANGLES = 100149;
1226
1227 // TessError
1228 public static final int GLU_TESS_ERROR1 = 100151;
1229 public static final int GLU_TESS_ERROR2 = 100152;
1230 public static final int GLU_TESS_ERROR3 = 100153;
1231 public static final int GLU_TESS_ERROR4 = 100154;
1232 public static final int GLU_TESS_ERROR5 = 100155;
1233 public static final int GLU_TESS_ERROR6 = 100156;
1234 public static final int GLU_TESS_ERROR7 = 100157;
1235 public static final int GLU_TESS_ERROR8 = 100158;
1236 public static final int GLU_TESS_MISSING_BEGIN_POLYGON = 100151;
1237 public static final int GLU_TESS_MISSING_BEGIN_CONTOUR = 100152;
1238 public static final int GLU_TESS_MISSING_END_POLYGON = 100153;
1239 public static final int GLU_TESS_MISSING_END_CONTOUR = 100154;
1240 public static final int GLU_TESS_COORD_TOO_LARGE = 100155;
1241 public static final int GLU_TESS_NEED_COMBINE_CALLBACK = 100156;
1242
1243 // TessWinding
1244 public static final int GLU_TESS_WINDING_ODD = 100130;
1245 public static final int GLU_TESS_WINDING_NONZERO = 100131;
1246 public static final int GLU_TESS_WINDING_POSITIVE = 100132;
1247 public static final int GLU_TESS_WINDING_NEGATIVE = 100133;
1248 public static final int GLU_TESS_WINDING_ABS_GEQ_TWO = 100134;
1249 public static final double GLU_TESS_MAX_COORD = 1.0e150;
1250
1251 //----------------------------------------------------------------------
1252 // Quadric functionality
1253 //
1254
1255 protected static boolean availableGLUquadricImpl = false;
1256 protected static boolean checkedGLUquadricImpl = false;
1257 protected static volatile Object syncObject = new Object();
1258
1259 /**
1260 * Optional, throws GLException if not available in profile
1261 */
1262 protected static final void validateGLUquadricImpl() {
1264 synchronized (syncObject) {
1266 availableGLUquadricImpl = ReflectionUtil.isClassAvailable("jogamp.opengl.glu.GLUquadricImpl", GLU.class.getClassLoader());
1267 checkedGLUquadricImpl = true;
1268 }
1269 }
1270 }
1272 throw new GLException("GLUquadric not available (GLUquadricImpl)");
1273 }
1274 }
1275
1276
1277 /** Option (throws GLException if not available in profile). <br> Interface to C language function: <br> <code> void gluCylinder(GLUquadric * quad, GLdouble base, GLdouble top, GLdouble height, GLint slices, GLint stacks); </code> */
1278 public final void gluCylinder(GLUquadric quad, double base, double top, double height, int slices, int stacks) {
1280 ((GLUquadricImpl) quad).drawCylinder(getCurrentGL(), (float) base, (float) top, (float) height, slices, stacks);
1281 }
1282
1283 /** Option (throws GLException if not available in profile). <br> Interface to C language function: <br> <code> void gluDeleteQuadric(GLUquadric * quad); </code> */
1284 public final void gluDeleteQuadric(GLUquadric quad) {
1286 }
1287
1288 /** Option (throws GLException if not available in profile). <br> Interface to C language function: <br> <code> void gluDisk(GLUquadric * quad, GLdouble inner, GLdouble outer, GLint slices, GLint loops); </code> */
1289 public final void gluDisk(GLUquadric quad, double inner, double outer, int slices, int loops) {
1291 ((GLUquadricImpl) quad).drawDisk(getCurrentGL(), (float) inner, (float) outer, slices, loops);
1292 }
1293
1294 /** Option (throws GLException if not available in profile). <br> Interface to C language function: <br> <code> GLUquadric * gluNewQuadric(void); </code> */
1295 public final GLUquadric gluNewQuadric() {
1296 return gluNewQuadric(false, null, 0);
1297 }
1298
1299 public final GLUquadric gluNewQuadric(boolean useGLSL, ShaderState st) {
1300 return gluNewQuadric(useGLSL, st, 0);
1301 }
1302
1303 public final GLUquadric gluNewQuadric(boolean useGLSL, int shaderProgram) {
1304 return gluNewQuadric(useGLSL, null, shaderProgram);
1305 }
1306
1307 private final GLUquadric gluNewQuadric(boolean useGLSL, ShaderState st, int shaderProgram) {
1308 GL gl = getCurrentGL();
1309 if(useGLSL && !gl.isGL2ES2()) {
1310 throw new GLException("GLUquadric GLSL implementation not supported for profile: "+gl);
1311 }
1313 return new GLUquadricImpl(gl, useGLSL, st, shaderProgram);
1314 }
1315
1316 /** Option (throws GLException if not available in profile). <br> Interface to C language function: <br> <code> void gluPartialDisk(GLUquadric * quad, GLdouble inner, GLdouble outer, GLint slices, GLint loops, GLdouble start, GLdouble sweep); </code> */
1317 public final void gluPartialDisk(GLUquadric quad, double inner, double outer, int slices, int loops, double start, double sweep) {
1319 ((GLUquadricImpl) quad).drawPartialDisk(getCurrentGL(), (float) inner, (float) outer, slices, loops, (float) start, (float) sweep);
1320 }
1321
1322 /** Option (throws GLException if not available in profile). <br> Interface to C language function: <br> <code> void gluQuadricDrawStyle(GLUquadric * quad, GLenum draw); </code> */
1323 public final void gluQuadricDrawStyle(GLUquadric quad, int draw) {
1325 ((GLUquadricImpl) quad).setDrawStyle(draw);
1326 }
1327
1328 /** Option (throws GLException if not available in profile). <br> Interface to C language function: <br> <code> void gluQuadricNormals(GLUquadric * quad, GLenum normal); </code> */
1329 public final void gluQuadricNormals(GLUquadric quad, int normal) {
1331 ((GLUquadricImpl) quad).setNormals(normal);
1332 }
1333
1334 /** Option (throws GLException if not available in profile). <br> Interface to C language function: <br> <code> void gluQuadricOrientation(GLUquadric * quad, GLenum orientation); </code> */
1335 public final void gluQuadricOrientation(GLUquadric quad, int orientation) {
1337 ((GLUquadricImpl) quad).setOrientation(orientation);
1338 }
1339
1340 /** Option (throws GLException if not available in profile). <br> Interface to C language function: <br> <code> void gluQuadricTexture(GLUquadric * quad, GLboolean texture); </code> */
1341 public final void gluQuadricTexture(GLUquadric quad, boolean texture) {
1343 ((GLUquadricImpl) quad).setTextureFlag(texture);
1344 }
1345
1346 /** Option (throws GLException if not available in profile). <br> Interface to C language function: <br> <code> void gluSphere(GLUquadric * quad, GLdouble radius, GLint slices, GLint stacks); </code> */
1347 public final void gluSphere(GLUquadric quad, double radius, int slices, int stacks) {
1349 ((GLUquadricImpl) quad).drawSphere(getCurrentGL(), (float) radius, slices, stacks);
1350 }
1351
1352 //----------------------------------------------------------------------
1353 // Projection routines
1354 //
1355
1356 private final ProjectFloat project;
1357
1358 public void gluOrtho2D(float left, float right, float bottom, float top) {
1359 project.gluOrtho2D(getCurrentGL().getGL2ES1(), left, right, bottom, top);
1360 }
1361
1362 public void gluPerspective(float fovy, float aspect, float zNear, float zFar) {
1363 project.gluPerspective(getCurrentGL().getGL2ES1(), fovy, aspect, zNear, zFar);
1364 }
1365
1366 public void gluLookAt(float eyeX, float eyeY, float eyeZ, float centerX, float centerY, float centerZ, float upX, float upY, float upZ) {
1367 project.gluLookAt(getCurrentGL().getGL2ES1(), eyeX, eyeY, eyeZ, centerX, centerY, centerZ, upX, upY, upZ);
1368 }
1369
1370 /** Interface to C language function: <br> <code> GLint gluProject(GLdouble objX, GLdouble objY, GLdouble objZ, const GLdouble * model, const GLdouble * proj, const GLint * view, GLdouble * winX, GLdouble * winY, GLdouble * winZ); </code>
1371 * <P> Accepts the outgoing window coordinates as a single array.
1372 */
1373 public boolean gluProject(float objX, float objY, float objZ, float[] model, int model_offset, float[] proj, int proj_offset, int[] view, int view_offset, float[] winPos, int winPos_offset) {
1374 return project.gluProject(objX, objY, objZ, model, model_offset, proj, proj_offset, view, view_offset, winPos, winPos_offset);
1375 }
1376
1377 /** Interface to C language function: <br> <code> GLint gluProject(GLdouble objX, GLdouble objY, GLdouble objZ, const GLdouble * model, const GLdouble * proj, const GLint * view, GLdouble * winX, GLdouble * winY, GLdouble * winZ); </code>
1378 * <P> Accepts the outgoing window coordinates as a single buffer.
1379 */
1380 public boolean gluProject(float objX, float objY, float objZ, java.nio.FloatBuffer model, java.nio.FloatBuffer proj, java.nio.IntBuffer view, java.nio.FloatBuffer winPos) {
1381 return project.gluProject(objX, objY, objZ, model, proj, view, winPos);
1382 }
1383
1384 /** Interface to C language function: <br> <code> GLint gluUnProject(GLdouble winX, GLdouble winY, GLdouble winZ, const GLdouble * model, const GLdouble * proj, const GLint * view, GLdouble * objX, GLdouble * objY, GLdouble * objZ); </code>
1385 * <P> Accepts the outgoing object coordinates (a 3-vector) as a single array.
1386 */
1387 public boolean gluUnProject(float winX, float winY, float winZ, float[] model, int model_offset, float[] proj, int proj_offset, int[] view, int view_offset, float[] objPos, int objPos_offset) {
1388 return project.gluUnProject(winX, winY, winZ, model, model_offset, proj, proj_offset, view, view_offset, objPos, objPos_offset);
1389 }
1390
1391 /** Interface to C language function: <br> <code> GLint gluUnProject(GLdouble winX, GLdouble winY, GLdouble winZ, const GLdouble * model, const GLdouble * proj, const GLint * view, GLdouble * objX, GLdouble * objY, GLdouble * objZ); </code>
1392 * <P> Accepts the outgoing object coordinates (a 3-vector) as a single buffer.
1393 */
1394 public boolean gluUnProject(float winX, float winY, float winZ, java.nio.FloatBuffer model, java.nio.FloatBuffer proj, java.nio.IntBuffer view, java.nio.FloatBuffer objPos) {
1395 return project.gluUnProject(winX, winY, winZ, model, proj, view, objPos);
1396 }
1397
1398 /** Interface to C language function: <br> <code> GLint gluUnProject4(GLdouble winX, GLdouble winY, GLdouble winZ, GLdouble clipW, const GLdouble * model, const GLdouble * proj, const GLint * view, GLdouble nearVal, GLdouble farVal, GLdouble * objX, GLdouble * objY, GLdouble * objZ, GLdouble * objW); </code>
1399 * <P> Accepts the outgoing object coordinates (a 4-vector) as a single array.
1400 */
1401 public boolean gluUnProject4(float winX, float winY, float winZ, float clipW, float[] model, int model_offset, float[] proj, int proj_offset, int[] view, int view_offset, float nearVal, float farVal, float[] objPos, int objPos_offset) {
1402 return project.gluUnProject4(winX, winY, winZ, clipW, model, model_offset, proj, proj_offset, view, view_offset, nearVal, farVal, objPos, objPos_offset);
1403 }
1404
1405 /** Interface to C language function: <br> <code> GLint gluUnProject4(GLdouble winX, GLdouble winY, GLdouble winZ, GLdouble clipW, const GLdouble * model, const GLdouble * proj, const GLint * view, GLdouble nearVal, GLdouble farVal, GLdouble * objX, GLdouble * objY, GLdouble * objZ, GLdouble * objW); </code>
1406 * <P> Accepts the outgoing object coordinates (a 4-vector) as a single buffer.
1407 */
1408 public boolean gluUnProject4(float winX, float winY, float winZ, float clipW, java.nio.FloatBuffer model, java.nio.FloatBuffer proj, java.nio.IntBuffer view, float nearVal, float farVal, java.nio.FloatBuffer objPos) {
1409 return project.gluUnProject4(winX, winY, winZ, clipW, model, proj, view, nearVal, farVal, objPos);
1410 }
1411
1412 public void gluPickMatrix(float x, float y, float delX, float delY, int[] viewport, int viewport_offset) {
1413 project.gluPickMatrix(getCurrentGL().getGL2ES1(), x, y, delX, delY, viewport, viewport_offset);
1414 }
1415
1416 public void gluPickMatrix(float x, float y, float delX, float delY, java.nio.IntBuffer viewport) {
1417 project.gluPickMatrix(getCurrentGL().getGL2ES1(), x, y, delX, delY, viewport);
1418 }
1419
1420 public void gluOrtho2D(double left, double right, double bottom, double top) {
1421 project.gluOrtho2D(getCurrentGL().getGL2ES1(), (float)left, (float)right, (float)bottom, (float)top);
1422 }
1423
1424 public void gluPerspective(double fovy, double aspect, double zNear, double zFar) {
1425 project.gluPerspective(getCurrentGL().getGL2ES1(), (float)fovy, (float)aspect, (float)zNear, (float)zFar);
1426 }
1427
1428 public void gluLookAt(double eyeX, double eyeY, double eyeZ, double centerX, double centerY, double centerZ, double upX, double upY, double upZ) {
1429 project.gluLookAt(getCurrentGL().getGL2ES1(), (float)eyeX, (float)eyeY, (float)eyeZ, (float)centerX, (float)centerY, (float)centerZ, (float)upX, (float)upY, (float)upZ);
1430 }
1431
1432 /** Interface to C language function: <br> <code> GLint gluProject(GLdouble objX, GLdouble objY, GLdouble objZ, const GLdouble * model, const GLdouble * proj, const GLint * view, GLdouble * winX, GLdouble * winY, GLdouble * winZ); </code>
1433 * <P> Accepts the outgoing window coordinates as a single array.
1434 */
1435 public boolean gluProject(double objX, double objY, double objZ, double[] model, int model_offset, double[] proj, int proj_offset, int[] view, int view_offset, double[] winPos, int winPos_offset) {
1436 float[] f_model = Buffers.getFloatArray(model, model_offset, null, 0, -1);
1437 float[] f_proj = Buffers.getFloatArray(proj, proj_offset, null, 0, -1);
1438 float[] f_winPos = Buffers.getFloatArray(winPos, winPos_offset, null, 0, -1);
1439 boolean res = project.gluProject((float)objX, (float)objY, (float)objZ, f_model, 0, f_proj, 0, view, view_offset, f_winPos, 0);
1440 if(res) {
1441 Buffers.getDoubleArray(f_model, 0, model, model_offset, -1);
1442 Buffers.getDoubleArray(f_proj, 0, proj, proj_offset, -1);
1443 Buffers.getDoubleArray(f_winPos, 0, winPos, winPos_offset, -1);
1444 }
1445 return res;
1446 }
1447
1448 /** Interface to C language function: <br> <code> GLint gluUnProject(GLdouble winX, GLdouble winY, GLdouble winZ, const GLdouble * model, const GLdouble * proj, const GLint * view, GLdouble * objX, GLdouble * objY, GLdouble * objZ); </code>
1449 * <P> Accepts the outgoing object coordinates (a 3-vector) as a single array.
1450 */
1451 public boolean gluUnProject(double winX, double winY, double winZ, double[] model, int model_offset, double[] proj, int proj_offset, int[] view, int view_offset, double[] objPos, int objPos_offset) {
1452 float[] f_model = Buffers.getFloatArray(model, model_offset, null, 0, -1);
1453 float[] f_proj = Buffers.getFloatArray(proj, proj_offset, null, 0, -1);
1454 float[] f_objPos = Buffers.getFloatArray(objPos, objPos_offset, null, 0, -1);
1455 boolean res = project.gluUnProject((float)winX, (float)winY, (float)winZ, f_model, 0, f_proj, 0, view, view_offset, f_objPos, 0);
1456 if(res) {
1457 Buffers.getDoubleArray(f_model, 0, model, model_offset, -1);
1458 Buffers.getDoubleArray(f_proj, 0, proj, proj_offset, -1);
1459 Buffers.getDoubleArray(f_objPos, 0, objPos, objPos_offset, -1);
1460 }
1461 return res;
1462 }
1463
1464 /** Interface to C language function: <br> <code> GLint gluUnProject4(GLdouble winX, GLdouble winY, GLdouble winZ, GLdouble clipW, const GLdouble * model, const GLdouble * proj, const GLint * view, GLdouble nearVal, GLdouble farVal, GLdouble * objX, GLdouble * objY, GLdouble * objZ, GLdouble * objW); </code>
1465 * <P> Accepts the outgoing object coordinates (a 4-vector) as a single array.
1466 */
1467 public boolean gluUnProject4(double winX, double winY, double winZ, double clipW, double[] model, int model_offset, double[] proj, int proj_offset, int[] view, int view_offset, double nearVal, double farVal, double[] objPos, int objPos_offset) {
1468 float[] f_model = Buffers.getFloatArray(model, model_offset, null, 0, -1);
1469 float[] f_proj = Buffers.getFloatArray(proj, proj_offset, null, 0, -1);
1470 float[] f_objPos = Buffers.getFloatArray(objPos, objPos_offset, null, 0, -1);
1471 boolean res = project.gluUnProject4((float)winX, (float)winY, (float)winZ, (float)clipW, f_model, 0, f_proj, 0, view, view_offset, (float)nearVal, (float)farVal, f_objPos, 0);
1472 if(res) {
1473 Buffers.getDoubleArray(f_model, 0, model, model_offset, -1);
1474 Buffers.getDoubleArray(f_proj, 0, proj, proj_offset, -1);
1475 Buffers.getDoubleArray(f_objPos, 0, objPos, objPos_offset, -1);
1476 }
1477 return res;
1478 }
1479
1480 public void gluPickMatrix(double x, double y, double delX, double delY, int[] viewport, int viewport_offset) {
1481 project.gluPickMatrix(getCurrentGL().getGL2ES1(), (float)x, (float)y, (float)delX, (float)delY, viewport, viewport_offset);
1482 }
1483
1484 public void gluPickMatrix(double x, double y, double delX, double delY, IntBuffer viewport) {
1485 project.gluPickMatrix(getCurrentGL().getGL2ES1(), (float)x, (float)y, (float)delX, (float)delY, viewport);
1486 }
1487
1488 /**
1489 * Optional, throws GLException if not available in profile
1490 */
1491 public int gluScaleImage( int format, int widthin, int heightin,
1492 int typein, java.nio.Buffer datain, int widthout, int heightout,
1493 int typeout, java.nio.Buffer dataout ) {
1494 throw new GLException("not implemented");
1495 }
1496
1497 /**
1498 * Optional, throws GLException if not available in profile
1499 */
1500 public int gluBuild1DMipmapLevels( int target, int internalFormat, int width,
1501 int format, int type, int userLevel, int baseLevel, int maxLevel,
1502 java.nio.Buffer data ) {
1503 throw new GLException("not implemented");
1504 }
1505 /**
1506 * Optional, throws GLException if not available in profile
1507 */
1508 public int gluBuild1DMipmaps( int target, int internalFormat, int width,
1509 int format, int type, java.nio.Buffer data ) {
1510 throw new GLException("not implemented");
1511 }
1512
1513 /**
1514 * Optional, throws GLException if not available in profile
1515 */
1516 public int gluBuild2DMipmapLevels( int target, int internalFormat, int width,
1517 int height, int format, int type, int userLevel, int baseLevel,
1518 int maxLevel, java.nio.Buffer data ) {
1519 throw new GLException("not implemented");
1520 }
1521
1522 /**
1523 * Optional, throws GLException if not available in profile
1524 */
1525 public int gluBuild2DMipmaps( int target, int internalFormat, int width,
1526 int height, int format, int type, java.nio.Buffer data ) {
1527 throw new GLException("not implemented");
1528 }
1529
1530 /**
1531 * Optional, throws GLException if not available in profile
1532 */
1533 public int gluBuild3DMipmapLevels( int target, int internalFormat, int width,
1534 int height, int depth, int format, int type, int userLevel, int baseLevel,
1535 int maxLevel, java.nio.Buffer data) {
1536 throw new GLException("not implemented");
1537 }
1538
1539 /**
1540 * Optional, throws GLException if not available in profile
1541 */
1542 public int gluBuild3DMipmaps( int target, int internalFormat, int width,
1543 int height, int depth, int format, int type, java.nio.Buffer data ) {
1544 throw new GLException("not implemented");
1545 }
1546
1547 // ---- End CustomJavaCode .cfg declarations
1548} // end of class GLU
Abstraction for an OpenGL rendering context.
Definition: GLContext.java:74
static GLContext getCurrent()
Returns this thread current context.
Definition: GLContext.java:515
abstract GL getGL()
Returns the GL pipeline object for this GLContext.
A generic exception for OpenGL errors used throughout the binding as a substitute for RuntimeExceptio...
Provides access to the OpenGL Utility Library (GLU).
Definition: GLU.java:43
boolean gluUnProject4(float winX, float winY, float winZ, float clipW, java.nio.FloatBuffer model, java.nio.FloatBuffer proj, java.nio.IntBuffer view, float nearVal, float farVal, java.nio.FloatBuffer objPos)
Interface to C language function: GLint gluUnProject4(GLdouble winX, GLdouble winY,...
Definition: GLU.java:1408
static boolean availableGLUquadricImpl
Definition: GLU.java:1255
static final void gluEndPolygon(GLUtessellator tessellator)
Definition: GLU.java:1047
static final int GLU_TESS_NEED_COMBINE_CALLBACK
Definition: GLU.java:1241
int gluBuild2DMipmaps(int target, int internalFormat, int width, int height, int format, int type, java.nio.Buffer data)
Optional, throws GLException if not available in profile.
Definition: GLU.java:1525
static final int GLU_EDGE_FLAG
Definition: GLU.java:1204
static final void gluGetTessProperty(GLUtessellator tessellator, int which, double[] value, int value_offset)
Definition: GLU.java:369
static final int GLU_TESS_ERROR
Definition: GLU.java:1202
static final int GLU_TESS_COORD_TOO_LARGE
Definition: GLU.java:1240
static final int GLU_FILL
Definition: GLU.java:1076
static final void gluTessBeginPolygon(GLUtessellator tessellator, Object data)
Definition: GLU.java:789
static final int GLU_TESS_ERROR4
Definition: GLU.java:1231
int gluBuild1DMipmapLevels(int target, int internalFormat, int width, int format, int type, int userLevel, int baseLevel, int maxLevel, java.nio.Buffer data)
Optional, throws GLException if not available in profile.
Definition: GLU.java:1500
boolean gluProject(double objX, double objY, double objZ, double[] model, int model_offset, double[] proj, int proj_offset, int[] view, int view_offset, double[] winPos, int winPos_offset)
Interface to C language function: GLint gluProject(GLdouble objX, GLdouble objY,...
Definition: GLU.java:1435
boolean gluUnProject(double winX, double winY, double winZ, double[] model, int model_offset, double[] proj, int proj_offset, int[] view, int view_offset, double[] objPos, int objPos_offset)
Interface to C language function: GLint gluUnProject(GLdouble winX, GLdouble winY,...
Definition: GLU.java:1451
final boolean gluCheckExtension(java.lang.String extName, java.lang.String extString)
Definition: GLU.java:198
static final int GLU_SMOOTH
Definition: GLU.java:1083
static final GL getCurrentGL()
Definition: GLU.java:179
static final int GLU_OUTSIDE
Definition: GLU.java:1088
boolean gluUnProject(float winX, float winY, float winZ, java.nio.FloatBuffer model, java.nio.FloatBuffer proj, java.nio.IntBuffer view, java.nio.FloatBuffer objPos)
Interface to C language function: GLint gluUnProject(GLdouble winX, GLdouble winY,...
Definition: GLU.java:1394
static final int GLU_TESS_WINDING_RULE
Definition: GLU.java:1221
static final int GLU_TRUE
Definition: GLU.java:1055
static final GLUtessellator gluNewTess()
Definition: GLU.java:237
void gluOrtho2D(double left, double right, double bottom, double top)
Definition: GLU.java:1420
final GLUquadric gluNewQuadric(boolean useGLSL, ShaderState st)
Definition: GLU.java:1299
static final void gluNextContour(GLUtessellator tessellator, int type)
Definition: GLU.java:1011
void gluPickMatrix(float x, float y, float delX, float delY, java.nio.IntBuffer viewport)
Definition: GLU.java:1416
static final int GLU_TESS_VERTEX
Definition: GLU.java:1198
static final int GLU_ERROR
Definition: GLU.java:1098
static final int GLU_TESS_ERROR3
Definition: GLU.java:1230
static volatile Object syncObject
Definition: GLU.java:1257
final GLUquadric gluNewQuadric(boolean useGLSL, int shaderProgram)
Definition: GLU.java:1303
static final int GLU_TESS_ERROR_DATA
Definition: GLU.java:1209
static final int GLU_VERTEX
Definition: GLU.java:1199
static boolean checkedGLUquadricImpl
Definition: GLU.java:1256
static final int GLU_TESS_ERROR8
Definition: GLU.java:1235
final void gluQuadricNormals(GLUquadric quad, int normal)
Option (throws GLException if not available in profile).
Definition: GLU.java:1329
static final int GLU_EXTERIOR
Definition: GLU.java:1217
static final int GLU_INSIDE
Definition: GLU.java:1089
final void gluQuadricOrientation(GLUquadric quad, int orientation)
Option (throws GLException if not available in profile).
Definition: GLU.java:1335
final GLUquadric gluNewQuadric()
Option (throws GLException if not available in profile).
Definition: GLU.java:1295
static final int GLU_TESS_ERROR6
Definition: GLU.java:1233
static final int GLU_TESS_WINDING_NEGATIVE
Definition: GLU.java:1247
void gluPickMatrix(float x, float y, float delX, float delY, int[] viewport, int viewport_offset)
Definition: GLU.java:1412
final String gluGetString(int name)
Definition: GLU.java:202
void gluPickMatrix(double x, double y, double delX, double delY, IntBuffer viewport)
Definition: GLU.java:1484
static final int GLU_TESS_EDGE_FLAG_DATA
Definition: GLU.java:1210
static final void gluTessEndPolygon(GLUtessellator tessellator)
Definition: GLU.java:900
static final int GLU_TESS_AVOID_DEGENERATE_TRIANGLES
Definition: GLU.java:1225
static final int GLU_TESS_BEGIN
Definition: GLU.java:1196
static final int GLU_TESS_VERTEX_DATA
Definition: GLU.java:1207
final void gluQuadricTexture(GLUquadric quad, boolean texture)
Option (throws GLException if not available in profile).
Definition: GLU.java:1341
static final void gluTessVertex(GLUtessellator tessellator, double[] coords, int coords_offset, Object data)
Definition: GLU.java:738
void gluPerspective(double fovy, double aspect, double zNear, double zFar)
Definition: GLU.java:1424
static final int GLU_TESS_ERROR2
Definition: GLU.java:1229
static final String versionString
Definition: GLU.java:1062
static final int GLU_INVALID_ENUM
Definition: GLU.java:1067
static final void gluTessCallback(GLUtessellator tessellator, int which, GLUtessellatorCallback aCallback)
Definition: GLU.java:697
static final int GLU_TESS_ERROR1
Definition: GLU.java:1228
static final int GLU_FLAT
Definition: GLU.java:1084
static final int GLU_EXTENSIONS
Definition: GLU.java:1059
final void gluCylinder(GLUquadric quad, double base, double top, double height, int slices, int stacks)
Option (throws GLException if not available in profile).
Definition: GLU.java:1278
void gluPickMatrix(double x, double y, double delX, double delY, int[] viewport, int viewport_offset)
Definition: GLU.java:1480
boolean gluProject(float objX, float objY, float objZ, java.nio.FloatBuffer model, java.nio.FloatBuffer proj, java.nio.IntBuffer view, java.nio.FloatBuffer winPos)
Interface to C language function: GLint gluProject(GLdouble objX, GLdouble objY,...
Definition: GLU.java:1380
static final int GLU_INTERIOR
Definition: GLU.java:1216
static final void gluDeleteTess(GLUtessellator tessellator)
Definition: GLU.java:255
boolean gluUnProject(float winX, float winY, float winZ, float[] model, int model_offset, float[] proj, int proj_offset, int[] view, int view_offset, float[] objPos, int objPos_offset)
Interface to C language function: GLint gluUnProject(GLdouble winX, GLdouble winY,...
Definition: GLU.java:1387
static final int GLU_TESS_WINDING_ODD
Definition: GLU.java:1244
static final int GLU_CW
Definition: GLU.java:1214
static final int GLU_TESS_WINDING_POSITIVE
Definition: GLU.java:1246
int gluBuild3DMipmaps(int target, int internalFormat, int width, int height, int depth, int format, int type, java.nio.Buffer data)
Optional, throws GLException if not available in profile.
Definition: GLU.java:1542
static final int GLU_TESS_BEGIN_DATA
Definition: GLU.java:1206
int gluBuild2DMipmapLevels(int target, int internalFormat, int width, int height, int format, int type, int userLevel, int baseLevel, int maxLevel, java.nio.Buffer data)
Optional, throws GLException if not available in profile.
Definition: GLU.java:1516
static final void gluTessBeginContour(GLUtessellator tessellator)
Definition: GLU.java:824
final void gluPartialDisk(GLUquadric quad, double inner, double outer, int slices, int loops, double start, double sweep)
Option (throws GLException if not available in profile).
Definition: GLU.java:1317
static final int GLU_FALSE
Definition: GLU.java:1054
static final int GLU_TESS_WINDING_NONZERO
Definition: GLU.java:1245
static boolean availableGLUtessellatorImpl
Definition: GLU.java:210
static final int GLU_TESS_ERROR5
Definition: GLU.java:1232
static final int GLU_TESS_MISSING_END_POLYGON
Definition: GLU.java:1238
static final int GLU_TESS_ERROR7
Definition: GLU.java:1234
static final int GLU_TESS_MISSING_BEGIN_CONTOUR
Definition: GLU.java:1237
static final int GLU_OUT_OF_MEMORY
Definition: GLU.java:1069
static final int GLU_UNKNOWN
Definition: GLU.java:1218
static final int GLU_TESS_TOLERANCE
Definition: GLU.java:1223
static final int GLU_INVALID_OPERATION
Definition: GLU.java:1070
boolean gluProject(float objX, float objY, float objZ, float[] model, int model_offset, float[] proj, int proj_offset, int[] view, int view_offset, float[] winPos, int winPos_offset)
Interface to C language function: GLint gluProject(GLdouble objX, GLdouble objY,...
Definition: GLU.java:1373
final void gluQuadricDrawStyle(GLUquadric quad, int draw)
Option (throws GLException if not available in profile).
Definition: GLU.java:1323
int gluScaleImage(int format, int widthin, int heightin, int typein, java.nio.Buffer datain, int widthout, int heightout, int typeout, java.nio.Buffer dataout)
Optional, throws GLException if not available in profile.
Definition: GLU.java:1491
static final void gluTessEndContour(GLUtessellator tessellator)
Definition: GLU.java:859
void gluLookAt(float eyeX, float eyeY, float eyeZ, float centerX, float centerY, float centerZ, float upX, float upY, float upZ)
Definition: GLU.java:1366
final void gluSphere(GLUquadric quad, double radius, int slices, int stacks)
Option (throws GLException if not available in profile).
Definition: GLU.java:1347
static final void gluBeginPolygon(GLUtessellator tessellator)
Definition: GLU.java:937
static final GLU createGLU()
Instantiates a GLU implementation object in respect to the given GL profile of this thread current GL...
Definition: GLU.java:147
static final int GLU_LINE
Definition: GLU.java:1075
void gluLookAt(double eyeX, double eyeY, double eyeZ, double centerX, double centerY, double centerZ, double upX, double upY, double upZ)
Definition: GLU.java:1428
static final int GLU_TESS_WINDING_ABS_GEQ_TWO
Definition: GLU.java:1248
static final void validateGLUtessellatorImpl()
Definition: GLU.java:213
static final void validateGLUquadricImpl()
Optional, throws GLException if not available in profile.
Definition: GLU.java:1262
static boolean checkedGLUtessellatorImpl
Definition: GLU.java:211
static final int GLU_TESS_END
Definition: GLU.java:1200
final void gluDisk(GLUquadric quad, double inner, double outer, int slices, int loops)
Option (throws GLException if not available in profile).
Definition: GLU.java:1289
static final int GLU_TESS_BOUNDARY_ONLY
Definition: GLU.java:1222
final String gluErrorString(int errorCode)
Definition: GLU.java:187
static final void gluTessNormal(GLUtessellator tessellator, double x, double y, double z)
Definition: GLU.java:411
int gluBuild3DMipmapLevels(int target, int internalFormat, int width, int height, int depth, int format, int type, int userLevel, int baseLevel, int maxLevel, java.nio.Buffer data)
Optional, throws GLException if not available in profile.
Definition: GLU.java:1533
boolean gluUnProject4(float winX, float winY, float winZ, float clipW, float[] model, int model_offset, float[] proj, int proj_offset, int[] view, int view_offset, float nearVal, float farVal, float[] objPos, int objPos_offset)
Interface to C language function: GLint gluUnProject4(GLdouble winX, GLdouble winY,...
Definition: GLU.java:1401
static final int GLU_TESS_END_DATA
Definition: GLU.java:1208
static final int GLU_POINT
Definition: GLU.java:1074
static final int GLU_TESS_COMBINE_DATA
Definition: GLU.java:1211
static final int GLU_TESS_EDGE_FLAG
Definition: GLU.java:1203
static final String extensionString
Definition: GLU.java:1063
static final int GLU_INVALID_VALUE
Definition: GLU.java:1068
static final int GLU_TESS_MISSING_BEGIN_POLYGON
Definition: GLU.java:1236
void gluPerspective(float fovy, float aspect, float zNear, float zFar)
Definition: GLU.java:1362
boolean gluUnProject4(double winX, double winY, double winZ, double clipW, double[] model, int model_offset, double[] proj, int proj_offset, int[] view, int view_offset, double nearVal, double farVal, double[] objPos, int objPos_offset)
Interface to C language function: GLint gluUnProject4(GLdouble winX, GLdouble winY,...
Definition: GLU.java:1467
final void gluDeleteQuadric(GLUquadric quad)
Option (throws GLException if not available in profile).
Definition: GLU.java:1284
static final int GLU_SILHOUETTE
Definition: GLU.java:1077
static final int GLU_TESS_COMBINE
Definition: GLU.java:1205
static final int GLU_TESS_MISSING_END_CONTOUR
Definition: GLU.java:1239
static final void gluTessProperty(GLUtessellator tessellator, int which, double value)
Definition: GLU.java:340
static final double GLU_TESS_MAX_COORD
Definition: GLU.java:1249
int gluBuild1DMipmaps(int target, int internalFormat, int width, int format, int type, java.nio.Buffer data)
Optional, throws GLException if not available in profile.
Definition: GLU.java:1508
static final int GLU_VERSION
Definition: GLU.java:1058
static final int GLU_END
Definition: GLU.java:1201
static final int GLU_CCW
Definition: GLU.java:1215
void gluOrtho2D(float left, float right, float bottom, float top)
Definition: GLU.java:1358
boolean isFunctionAvailable(String gluFunctionName)
Returns true if the specified GLU core- or extension-function can be successfully used through this G...
Definition: GLU.java:110
static final GLU createGLU(GL gl)
Instantiates a GLU implementation object in respect to the given GL profile of the given GL.
Definition: GLU.java:155
static final int GLU_NONE
Definition: GLU.java:1085
static final int GLU_BEGIN
Definition: GLU.java:1197
ShaderState allows to sharing data between shader programs, while updating the attribute and uniform ...
boolean isGL2ES2()
Indicates whether this GL object conforms to a GL2ES2 compatible profile.
Wrapper for a GLU quadric object.
Definition: GLUquadric.java:10
GLUtessellatorCallback interface provides methods that the user will override to define the callbacks...
The GLUtessellator object is used to hold the data, such as the vertices, edges and callback objects,...