Top Description Fields Constructors Methods
com.jogamp.opengl.util.gl2

public Class GLUT

extends Object
Class Inheritance
Imports
com.jogamp.opengl.*, com.jogamp.opengl.fixedfunc.GLLightingFunc, com.jogamp.opengl.glu.*, com.jogamp.opengl.glu.gl2.*

Subset of the routines provided by the GLUT interface. Note the signatures of many of the methods are necessarily different than the corresponding C version. A GLUT object must only be used from one particular thread at a time.

Copyright (c) Mark J. Kilgard, 1994, 1997.

(c) Copyright 1993, Silicon Graphics, Inc.

ALL RIGHTS RESERVED

Permission to use, copy, modify, and distribute this software for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both the copyright notice and this permission notice appear in supporting documentation, and that the name of Silicon Graphics, Inc. not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission.

THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.

US Government Users Restricted Rights

Use, duplication, or disclosure by the Government is subject to restrictions set forth in FAR 52.227.19(c)(2) or subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Software clause at DFARS 252.227-7013 and/or in similar or successor clauses in the FAR or the DOD or NASA FAR Supplement. Unpublished-- rights reserved under the copyright laws of the United States. Contractor/manufacturer is Silicon Graphics, Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311.

OpenGL(TM) is a trademark of Silicon Graphics, Inc.

Field Summary

Modifier and TypeField and Description
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
private static final BitmapFontRec[]
private static final int[][]
private static final float[][]
private static float[][]
private float[][]
private final GLUgl2
private static final float[][]
private static final int[][]
private static final float[][]
private static final int[][]
private GLUquadric
private static final double[][]
private static final double[][]
private static final int[][]
public static final int
public static final int
private static final StrokeFontRec[]
private static final float
T

private static final float[][]
private static final float[][]
private static final int[][]
private static final float[]
private static final int[][]
private static final float
X

private static final float
Z

Constructor Summary

AccessConstructor and Description
public
GLUT()

Method Summary

Modifier and TypeMethod and Description
private static void
beginBitmap(final GL2 gl, final int[] swapbytes, final int[] lsbfirst, final int[] rowlength, final int[] skiprows, final int[] skippixels, final int[] alignment)

private static void
bitmapCharacterImpl(final GL2 gl, final int font, final char cin)

private static void
crossprod(final float[] v1, final float[] v2, final float[] prod)

private static void
diff3(final float[] a, final float[] b, final float[] c)

private void
dodecahedron(final GL2 gl, final int type)

private static void
doughnut(final GL2 gl, final double r, final double R, final int nsides, final int rings)

private void
drawBox(final GL2 gl, final float size, final int type)

private static void
drawtriangle(final GL2 gl, final int i, final float[][] data, final int[][] ndx, final int shadeType)

private static void
endBitmap(final GL2 gl, final int[] swapbytes, final int[] lsbfirst, final int[] rowlength, final int[] skiprows, final int[] skippixels, final int[] alignment)

private static void
evaluateTeapotMesh(final GL2 gl, final int grid, final int type, final int partNum, final boolean repairSingularities)

private static BitmapFontRec
getBitmapFont(final int font)

private static StrokeFontRec
getStrokeFont(final int font)

public void
glutBitmapCharacter(final int font, final char character)

public int
glutBitmapLength(final int font, final String string)

public void
glutBitmapString(final int font, final String string)

public int
glutBitmapWidth(final int font, final char character)

public void
glutSolidCone(final double base, final double height, final int slices, final int stacks)

public void
glutSolidCube(final float size)

public void
glutSolidCylinder(final double radius, final double height, final int slices, final int stacks)

public void
public void
public void
public void
glutSolidRhombicDodecahedron()

This function draws a solid-shaded dodecahedron whose facets are rhombic and whose vertices are at unit radius.

public void
glutSolidSphere(final double radius, final int slices, final int stacks)

public void
glutSolidTeapot(final double
the factor by which to scale the teapot
scale
)

