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

public Class DemoBox

extends Frame
Class Inheritance
Imports
java.awt.BorderLayout, .Button, .Frame, .GridBagConstraints, .GridBagLayout, .Label, .List, .Panel, java.awt.event.ActionEvent, .ActionListener, .ItemEvent, .ItemListener, .WindowAdapter, .WindowEvent, java.nio.FloatBuffer, java.util.Enumeration, .Hashtable, org.lwjgl.BufferUtils, .LWJGLException, org.lwjgl.opengl.AWTGLCanvas, .GLContext

Author
Brian Matzon $Id$
Version
$Revision$

Nested and Inner Type Summary

Modifier and TypeClass and Description
public class
public static interface
DemoBox.Demo

Interface for a demo

private class
public class
public class

Field Summary

Modifier and TypeField and Description
private DemoBox.DemoBoxGLCanvas
demoCanvas

GL canvas

private Hashtable<String, DemoBox.Demo>
selectableDemos

Hashtable of demos

private Panel
selectionPanel

Demo selection panel

Inherited from java.awt.Frame:
CROSSHAIR_CURSORDEFAULT_CURSORE_RESIZE_CURSORHAND_CURSORICONIFIEDMAXIMIZED_BOTHMAXIMIZED_HORIZMAXIMIZED_VERTMOVE_CURSORN_RESIZE_CURSORNE_RESIZE_CURSORNORMALNW_RESIZE_CURSORS_RESIZE_CURSORSE_RESIZE_CURSORSW_RESIZE_CURSORTEXT_CURSORW_RESIZE_CURSORWAIT_CURSOR

Constructor Summary

AccessConstructor and Description
public
DemoBox()

Creates a new demo box instance

Method Summary

Modifier and TypeMethod and Description
protected void
demoSelected(String
Name of demo that was selected
demo
)

Selected a demo

public boolean
public static void
main(String[] args)

protected void
toggleFullscreen()

Enter fullscreen mode for this demo

public void
updateFPS(float fps)

Inherited from java.awt.Frame:
addNotifygetAccessibleContextgetCursorTypegetExtendedStategetFramesgetIconImagegetMaximizedBoundsgetMenuBargetStategetTitleisResizableisUndecoratedparamStringremoveremoveNotifysetBackgroundsetCursorsetExtendedStatesetIconImagesetMaximizedBoundssetMenuBarsetOpacitysetResizablesetShapesetStatesetTitlesetUndecorated

Field Detail

demoCanvasback to summary
private DemoBox.DemoBoxGLCanvas demoCanvas

GL canvas

selectableDemosback to summary
private Hashtable<String, DemoBox.Demo> selectableDemos

Hashtable of demos

selectionPanelback to summary
private Panel selectionPanel

Demo selection panel

Constructor Detail

DemoBoxback to summary
public DemoBox()

Creates a new demo box instance

Method Detail

demoSelectedback to summary
protected void demoSelected(String demo)

Selected a demo

Parameters
demo:String

Name of demo that was selected

initializeback to summary
public boolean initialize()
mainback to summary
public static void main(String[] args) throws LWJGLException
toggleFullscreenback to summary
protected void toggleFullscreen()

Enter fullscreen mode for this demo

updateFPSback to summary
public void updateFPS(float fps)
org.lwjgl.test.opengl.awt back to summary

public Class DemoBox.ClearColorDemoBox

extends Object
implements Demo
Class Inheritance
All Implemented Interfaces
org.lwjgl.test.opengl.awt.DemoBox.Demo

Field Summary

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

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
public boolean
public boolean
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

colorback to summary
pack-priv float color
directionback to summary
pack-priv int direction
initializedback to summary
private boolean initialized

Constructor Detail

ClearColorDemoBoxback to summary
public ClearColorDemoBox()

Method Detail

destroyback to summary
public void destroy()

Implements org.lwjgl.test.opengl.awt.DemoBox.Demo.destroy.

initializeback to summary
public boolean initialize()

Implements org.lwjgl.test.opengl.awt.DemoBox.Demo.initialize.

isInitializedback to summary
public boolean isInitialized()

Implements org.lwjgl.test.opengl.awt.DemoBox.Demo.isInitialized.

renderback to summary
public void render()

Implements org.lwjgl.test.opengl.awt.DemoBox.Demo.render.

org.lwjgl.test.opengl.awt back to summary

public Interface DemoBox.Demo

Known Direct Implementers
org.lwjgl.test.opengl.awt.DemoBox.ClearColorDemoBox, org.lwjgl.test.opengl.awt.DemoBox.NullDemoBox, org.lwjgl.test.opengl.awt.DemoBox.GearsDemoBox

Interface for a demo

Method Summary

Modifier and TypeMethod and Description
public void
public boolean
public boolean
public void

Method Detail

destroyback to summary
public void destroy()
initializeback to summary
public boolean initialize()
isInitializedback to summary
public boolean isInitialized()
renderback to summary
public void render()
org.lwjgl.test.opengl.awt back to summary

