public class JOGLNewtAppletBase extends Object implements KeyListener, GLEventListener
Modifier and Type | Field and Description |
---|---|
static boolean |
DEBUG |
Constructor and Description |
---|
JOGLNewtAppletBase(String glEventListenerClazzName,
int glSwapInterval,
boolean noDefaultKeyListener,
boolean glClosable,
boolean glDebug,
boolean glTrace) |
Modifier and Type | Method and Description |
---|---|
static GLEventListener |
createInstance(String clazzName) |
void |
destroy() |
void |
display(GLAutoDrawable drawable)
Called by the drawable to initiate OpenGL rendering by the
client.
|
void |
dispose(GLAutoDrawable drawable)
Notifies the listener to perform the release of all OpenGL
resources per GLContext, such as memory buffers and GLSL programs.
|
Animator |
getGLAnimator() |
GLEventListener |
getGLEventListener() |
GLWindow |
getGLWindow() |
void |
init(GLAutoDrawable drawable)
Called by the drawable immediately after the OpenGL context is
initialized.
|
void |
init(GLWindow glWindow) |
void |
init(ThreadGroup tg,
GLWindow glWindow) |
boolean |
isValid() |
void |
keyPressed(KeyEvent e)
|
void |
keyReleased(KeyEvent e)
|
void |
reshape(GLAutoDrawable drawable,
int x,
int y,
int width,
int height)
Called by the drawable during the first repaint after the
component has been resized.
|
static boolean |
setField(Object instance,
String fieldName,
Object value) |
void |
start() |
void |
stop() |
static boolean |
str2Bool(String str,
boolean def) |
static int |
str2Int(String str,
int def) |
public JOGLNewtAppletBase(String glEventListenerClazzName, int glSwapInterval, boolean noDefaultKeyListener, boolean glClosable, boolean glDebug, boolean glTrace)
public GLEventListener getGLEventListener()
public GLWindow getGLWindow()
public Animator getGLAnimator()
public boolean isValid()
public static boolean str2Bool(String str, boolean def)
public static int str2Int(String str, int def)
public static GLEventListener createInstance(String clazzName)
public void init(GLWindow glWindow)
public void init(ThreadGroup tg, GLWindow glWindow)
public void start()
public void stop()
public void destroy()
public void init(GLAutoDrawable drawable)
GLEventListener
Note that this method may be called more than once if the underlying OpenGL context for the GLAutoDrawable is destroyed and recreated, for example if a GLCanvas is removed from the widget hierarchy and later added again.
init
in interface GLEventListener
public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height)
GLEventListener
GL.glViewport(int, int, int, int)
; note that for
convenience the component has already called glViewport(x,
y, width, height)
when this method is called, so the
client may not have to do anything in this method.reshape
in interface GLEventListener
public void display(GLAutoDrawable drawable)
GLEventListener
setAutoSwapBufferMode
is
enabled.display
in interface GLEventListener
public void dispose(GLAutoDrawable drawable)
GLEventListener
Called by the drawable before the OpenGL context is
destroyed by an external event, like a reconfiguration of the
GLAutoDrawable
closing an attached window,
but also manually by calling destroy
.
Note that this event does not imply the end of life of the application.
It could be produced with a followup call to GLEventListener.init(GLAutoDrawable)
in case the GLContext has been recreated,
e.g. due to a pixel configuration change in a multihead environment.
dispose
in interface GLEventListener
public void keyPressed(KeyEvent e)
KeyListener
keyPressed
in interface KeyListener
public void keyReleased(KeyEvent e)
KeyListener
released
, excluding auto-repeat
modifier
keys. See KeyEvent
.
To simulated the removed keyTyped(KeyEvent e)
semantics,
simply apply the following constraints upfront and bail out if not matched, i.e.:
if( !e.isPrintableKey() || e.isAutoRepeat() ) { return; }
keyReleased
in interface KeyListener
Copyright 2010 JogAmp Community.