Renders the teapot as a solid shape of the specified size.

public void
glutSolidTeapot(final double
the factor by which to scale the teapot
scale
,
final boolean
whether to create the teapot in exactly the same way as in the C implementation of GLUT
cStyle
)

Renders the teapot as a solid shape of the specified size.

public void
public void
glutSolidTorus(final double innerRadius, final double outerRadius, final int nsides, final int rings)

public void
glutStrokeCharacter(final int font, final char character)

public int
glutStrokeLength(final int font, final String string)

public float
glutStrokeLengthf(final int font, final String string)

public void
glutStrokeString(final int font, final String string)

public int
glutStrokeWidth(final int font, final char character)

public float
glutStrokeWidthf(final int font, final char character)

public void
glutWireCone(final double base, final double height, final int slices, final int stacks)

public void
glutWireCube(final float size)

public void
glutWireCylinder(final double radius, final double height, final int slices, final int stacks)

public void
public void
public void
public void
glutWireRhombicDodecahedron()

This function draws a wireframe dodecahedron whose facets are rhombic and whose vertices are at unit radius.

public void
glutWireSphere(final double radius, final int slices, final int stacks)

public void
glutWireTeapot(final double
the factor by which to scale the teapot
scale
)

Renders the teapot as a wireframe shape of the specified size.

public void
glutWireTeapot(final double
the factor by which to scale the teapot
scale
,
final boolean
whether to create the teapot in exactly the same way as in the C implementation of GLUT
cStyle
)

Renders the teapot as a wireframe shape of the specified size.

public void
public void
glutWireTorus(final double innerRadius, final double outerRadius, final int nsides, final int rings)

private static void
icosahedron(final GL2 gl, final int shadeType)

private void
private static void
normalize(final float[] v)

private static void
octahedron(final GL2 gl, final int shadeType)

private void
pentagon(final GL2 gl, final int a, final int b, final int c, final int d, final int e, final int shadeType)

private void
quadObjInit(final GLUgl2 glu)

private static void
recorditem(final GL2 gl, final float[] n1, final float[] n2, final float[] n3, final int shadeType)

private static void
subdivide(final GL2 gl, final float[] v0, final float[] v1, final float[] v2, final int shadeType)

private static void
teapot(final GL2 gl, final int grid, final double scale, final int type, final boolean backCompatible)

private static final void
tetrahedron(final GL2 gl, final int shadeType)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

BITMAP_8_BY_13back to summary
public static final int BITMAP_8_BY_13
BITMAP_9_BY_15back to summary
public static final int BITMAP_9_BY_15
BITMAP_HELVETICA_10back to summary
public static final int BITMAP_HELVETICA_10
BITMAP_HELVETICA_12back to summary
public static final int BITMAP_HELVETICA_12
BITMAP_HELVETICA_18back to summary
public static final int BITMAP_HELVETICA_18
BITMAP_TIMES_ROMAN_10back to summary
public static final int BITMAP_TIMES_ROMAN_10
BITMAP_TIMES_ROMAN_24back to summary
public static final int BITMAP_TIMES_ROMAN_24
bitmapFontsback to summary
private static final BitmapFontRec[] bitmapFonts
boxFacesback to summary
private static final int[][] boxFaces
boxNormalsback to summary
private static final float[][] boxNormals
boxVerticesback to summary
private static float[][] boxVertices
dodecback to summary
private float[][] dodec
gluback to summary
private final GLUgl2 glu
idataback to summary
private static final float[][] idata
indexback to summary
private static final int[][] index
odataback to summary
private static final float[][] odata
ondexback to summary
private static final int[][] ondex
quadObjback to summary
private GLUquadric quadObj
rdod_nback to summary
private static final double[][] rdod_n
rdod_rback to summary
private static final double[][] rdod_r
rdod_vback to summary
private static final int[][] rdod_v
STROKE_MONO_ROMANback to summary
public static final int STROKE_MONO_ROMAN
STROKE_ROMANback to summary
public static final int STROKE_ROMAN
strokeFontsback to summary
private static final StrokeFontRec[] strokeFonts
Tback to summary
private static final float T
tdataback to summary
private static final float[][] tdata
teapotCPDataback to summary
private static final float[][] teapotCPData
teapotPatchDataback to summary
private static final int[][] teapotPatchData
teapotTexback to summary
private static final float[] teapotTex
tndexback to summary
private static final int[][] tndex
Xback to summary
private static final float X
Zback to summary
private static final float Z