private Class DemoBox.DemoBoxGLCanvas

extends AWTGLCanvas
implements Runnable
Class Inheritance
All Implemented Interfaces
java.lang.Runnable

Field Summary

Modifier and TypeField and Description
pack-priv DemoBox.Demo
activeDemo

Currently active demo

pack-priv long
pack-priv DemoBox.Demo
lastActiveDemo

last active demo

pack-priv DemoBox
parent

Hides java.awt.Component.parent.

Parent demo box
private Thread
renderThread

Render thread

pack-priv long

Constructor Summary

AccessConstructor and Description
private
private

Method Summary

Modifier and TypeMethod and Description
public void
protected void
paintGL()

Overrides org.lwjgl.opengl.AWTGLCanvas.paintGL.

Override this to do painting
public void
run()

Implements java.lang.Runnable.run.

Runs this operation.
public void
private void
sleep(long time)

Inherited from org.lwjgl.opengl.AWTGLCanvas:
addNotifycheckGLErrorcomponentHiddencomponentMovedcomponentResizedcomponentShowncreateSharedContextdestroyexceptionOccurredgetContextgetPixelFormathierarchyChangedinitContextinitGLisCurrentmakeCurrentpaintreleaseContextremoveNotifysetBoundssetCLSharingPropertiessetLocationsetLocationsetPixelFormatsetPixelFormatsetSizesetSizesetSwapIntervalsetVSyncEnabledswapBuffersupdate

Field Detail

activeDemoback to summary
pack-priv DemoBox.Demo activeDemo

Currently active demo

fpsback to summary
pack-priv long fps
lastActiveDemoback to summary
pack-priv DemoBox.Demo lastActiveDemo

last active demo

parentback to summary
pack-priv DemoBox parent

Hides java.awt.Component.parent.

Parent demo box

renderThreadback to summary
private Thread renderThread

Render thread

startTimeback to summary
pack-priv long startTime

Constructor Detail

DemoBoxGLCanvasback to summary
private DemoBoxGLCanvas(DemoBox parent) throws LWJGLException
DemoBoxGLCanvasback to summary
private DemoBoxGLCanvas() throws LWJGLException

Method Detail

destroyCanvasback to summary
public void destroyCanvas()
paintGLback to summary
protected void paintGL()

Overrides org.lwjgl.opengl.AWTGLCanvas.paintGL.

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

Override this to do painting

runback to summary
public void run()

Implements java.lang.Runnable.run.

Doc from java.lang.Runnable.run.

Runs this operation.

setActiveDemoback to summary
public void setActiveDemo(DemoBox.Demo activeDemo)
sleepback to summary
private void sleep(long time)
org.lwjgl.test.opengl.awt back to summary

public Class DemoBox.GearsDemoBox

extends Object
implements Demo
Class Inheritance
All Implemented Interfaces
org.lwjgl.test.opengl.awt.DemoBox.Demo

Field Summary

Modifier and TypeField and Description
private float
private int
private int
private int
private boolean
private float
private float
private float

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
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 boolean
public boolean
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

angleback to summary
private float angle
gear1back to summary
private int gear1
gear2back to summary
private int gear2
gear3back to summary
private int gear3
initializedback to summary
private boolean initialized
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

GearsDemoBoxback to summary
public GearsDemoBox()

Method Detail

destroyback to summary
public void destroy()

Implements org.lwjgl.test.opengl.awt.DemoBox.Demo.destroy.

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

initializeback to summary
public boolean initialize()

Implements org.lwjgl.test.opengl.awt.DemoBox.Demo.initialize.

isInitializedback to summary
public boolean isInitialized()

Implements org.lwjgl.test.opengl.awt.DemoBox.Demo.isInitialized.

renderback to summary
public void render()

Implements org.lwjgl.test.opengl.awt.DemoBox.Demo.render.

org.lwjgl.test.opengl.awt back to summary

public Class DemoBox.NullDemoBox

extends Object
implements Demo
Class Inheritance
All Implemented Interfaces
org.lwjgl.test.opengl.awt.DemoBox.Demo

Field Summary

Modifier and TypeField and Description
private boolean

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
public boolean
public boolean
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

initializedback to summary
private boolean initialized

Constructor Detail

NullDemoBoxback to summary
public NullDemoBox()

Method Detail

destroyback to summary
public void destroy()

Implements org.lwjgl.test.opengl.awt.DemoBox.Demo.destroy.

initializeback to summary
public boolean initialize()

Implements org.lwjgl.test.opengl.awt.DemoBox.Demo.initialize.

isInitializedback to summary
public boolean isInitialized()

Implements org.lwjgl.test.opengl.awt.DemoBox.Demo.isInitialized.

renderback to summary
public void render()

Implements org.lwjgl.test.opengl.awt.DemoBox.Demo.render.