Top Description Fields Constructors Methods
org.lwjgl.test.opengl.awt

public Class AWTGearsCanvas

extends AWTGLCanvas
implements Test
Class Inheritance
All Implemented Interfaces
org.lwjgl.test.applet.Test
Imports
java.nio.FloatBuffer, org.lwjgl.BufferUtils, .LWJGLException, org.lwjgl.opengl.AWTGLCanvas, .GLContext, org.lwjgl.test.applet.Test

AWT version of the gears demo

Author
Brian Matzon $Id$
Version
$Revision$

Field Summary

Modifier and TypeField and Description
private float
pack-priv int
pack-priv int
pack-priv long
private int
private int
private int
pack-priv long
private float
private float
private float

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
gear(float
radius of hole at center
inner_radius
,
float
radius at center of teeth
outer_radius
,
float
width of gear
width
,
int
number of teeth
teeth
,
float
depth of tooth
tooth_depth
)

Draw a gear wheel.

public void
paintGL()

Overrides org.lwjgl.opengl.AWTGLCanvas.paintGL.

Override this to do painting
private void
public void
public void
Inherited from org.lwjgl.opengl.AWTGLCanvas:
addNotifycheckGLErrorcomponentHiddencomponentMovedcomponentResizedcomponentShowncreateSharedContextdestroyexceptionOccurredgetContextgetPixelFormathierarchyChangedinitContextinitGLisCurrentmakeCurrentpaintreleaseContextremoveNotifysetBoundssetCLSharingPropertiessetLocationsetLocationsetPixelFormatsetPixelFormatsetSizesetSizesetSwapIntervalsetVSyncEnabledswapBuffersupdate

Field Detail

angleback to summary
private float angle
current_heightback to summary
pack-priv int current_height
current_widthback to summary
pack-priv int current_width
fpsback to summary
pack-priv long fps
gear1back to summary
private int gear1
gear2back to summary
private int gear2
gear3back to summary
private int gear3
startTimeback to summary
pack-priv long startTime
view_rotxback to summary
private float view_rotx
view_rotyback to summary
private float view_roty
view_rotzback to summary
private float view_rotz

Constructor Detail

AWTGearsCanvasback to summary
public AWTGearsCanvas() throws LWJGLException

C'tor

Method Detail

gearback to summary
private void gear(float inner_radius, float outer_radius, float width, int teeth, float tooth_depth)

Draw a gear wheel. You'll probably want to call this function when building a display list since we do a lot of trig here.

Parameters
inner_radius:float

radius of hole at center

outer_radius:float

radius at center of teeth

width:float

width of gear

teeth:int

number of teeth

tooth_depth:float

depth of tooth

paintGLback to summary
public void paintGL()

Overrides org.lwjgl.opengl.AWTGLCanvas.paintGL.

Doc from org.lwjgl.opengl.AWTGLCanvas.paintGL.

Override this to do painting

setupback to summary
private void setup()
startback to summary
public void start()

Implements org.lwjgl.test.applet.Test.start.

stopback to summary
public void stop()

Implements org.lwjgl.test.applet.Test.stop.