Constructor Detail

GLUTback to summary
public GLUT()

Method Detail

beginBitmapback to summary
private static void beginBitmap(final GL2 gl, final int[] swapbytes, final int[] lsbfirst, final int[] rowlength, final int[] skiprows, final int[] skippixels, final int[] alignment)
bitmapCharacterImplback to summary
private static void bitmapCharacterImpl(final GL2 gl, final int font, final char cin)
crossprodback to summary
private static void crossprod(final float[] v1, final float[] v2, final float[] prod)
diff3back to summary
private static void diff3(final float[] a, final float[] b, final float[] c)
dodecahedronback to summary
private void dodecahedron(final GL2 gl, final int type)
doughnutback to summary
private static void doughnut(final GL2 gl, final double r, final double R, final int nsides, final int rings)
drawBoxback to summary
private void drawBox(final GL2 gl, final float size, final int type)
drawtriangleback to summary
private static void drawtriangle(final GL2 gl, final int i, final float[][] data, final int[][] ndx, final int shadeType)
endBitmapback to summary
private static void endBitmap(final GL2 gl, final int[] swapbytes, final int[] lsbfirst, final int[] rowlength, final int[] skiprows, final int[] skippixels, final int[] alignment)
evaluateTeapotMeshback to summary
private static void evaluateTeapotMesh(final GL2 gl, final int grid, final int type, final int partNum, final boolean repairSingularities)
getBitmapFontback to summary
private static BitmapFontRec getBitmapFont(final int font)
getStrokeFontback to summary
private static StrokeFontRec getStrokeFont(final int font)
glutBitmapCharacterback to summary
public void glutBitmapCharacter(final int font, final char character)
glutBitmapLengthback to summary
public int glutBitmapLength(final int font, final String string)
glutBitmapStringback to summary
public void glutBitmapString(final int font, final String string)
glutBitmapWidthback to summary
public int glutBitmapWidth(final int font, final char character)
glutSolidConeback to summary
public void glutSolidCone(final double base, final double height, final int slices, final int stacks)
glutSolidCubeback to summary
public void glutSolidCube(final float size)
glutSolidCylinderback to summary
public void glutSolidCylinder(final double radius, final double height, final int slices, final int stacks)
glutSolidDodecahedronback to summary
public void glutSolidDodecahedron()
glutSolidIcosahedronback to summary
public void glutSolidIcosahedron()
glutSolidOctahedronback to summary
public void glutSolidOctahedron()
glutSolidRhombicDodecahedronback to summary
public void glutSolidRhombicDodecahedron()

This function draws a solid-shaded dodecahedron whose facets are rhombic and whose vertices are at unit radius. No facet lies normal to any coordinate axes. The polyhedron is centered at the origin.

glutSolidSphereback to summary
public void glutSolidSphere(final double radius, final int slices, final int stacks)
glutSolidTeapotback to summary
public void glutSolidTeapot(final double scale)

Renders the teapot as a solid shape of the specified size. The teapot is created in a way that replicates the C GLUT implementation.

Parameters
scale:double

the factor by which to scale the teapot

glutSolidTeapotback to summary
public void glutSolidTeapot(final double scale, final boolean cStyle)

Renders the teapot as a solid shape of the specified size. The teapot can either be created in a way that is backward-compatible with the standard C glut library (i.e. broken), or in a more pleasing way (i.e. with surfaces whose front-faces point outwards and standing on the z=0 plane, instead of the y=-1 plane). Both surface normals and texture coordinates for the teapot are generated. The teapot is generated with OpenGL evaluators.

