Package jgl.wt.awt
Class GLUT
java.lang.Object
jgl.wt.awt.GLUT
- All Implemented Interfaces:
Runnable
GLUT is the glut class of jGL 2.4.
- Version:
- 0.3, 10 May 2003
- Author:
- Robin Bing-Yu Chen
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
Constants of glutstatic final int
static final int
static final int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionauxGetGL()
protected double[]
protected double[]
protected int[]
void
glutAddMenuEntry
(String label, int value) void glutAddMenuEntry (const char *label, int value)void
glutAddSubMenu
(String label, int submenu) void glutAddSubMenu (const char *label, int submenu)void
glutAttachMenu
(int button) void glutAttachMenu (int button)void
glutBitmapString
(Font font, String string, float x, float y) Print string at the specified 2d position.void
glutBitmapString
(Font font, String string, float x, float y, float z, float r, float g, float b, float rotate) Print string at the specified 3d position.void
glutChangeToMenuEntry
(int item, String label, int value) void glutChangeToMenuEntry (int item, const char *label, int value)void
glutChangeToSubMenu
(int item, String label, int submenu) void glutChangeToSubMenu (int item, const char *label, int submenu)int
glutCreateMenu
(String func) int glutCreateMenu (void (*)(int))void
void
int glutCreateWindow (const char *title)void
glutDestroyMenu
(int menu) void glutDestroyMenu (int menu)void
glutDetachMenu
(int button) void glutDetachMenu (int button)void
glutDisplayFunc
(String func) Deprecated.void
glutDisplayFunc
(Consumer<Component> displayFunc) int
int glutGetMenu (void)int
int glutGetModifiers (void)void
glutIdleFunc
(String func) Deprecated.void
glutIdleFunc
(Consumer<Component> idleFunc) void
glutInitWindowPosition
(int x, int y) void glutInitWindowPosition (int x, int y)void
glutInitWindowSize
(int width, int height) void glutInitWindowSize (int width, int height)void
glutKeyboardFunc
(String func) Deprecated.void
glutKeyboardFunc
(KeyboardCallback keyboardFunc) void
glutKeyboardUpFunc
(String func) Deprecated.void
glutKeyboardUpFunc
(KeyboardCallback keyboardFunc) void
void glutMainLoop ()void
glutMotionFunc
(String func) Deprecated.void
glutMotionFunc
(MotionCallback motionFunc) void
glutMouseFunc
(String func) Deprecated.void
glutMouseFunc
(MouseCallback mouseFunc) void
void glutPostRedisplay ()void
glutRemoveMenuItem
(int item) void glutRemoveMenuItem (int item)void
glutReshapeFunc
(String func) Deprecated.void
glutReshapeFunc
(ReshapeCallback reshapeFunc) void
glutSetListener
(GLUTListener listener) Sets listener for scene rendering pipeline.void
glutSetMenu
(int menu) void glutSetMenu (int menu)void
glutSolidCone
(double base, double height, int slices, int stacks) void glutSolidCone (GLdouble base, GLdouble height, GLint slices, GLint stacks)void
glutSolidCube
(double size) void glutSolidCube (GLdouble size)void
void glutWireIcosahedron (void)void
glutSolidSphere
(double radius, int slices, int stacks) void glutSolidSphere (GLdouble radius, GLint slices, GLint stacks)void
glutSolidTeapot
(double scale) void glutSolidTeapot (GLdouble scale)void
glutSolidTorus
(double innerRadius, double outerRadius, int nsides, int rings) void glutSolidTorus (GLdouble innerRadius, GLdouble outerRadius, GLint nsides, GLint rings)void
glutSpecialFunc
(String func) Deprecated.void
glutSpecialFunc
(KeyboardCallback keyboardFunc) void
glutSpecialUpFunc
(String func) Deprecated.void
glutSpecialUpFunc
(KeyboardCallback keyboardFunc) void
glutSwapBuffers
(Graphics g, Applet o) void
void glutSwapBuffers ()void
glutTimerFunc
(int millis, String func, int value) void glutTimerFunc (unsigned int millis, void (*func)(int value), int value)void
glutWireCone
(double base, double height, int slices, int stacks) void glutWireCone (GLdouble base, GLdouble height, GLint slices, GLint stacks)void
glutWireCube
(double size) void glutWireCube (GLdouble size)void
void glutWireIcosahedron (void)void
glutWireSphere
(double radius, int slices, int stacks) void glutWireSphere (GLdouble radius, GLint slices, GLint stacks)void
glutWireTeapot
(double scale) void glutWireTeapot (GLdouble scale)void
glutWireTorus
(double innerRadius, double outerRadius, int nsides, int rings) void glutWireTorus (GLdouble innerRadius, GLdouble outerRadius, GLint nsides, GLint rings)protected double[]
modelToScreen
(float x, float y, float z) void
Process component events, i.e. events sent by theGLCanvas
displaying the GL image generated byGL.glFlush()
.void
GLUT window callback sub-API to handle events from canvas, mouse or keyboard.void
void
void
Process mouse motion events.void
run()
-
Field Details
-
GLUT_LEFT_BUTTON
public static final int GLUT_LEFT_BUTTONConstants of glut- See Also:
-
GLUT_MIDDLE_BUTTON
public static final int GLUT_MIDDLE_BUTTON- See Also:
-
GLUT_RIGHT_BUTTON
public static final int GLUT_RIGHT_BUTTON- See Also:
-
GLUT_DOWN
public static final int GLUT_DOWN- See Also:
-
GLUT_UP
public static final int GLUT_UP- See Also:
-
GLUT_ACTIVE_SHIFT
public static final int GLUT_ACTIVE_SHIFT- See Also:
-
GLUT_ACTIVE_CTRL
public static final int GLUT_ACTIVE_CTRL- See Also:
-
GLUT_ACTIVE_ALT
public static final int GLUT_ACTIVE_ALT- See Also:
-
GLUT_KEY_F1
public static final int GLUT_KEY_F1- See Also:
-
GLUT_KEY_F2
public static final int GLUT_KEY_F2- See Also:
-
GLUT_KEY_F3
public static final int GLUT_KEY_F3- See Also:
-
GLUT_KEY_F4
public static final int GLUT_KEY_F4- See Also:
-
GLUT_KEY_F5
public static final int GLUT_KEY_F5- See Also:
-
GLUT_KEY_F6
public static final int GLUT_KEY_F6- See Also:
-
GLUT_KEY_F7
public static final int GLUT_KEY_F7- See Also:
-
GLUT_KEY_F8
public static final int GLUT_KEY_F8- See Also:
-
GLUT_KEY_F9
public static final int GLUT_KEY_F9- See Also:
-
GLUT_KEY_F10
public static final int GLUT_KEY_F10- See Also:
-
GLUT_KEY_F11
public static final int GLUT_KEY_F11- See Also:
-
GLUT_KEY_F12
public static final int GLUT_KEY_F12- See Also:
-
GLUT_KEY_LEFT
public static final int GLUT_KEY_LEFT- See Also:
-
GLUT_KEY_UP
public static final int GLUT_KEY_UP- See Also:
-
GLUT_KEY_RIGHT
public static final int GLUT_KEY_RIGHT- See Also:
-
GLUT_KEY_DOWN
public static final int GLUT_KEY_DOWN- See Also:
-
GLUT_KEY_PAGE_UP
public static final int GLUT_KEY_PAGE_UP- See Also:
-
GLUT_KEY_PAGE_DOWN
public static final int GLUT_KEY_PAGE_DOWN- See Also:
-
GLUT_KEY_HOME
public static final int GLUT_KEY_HOME- See Also:
-
GLUT_KEY_END
public static final int GLUT_KEY_END- See Also:
-
GLUT_KEY_INSERT
public static final int GLUT_KEY_INSERT- See Also:
-
-
Constructor Details
-
GLUT
-
-
Method Details
-
glutSetListener
Sets listener for scene rendering pipeline.- Parameters:
listener
- Listener that receives callbacks on GL events.
-
glutBitmapString
Print string at the specified 2d position. This method is not following exactly the GLUT interface. Printing text in OpenGL usually requires such code :gl.glColor3f(r, g, b); gl.glRasterPos3f(x, y, z); glut.glutBitmapString(font, string);
-
glutBitmapString
public void glutBitmapString(Font font, String string, float x, float y, float z, float r, float g, float b, float rotate) Print string at the specified 3d position. This method is not following exactly the GLUT interface. Printing text in OpenGL usually requires such code :gl.glColor3f(r, g, b); gl.glRasterPos3f(x, y, z); glut.glutBitmapString(int font, string);
glut.glutBitmapString(java.awt.Font, java.lang.String, x, y, z, r, g, b);
invalid @link
GL#appendTextToDraw(Font, String, int, int, float, float, float)
GL.glFlush()
-
modelToScreen
protected double[] modelToScreen(float x, float y, float z) -
getViewPortAsInt
protected int[] getViewPortAsInt() -
getModelViewAsDouble
protected double[] getModelViewAsDouble() -
getProjectionAsDouble
protected double[] getProjectionAsDouble() -
auxGetGL
-
auxGetGLU
-
glutInitWindowPosition
public void glutInitWindowPosition(int x, int y) void glutInitWindowPosition (int x, int y) -
glutInitWindowSize
public void glutInitWindowSize(int width, int height) void glutInitWindowSize (int width, int height) -
glutMainLoop
public void glutMainLoop()void glutMainLoop () -
glutCreateWindow
int glutCreateWindow (const char *title) -
glutCreateWindow
-
glutPostRedisplay
public void glutPostRedisplay()void glutPostRedisplay () -
glutSwapBuffers
void glutSwapBuffers () -
glutSwapBuffers
-
glutWireSphere
public void glutWireSphere(double radius, int slices, int stacks) void glutWireSphere (GLdouble radius, GLint slices, GLint stacks) -
glutSolidSphere
public void glutSolidSphere(double radius, int slices, int stacks) void glutSolidSphere (GLdouble radius, GLint slices, GLint stacks) -
glutWireCone
public void glutWireCone(double base, double height, int slices, int stacks) void glutWireCone (GLdouble base, GLdouble height, GLint slices, GLint stacks) -
glutSolidCone
public void glutSolidCone(double base, double height, int slices, int stacks) void glutSolidCone (GLdouble base, GLdouble height, GLint slices, GLint stacks) -
glutWireCube
public void glutWireCube(double size) void glutWireCube (GLdouble size) -
glutSolidCube
public void glutSolidCube(double size) void glutSolidCube (GLdouble size) -
glutWireTorus
public void glutWireTorus(double innerRadius, double outerRadius, int nsides, int rings) void glutWireTorus (GLdouble innerRadius, GLdouble outerRadius, GLint nsides, GLint rings) -
glutSolidTorus
public void glutSolidTorus(double innerRadius, double outerRadius, int nsides, int rings) void glutSolidTorus (GLdouble innerRadius, GLdouble outerRadius, GLint nsides, GLint rings) -
glutWireIcosahedron
public void glutWireIcosahedron()void glutWireIcosahedron (void) -
glutSolidIcosahedron
public void glutSolidIcosahedron()void glutWireIcosahedron (void) -
glutWireTeapot
public void glutWireTeapot(double scale) void glutWireTeapot (GLdouble scale) -
glutSolidTeapot
public void glutSolidTeapot(double scale) void glutSolidTeapot (GLdouble scale) -
glutCreateMenu
int glutCreateMenu (void (*)(int)) -
glutDestroyMenu
public void glutDestroyMenu(int menu) void glutDestroyMenu (int menu) -
glutGetMenu
public int glutGetMenu()int glutGetMenu (void) -
glutSetMenu
public void glutSetMenu(int menu) void glutSetMenu (int menu) -
glutAddMenuEntry
void glutAddMenuEntry (const char *label, int value) -
glutAddSubMenu
void glutAddSubMenu (const char *label, int submenu) -
glutChangeToMenuEntry
void glutChangeToMenuEntry (int item, const char *label, int value) -
glutChangeToSubMenu
void glutChangeToSubMenu (int item, const char *label, int submenu) -
glutRemoveMenuItem
public void glutRemoveMenuItem(int item) void glutRemoveMenuItem (int item) -
glutAttachMenu
public void glutAttachMenu(int button) void glutAttachMenu (int button) -
glutDetachMenu
public void glutDetachMenu(int button) void glutDetachMenu (int button) -
processEvent
GLUT window callback sub-API to handle events from canvas, mouse or keyboard. -
processComponentEvent
Process component events, i.e. events sent by theGLCanvas
displaying the GL image generated byGL.glFlush()
. Basically invokeGLUTListener.onReshape(Component, int, int)
andGLUTListener.onDisplay(Component)
to update canvas uponComponentEvent.COMPONENT_RESIZED
. Registering a reshape or display callback is done throughglut.glutCreateWindow(classInstanceProvidingDisplayAndReshapeMethod); glut.glutDisplayFunc("nameOfTheDisplayMethod"); glut.glutReshapeFunc("nameOfTheReshapeMethod");
- Parameters:
e
-
-
processKeyEvent
-
processMouseEvent
-
processMouseMotionEvent
Process mouse motion events. Basically invokeGLUTListener.onMotion(Component, int, int)
uponMouseEvent.MOUSE_MOVED
andMouseEvent.MOUSE_DRAGGED
. Registering a reshape or display callback is done throughglut.glutCreateWindow(classInstanceProvidingDisplayAndReshapeMethod); glut.glutMotionFunc("nameOfTheDisplayMethod");
- Parameters:
e
-
-
glutDisplayFunc
Deprecated.Register the name of theJavaComponent
method that should be called upon mouse motion. This method should have no argument. void glutDisplayFunc (void (*func)(void)) -
glutDisplayFunc
-
glutReshapeFunc
Deprecated.Register the name of theJavaComponent
method that should be called upon component resize events. This method should have two int as arguments. void glutReshapeFunc (void (*func)(int width, int height)) -
glutReshapeFunc
-
glutKeyboardFunc
Deprecated.void glutKeyboardFunc (void (*func)(unsigned char key, int x, int y)) -
glutKeyboardFunc
-
glutKeyboardUpFunc
Deprecated.void glutKeyboardUpFunc (void (*func)(unsigned char key, int x, int y)) -
glutKeyboardUpFunc
-
glutSpecialFunc
Deprecated. -
glutSpecialFunc
-
glutSpecialUpFunc
Deprecated.void glutSpecialUpFunc (void (*func)(unsigned char key, int x, int y)) -
glutSpecialUpFunc
-
glutMouseFunc
Deprecated.Register the name of theJavaComponent
method that should be called upon mouse events. This method should have four int as arguments. void glutMouseFunc (void (*func)(int button, int state, int x, int y)) -
glutMouseFunc
-
glutMotionFunc
Deprecated.Register the name of theJavaComponent
method that should be called upon mouse motion. This method should have two int as arguments. void glutMotionFunc (void (*func)(int x, int y)) -
glutMotionFunc
-
glutIdleFunc
Deprecated.void glutIdleFunc (void (*func)(void)) -
glutIdleFunc
-
run
public void run() -
glutTimerFunc
void glutTimerFunc (unsigned int millis, void (*func)(int value), int value) -
glutGetModifiers
public int glutGetModifiers()int glutGetModifiers (void)
-