Parameters
scale:double

the factor by which to scale the teapot

cStyle:boolean

whether to create the teapot in exactly the same way as in the C implementation of GLUT

glutSolidTetrahedronback to summary
public void glutSolidTetrahedron()
glutSolidTorusback to summary
public void glutSolidTorus(final double innerRadius, final double outerRadius, final int nsides, final int rings)
glutStrokeCharacterback to summary
public void glutStrokeCharacter(final int font, final char character)
glutStrokeLengthback to summary
public int glutStrokeLength(final int font, final String string)
glutStrokeLengthfback to summary
public float glutStrokeLengthf(final int font, final String string)
glutStrokeStringback to summary
public void glutStrokeString(final int font, final String string)
glutStrokeWidthback to summary
public int glutStrokeWidth(final int font, final char character)
glutStrokeWidthfback to summary
public float glutStrokeWidthf(final int font, final char character)
glutWireConeback to summary
public void glutWireCone(final double base, final double height, final int slices, final int stacks)
glutWireCubeback to summary
public void glutWireCube(final float size)
glutWireCylinderback to summary
public void glutWireCylinder(final double radius, final double height, final int slices, final int stacks)
glutWireDodecahedronback to summary
public void glutWireDodecahedron()
glutWireIcosahedronback to summary
public void glutWireIcosahedron()
glutWireOctahedronback to summary
public void glutWireOctahedron()
glutWireRhombicDodecahedronback to summary
public void glutWireRhombicDodecahedron()

This function draws a wireframe dodecahedron whose facets are rhombic and whose vertices are at unit radius. No facet lies normal to any coordinate axes. The polyhedron is centered at the origin.

glutWireSphereback to summary
public void glutWireSphere(final double radius, final int slices, final int stacks)
glutWireTeapotback to summary
public void glutWireTeapot(final double scale)

Renders the teapot as a wireframe shape of the specified size. The teapot is created in a way that replicates the C GLUT implementation.

Parameters
scale:double

the factor by which to scale the teapot

glutWireTeapotback to summary
public void glutWireTeapot(final double scale, final boolean cStyle)

Renders the teapot as a wireframe shape of the specified size. The teapot can either be created in a way that is backward-compatible with the standard C glut library (i.e. broken), or in a more pleasing way (i.e. with surfaces whose front-faces point outwards and standing on the z=0 plane, instead of the y=-1 plane). Both surface normals and texture coordinates for the teapot are generated. The teapot is generated with OpenGL evaluators.

Parameters
scale:double

the factor by which to scale the teapot

cStyle:boolean

whether to create the teapot in exactly the same way as in the C implementation of GLUT

glutWireTetrahedronback to summary
public void glutWireTetrahedron()
glutWireTorusback to summary
public void glutWireTorus(final double innerRadius, final double outerRadius, final int nsides, final int rings)
icosahedronback to summary
private static void icosahedron(final GL2 gl, final int shadeType)
initDodecahedronback to summary
private void initDodecahedron()
normalizeback to summary
private static void normalize(final float[] v)
octahedronback to summary
private static void octahedron(final GL2 gl, final int shadeType)
pentagonback to summary
private void pentagon(final GL2 gl, final int a, final int b, final int c, final int d, final int e, final int shadeType)
quadObjInitback to summary
private void quadObjInit(final GLUgl2 glu)
recorditemback to summary
private static void recorditem(final GL2 gl, final float[] n1, final float[] n2, final float[] n3, final int shadeType)
subdivideback to summary
private static void subdivide(final GL2 gl, final float[] v0, final float[] v1, final float[] v2, final int shadeType)
teapotback to summary
private static void teapot(final GL2 gl, final int grid, final double scale, final int type, final boolean backCompatible)
tetrahedronback to summary
private static final void tetrahedron(final GL2 gl, final int shadeType)