21package com.jogamp.opengl.demos.es2;
23import java.nio.FloatBuffer;
25import com.jogamp.common.nio.Buffers;
26import com.jogamp.common.util.VersionUtil;
27import com.jogamp.math.Matrix4f;
28import com.jogamp.math.Quaternion;
29import com.jogamp.math.Vec3f;
30import com.jogamp.math.util.PMVMatrix4f;
31import com.jogamp.nativewindow.NativeWindow;
32import com.jogamp.newt.Window;
33import com.jogamp.newt.event.GestureHandler;
34import com.jogamp.newt.event.GestureHandler.GestureEvent;
35import com.jogamp.newt.event.KeyAdapter;
36import com.jogamp.newt.event.KeyEvent;
37import com.jogamp.newt.event.KeyListener;
38import com.jogamp.newt.event.MouseEvent;
39import com.jogamp.newt.event.MouseListener;
40import com.jogamp.newt.event.PinchToZoomGesture;
41import com.jogamp.newt.event.WindowAdapter;
42import com.jogamp.newt.event.WindowEvent;
43import com.jogamp.newt.opengl.GLWindow;
44import com.jogamp.opengl.GL;
45import com.jogamp.opengl.GL2ES2;
46import com.jogamp.opengl.GLAnimatorControl;
47import com.jogamp.opengl.GLAutoDrawable;
48import com.jogamp.opengl.GLCapabilities;
49import com.jogamp.opengl.GLRendererQuirks;
50import com.jogamp.opengl.GLUniformData;
51import com.jogamp.opengl.JoglVersion;
52import com.jogamp.opengl.demos.GearsObject;
53import com.jogamp.opengl.demos.util.CommandlineOptions;
54import com.jogamp.opengl.fixedfunc.GLMatrixFunc;
55import com.jogamp.opengl.util.Animator;
56import com.jogamp.opengl.util.CustomGLEventListener;
57import com.jogamp.opengl.util.PMVMatrix;
58import com.jogamp.opengl.util.TileRendererBase;
59import com.jogamp.opengl.util.caps.NonFSAAGLCapsChooser;
60import com.jogamp.opengl.util.glsl.ShaderCode;
61import com.jogamp.opengl.util.glsl.ShaderProgram;
62import com.jogamp.opengl.util.glsl.ShaderState;
63import com.jogamp.opengl.util.stereo.EyeParameter;
64import com.jogamp.opengl.util.stereo.StereoGLEventListener;
65import com.jogamp.opengl.util.stereo.ViewerPose;
72 private final FloatBuffer lightPos = Buffers.newDirectFloatBuffer(
new float[] { 5.0f, 5.0f, 10.0f } );
78 private volatile float view_rotx = 20.0f, view_roty = 30.0f;
79 private boolean flipVerticalInGLOrientation =
false;
80 private final boolean customRendering =
false;
82 private final float view_rotz = 0.0f;
83 private float panX = 0.0f, panY = 0.0f, panZ=0.0f;
84 private volatile GearsObjectES2 gear1=
null, gear2=
null, gear3=
null;
86 private Object syncObjects =
null;
87 private boolean useMappedBuffers =
false;
88 private boolean validateBuffers =
false;
89 private volatile boolean usesSharedGears =
false;
91 private float angle = 0.0f;
92 private int swapInterval = 0;
97 private boolean doRotateBeforePrinting;
99 private boolean doRotate =
true;
100 private float[] clearColor =
null;
101 private boolean clearBuffers =
true;
102 private boolean verbose =
true;
103 private volatile boolean isInit =
false;
109 this.swapInterval = swapInterval;
113 this.swapInterval = 1;
118 tileRendererInUse = tr;
119 doRotateBeforePrinting = doRotate;
124 tileRendererInUse =
null;
129 System.err.println(
"GearsES2.startTileRendering: "+sid()+
""+tr);
133 System.err.println(
"GearsES2.endTileRendering: "+sid()+
""+tr);
143 this.clearColor = clearColor;
146 public void setGearsColors(
final FloatBuffer gear1Color,
final FloatBuffer gear2Color,
final FloatBuffer gear3Color) {
147 this.gear1Color = gear1Color;
148 this.gear2Color = gear2Color;
149 this.gear3Color = gear3Color;
153 sharedGears = shared;
162 public void setRotX(
final float v) { view_rotx = v; }
163 public void setRotY(
final float v) { view_roty = v; }
189 private static final int TIME_OUT = 2000;
190 private static final int POLL_DIVIDER = 20;
191 private static final int TIME_SLICE = TIME_OUT / POLL_DIVIDER ;
196 public boolean waitForInit(
final boolean initialized)
throws InterruptedException {
198 for (wait=0; wait<POLL_DIVIDER && initialized != isInit ; wait++) {
199 Thread.sleep(TIME_SLICE);
201 return wait<POLL_DIVIDER;
204 private final String sid() {
return "0x"+Integer.toHexString(hashCode()); }
208 if(
null != sharedGears && !sharedGears.isInit() ) {
209 System.err.println(Thread.currentThread()+
" GearsES2.init.0 "+sid()+
": pending shared Gears .. re-init later XXXXX");
216 System.err.println(Thread.currentThread()+
" GearsES2.init.0 "+sid()+
": tileRendererInUse "+tileRendererInUse+
", "+
this);
217 System.err.println(
"GearsES2 init "+sid()+
" on "+Thread.currentThread());
219 System.err.println(
"INIT GL IS: " + gl.getClass().getName());
223 System.err.println(
"No GLSL available, no rendering.");
230 "shader/bin",
"gears",
true);
232 "shader/bin",
"gears",
true);
236 sp0.
add(gl, vp0, System.err);
237 sp0.
add(gl, fp0, System.err);
246 st.
uniform(gl, pmvMatrixUniform);
256 if(
null != sharedGears ) {
260 usesSharedGears =
true;
262 System.err.println(
"gear1 "+sid()+
" created w/ share: "+sharedGears.
getGear1()+
" -> "+gear1);
263 System.err.println(
"gear2 "+sid()+
" created w/ share: "+sharedGears.
getGear2()+
" -> "+gear2);
264 System.err.println(
"gear3 "+sid()+
" created w/ share: "+sharedGears.
getGear3()+
" -> "+gear3);
267 syncObjects = sharedGears;
269 }
else if(
null == syncObjects ) {
270 syncObjects =
new Object();
271 System.err.println(
"Shared GearsES2: Unsynchronized Objects");
274 gear1 =
new GearsObjectES2(gl, useMappedBuffers, st, gear1Color, 1.0f, 4.0f, 1.0f, 20, 0.7f, pmvMatrix, pmvMatrixUniform, colorU, validateBuffers);
276 System.err.println(
"gear1 "+sid()+
" created: "+gear1);
279 gear2 =
new GearsObjectES2(gl, useMappedBuffers, st, gear2Color, 0.5f, 2.0f, 2.0f, 10, 0.7f, pmvMatrix, pmvMatrixUniform, colorU, validateBuffers);
281 System.err.println(
"gear2 "+sid()+
" created: "+gear2);
284 gear3 =
new GearsObjectES2(gl, useMappedBuffers, st, gear3Color, 1.3f, 2.0f, 0.5f, 10, 0.7f, pmvMatrix, pmvMatrixUniform, colorU, validateBuffers);
286 System.err.println(
"gear3 "+sid()+
" created: "+gear2);
288 if(
null == syncObjects ) {
289 syncObjects =
new Object();
294 if (upstreamWidget instanceof
Window) {
309 System.err.println(Thread.currentThread()+
" GearsES2.init.X "+sid()+
" FIN "+
this);
319 final float zoom = ze.getZoom();
320 panZ = zoom * 30f - 30f;
326 if( !isInit ) {
return; }
329 reshapeImpl(gl, x, y, width, height, width, height);
334 final int tileX,
final int tileY,
final int tileWidth,
final int tileHeight,
335 final int imageWidth,
final int imageHeight) {
336 if( !isInit ) {
return; }
339 reshapeImpl(gl, tileX, tileY, tileWidth, tileHeight, imageWidth, imageHeight);
342 private float zNear = 5f;
343 private float zFar = 10000f;
344 private float zViewDist = 40.0f;
346 public void setZ(
final float zNear,
final float zFar,
final float zViewDist) {
349 this.zViewDist = zViewDist;
352 void reshapeImpl(
final GL2ES2 gl,
final int tileX,
final int tileY,
final int tileWidth,
final int tileHeight,
final int imageWidth,
final int imageHeight) {
355 System.err.println(Thread.currentThread()+
" GearsES2.reshape "+sid()+
" "+tileX+
"/"+tileY+
" "+tileWidth+
"x"+tileHeight+
" of "+imageWidth+
"x"+imageHeight+
", swapInterval "+swapInterval+
", drawable 0x"+Long.toHexString(gl.
getContext().
getGLDrawable().
getHandle())+
", msaa "+msaa+
", tileRendererInUse "+tileRendererInUse);
363 float left, right, bottom, top;
364 if( imageHeight > imageWidth ) {
365 final float a = (float)imageHeight / (
float)imageWidth;
371 final float a = (float)imageWidth / (
float)imageHeight;
377 final float w = right - left;
378 final float h = top - bottom;
381 final float l = left + tileX * w / imageWidth;
382 final float r = l + tileWidth * w / imageWidth;
383 final float b = bottom + tileY * h / imageHeight;
384 final float t = b + tileHeight * h / imageHeight;
386 final float _w = r - l;
387 final float _h = t - b;
389 System.err.println(
">> GearsES2 "+sid()+
", angle "+angle+
", [l "+left+
", r "+right+
", b "+bottom+
", t "+top+
"] "+w+
"x"+h+
" -> [l "+l+
", r "+r+
", b "+b+
", t "+t+
"] "+_w+
"x"+_h+
", v-flip "+flipVerticalInGLOrientation);
397 pmvMatrix.
glFrustumf(l, r, b, t, zNear, zFar);
403 st.
uniform(gl, pmvMatrixUniform);
408 private final Matrix4f mat4Tmp1 =
new Matrix4f();
409 private final Matrix4f mat4Tmp2 =
new Matrix4f();
410 private final Vec3f vec3Tmp1 =
new Vec3f();
411 private final Vec3f vec3Tmp2 =
new Vec3f();
412 private final Vec3f vec3Tmp3 =
new Vec3f();
414 private static final float scalePos = 20f;
428 mat4Tmp1.setToScale(1f, -1f, 1f);
429 mat4Tmp2.setToPerspective(eyeParam.
fovhv, zNear, zFar);
430 mat4.
mul(mat4Tmp1, mat4Tmp2);
445 shiftedEyePos.
scale(scalePos);
451 final Vec3f center = forward.
add(shiftedEyePos);
457 mat4.
translate(0, 0, -zViewDist, mat4Tmp1);
461 st.
uniform(gl, pmvMatrixUniform);
467 if( !isInit ) {
return; }
470 System.err.println(Thread.currentThread()+
" GearsES2.dispose "+sid()+
": tileRendererInUse "+tileRendererInUse);
473 if (upstreamWidget instanceof
Window) {
478 pinchToZoomGesture =
null;
500 System.err.println(Thread.currentThread()+
" GearsES2.dispose "+sid()+
" FIN");
511 if( !isInit ) {
return; }
512 if(
null != sharedGears && !sharedGears.isInit() ) {
return; }
515 final boolean repeatedFrame = 0 != ( CustomGLEventListener.DISPLAY_REPEAT & flags );
516 final boolean dontClear = 0 != ( CustomGLEventListener.DISPLAY_DONTCLEAR & flags );
519 if( doRotate && !repeatedFrame ) {
526 final boolean hasFocus;
534 if( clearBuffers && !dontClear ) {
535 if(
null != clearColor ) {
536 gl.
glClearColor(clearColor[0], clearColor[1], clearColor[2], clearColor[3]);
537 }
else if(
null != tileRendererInUse ) {
553 pmvMatrix.
glRotatef(view_rotx, 1.0f, 0.0f, 0.0f);
554 pmvMatrix.
glRotatef(view_roty, 0.0f, 1.0f, 0.0f);
555 pmvMatrix.
glRotatef(view_rotz, 0.0f, 0.0f, 1.0f);
557 synchronized ( syncObjects ) {
558 gear1.draw(gl, -3.0f, -2.0f, 1f * angle - 0f);
559 gear2.draw(gl, 3.1f, -2.0f, -2f * angle - 9.0f);
560 gear3.draw(gl, -3.1f, 4.2f, -2f * angle - 25.0f);
586 return "GearsES2[obj "+sid()+
" isInit "+isInit+
", usesShared "+usesSharedGears+
", 1 "+gear1+
", 2 "+gear2+
", 3 "+gear3+
", sharedGears "+sharedGears+
"]";
594 public void keyPressed(
final KeyEvent e) {
598 }
else if(KeyEvent.VK_RIGHT == kc) {
600 }
else if(KeyEvent.VK_UP == kc) {
602 }
else if(KeyEvent.VK_DOWN == kc) {
608 class GearsMouseAdapter
implements MouseListener{
609 private int prevMouseX, prevMouseY;
612 public void mouseClicked(
final MouseEvent e) {
616 public void mouseEntered(
final MouseEvent e) {
620 public void mouseExited(
final MouseEvent e) {
624 public void mouseWheelMoved(
final MouseEvent e) {
625 final float[] rot = e.getRotation();
626 if( e.isControlDown() ) {
628 final float incr = e.isShiftDown() ? rot[0] : rot[1] * 0.5f ;
630 System.err.println(
"panZ.2: incr "+incr+
", dblZoom "+e.isShiftDown()+
" -> "+panZ);
639 public void mousePressed(
final MouseEvent e) {
640 if( e.getPointerCount()==1 ) {
641 prevMouseX = e.getX();
642 prevMouseY = e.getY();
643 }
else if( e.getPointerCount() == 4 ) {
644 final Object src = e.getSource();
645 if( e.getPressure(0,
true) > 0.7f && src instanceof Window) {
646 ((Window) src).setKeyboardVisible(
true);
652 public void mouseReleased(
final MouseEvent e) {
656 public void mouseMoved(
final MouseEvent e) {
657 if( e.isConfined() ) {
662 prevMouseX = e.getX();
663 prevMouseY = e.getY();
668 public void mouseDragged(
final MouseEvent e) {
672 private void navigate(
final MouseEvent e) {
673 final int x = e.getX();
674 final int y = e.getY();
677 final Object source = e.getSource();
678 Window window =
null;
679 if(source instanceof Window) {
680 window = (Window) source;
681 width=window.getSurfaceWidth();
682 height=window.getSurfaceHeight();
683 }
else if (source instanceof GLAutoDrawable) {
684 final GLAutoDrawable glad = (GLAutoDrawable) source;
685 width = glad.getSurfaceWidth();
686 height = glad.getSurfaceHeight();
688 throw new RuntimeException(
"Event source neither Window nor Component: "+source);
690 final float thetaY = 360.0f * ( (float)(x-prevMouseX)/(float)width);
691 final float thetaX = 360.0f * ( (float)(prevMouseY-y)/(float)height);
700 public static void main(
final String[] args) {
703 System.err.println(options);
704 System.err.println(VersionUtil.getPlatformInfo());
708 System.out.println(
"Requested: " + reqCaps);
721 animator.
add(window);
Basic 4x4 float matrix implementation using fields for intensive use-cases (host operations).
final Matrix4f mul(final Matrix4f b)
Multiply matrix: [this] = [this] x [b].
final Matrix4f translate(final float x, final float y, final float z, final Matrix4f tmp)
Translate this matrix, i.e.
Matrix4f setToPerspective(final float fovy_rad, final float aspect, final float zNear, final float zFar)
Set this matrix to perspective frustum projection.
Matrix4f setToLookAt(final Vec3f eye, final Vec3f center, final Vec3f up, final Matrix4f tmp)
Set this matrix to the look-at matrix based on given parameters.
Quaternion implementation supporting Gimbal-Lock free rotations.
final Vec3f rotateVector(final Vec3f vecIn, final Vec3f vecOut)
final Quaternion mult(final Quaternion q)
Multiply this quaternion by the param quaternion.
3D Vector based upon three float components.
Vec3f scale(final float s)
this = this * s, returns this.
static final Vec3f UNIT_Z_NEG
static final Vec3f UNIT_Y
Vec3f set(final Vec3f o)
this = o, returns this.
Vec3f add(final float dx, final float dy, final float dz)
this = this + { dx, dy, dz }, returns this.
PMVMatrix4f implements the basic computer graphics Matrix4f pack using projection (P),...
static final int INVERSE_TRANSPOSED_MODELVIEW
Bit value for inverse transposed modelview matrix (Mvit), updated via update().
static final int INVERSE_MODELVIEW
Bit value for inverse modelview matrix (Mvi), updated via update().
final SyncMatrices4f getSyncPMvMviMvit()
Returns SyncMatrices4f of 4 matrices within one FloatBuffer: P, Mv, Mvi and Mvit if requested.
static final short VK_LEFT
Constant for the cursor- or numerical-pad left arrow key.
final short getKeyCode()
Returns the virtual key code using a fixed mapping to the US keyboard layout.
A GestureHandler.GestureEvent denominating zoom.
NEWT Window events are provided for notification purposes ONLY.
An implementation of GLAutoDrawable and Window interface, using a delegated Window instance,...
final void setTitle(final String title)
final void setSize(final int width, final int height)
Sets the size of the window's client area in window units, excluding decorations.
final void setVisible(final boolean visible)
Calls setVisible(true, visible), i.e.
final void addWindowListener(final WindowListener l)
Appends the given com.jogamp.newt.event.WindowListener to the end of the list.
CapabilitiesChooser setCapabilitiesChooser(final CapabilitiesChooser chooser)
Set the CapabilitiesChooser to help determine the native visual type.
static GLWindow create(final GLCapabilitiesImmutable caps)
Creates a new GLWindow attaching a new Window referencing a new default Screen and default Display wi...
Specifies a set of OpenGL capabilities.
abstract GLDrawable getGLDrawable()
Returns the write-drawable this context uses for framebuffer operations.
final boolean hasRendererQuirk(final int quirk)
Returns true if the quirk exist in getRendererQuirks(), otherwise false.
GLRendererQuirks contains information of known bugs of various GL renderer.
static final int NeedSharedObjectSync
Need GL objects (VBO, ..) to be synchronized when utilized concurrently from multiple threads via a s...
final StringBuilder toString(StringBuilder sb)
static StringBuilder getGLStrings(final GL gl, final StringBuilder sb)
static final FloatBuffer green
void destroy(final GL gl)
static final FloatBuffer red
static final FloatBuffer blue
void setGearsColors(final FloatBuffer gear1Color, final FloatBuffer gear2Color, final FloatBuffer gear3Color)
void setVerbose(final boolean v)
void display(final GLAutoDrawable drawable, final int flags)
Extended display method, allowing to pass a display flag, e.g.
void reshapeTile(final TileRendererBase tr, final int tileX, final int tileY, final int tileWidth, final int tileHeight, final int imageWidth, final int imageHeight)
Called by the TileRendererBase during tile-rendering via an attached GLAutoDrawable's GLAutoDrawable#...
void setDoRotation(final boolean rotate)
void setClearColor(final float[] clearColor)
float[4]
void setUseMappedBuffers(final boolean v)
GearsES2(final int swapInterval)
void setValidateBuffers(final boolean v)
void display(final GLAutoDrawable drawable)
Called by the drawable to initiate OpenGL rendering by the client.
void init(final GLAutoDrawable drawable)
Called by the drawable immediately after the OpenGL context is initialized.
void dispose(final GLAutoDrawable drawable)
Notifies the listener to perform the release of all OpenGL resources per GLContext,...
void setClearBuffers(final boolean v)
static void main(final String[] args)
void setSharedGears(final GearsES2 shared)
GearsObjectES2 getGear2()
boolean waitForInit(final boolean initialized)
void startTileRendering(final TileRendererBase tr)
Called by the TileRendererBase during tile-rendering after TileRendererBase#beginTile(GL) and before ...
void setGLStates(final GL2ES2 gl, final boolean enable)
boolean usesSharedGears()
void reshapeForEye(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height, final EyeParameter eyeParam, final ViewerPose viewerPose)
Stereo capable specialization of reshape(GLAutoDrawable, int, int, int, int) for one StereoDeviceRend...
void setZ(final float zNear, final float zFar, final float zViewDist)
void endTileRendering(final TileRendererBase tr)
Called by the TileRenderer during tile-rendering after TileRendererBase#endTile(GL) and GLAutoDrawabl...
void setFlipVerticalInGLOrientation(final boolean v)
void addTileRendererNotify(final TileRendererBase tr)
The owning GLAutoDrawable is attached to the given TileRendererBase instance.
GearsObjectES2 getGear3()
MouseListener getMouseListener()
void setRotX(final float v)
PMVMatrix4f getPMVMatrix()
void setSyncObjects(final Object sync)
GearsObjectES2 getGear1()
void setRotY(final float v)
KeyListener getKeyListener()
void removeTileRendererNotify(final TileRendererBase tr)
The owning GLAutoDrawable is detached from the given TileRendererBase instance.
void reshape(final GLAutoDrawable glad, final int x, final int y, final int width, final int height)
Called by the drawable during the first repaint after the component has been resized.
GLCapabilities getGLCaps()
final synchronized void add(final GLAutoDrawable drawable)
Adds a drawable to this animator's list of rendering drawables.
final void setUpdateFPSFrames(final int frames, final PrintStream out)
final synchronized boolean start()
Starts this animator, if not running.
final synchronized boolean stop()
Stops this animator.
PMVMatrix implements a subset of the fixed function pipeline GLMatrixFunc using PMVMatrix4f.
final void glTranslatef(final float x, final float y, final float z)
Translate the current matrix.
final void glScalef(final float x, final float y, final float z)
Scale the current matrix.
final void glMatrixMode(final int matrixName)
Sets the current matrix mode.
final void glPushMatrix()
Push the current matrix to it's stack, while preserving it's values.
final void glFrustumf(final float left, final float right, final float bottom, final float top, final float zNear, final float zFar)
Multiply the current matrix with the frustum matrix.
final void glRotatef(final float ang_deg, final float x, final float y, final float z)
Rotate the current matrix.
final void glPopMatrix()
Pop the current matrix from it's stack.
final void glLoadIdentity()
Load the current matrix with the identity matrix.
final void glLoadMatrixf(final float[] values, final int offset)
Load the current matrix w/ the provided one.
A fairly direct port of Brian Paul's tile rendering library, found at http://www.mesa3d....
final GLAutoDrawable getAttachedDrawable()
Returns a previously attached GLAutoDrawable, null if none is attached.
Custom GLCapabilitiesChooser, filtering out all full screen anti-aliasing (FSAA, multisample) capabil...
Convenient shader code class to use and instantiate vertex or fragment programs.
final int defaultShaderCustomization(final GL2ES2 gl, final boolean preludeVersion, final boolean addDefaultPrecision)
Default customization of this shader source code.
static ShaderCode create(final GL2ES2 gl, final int type, final int count, final Class<?> context, final String[] sourceFiles, final boolean mutableStringBuilder)
Creates a complete ShaderCode object while reading all shader source of sourceFiles,...
synchronized void add(final ShaderCode shaderCode)
Adds a new shader to this program.
ShaderState allows to sharing data between shader programs, while updating the attribute and uniform ...
synchronized void useProgram(final GL2ES2 gl, final boolean on)
Turns the shader program on or off.
synchronized boolean attachShaderProgram(final GL2ES2 gl, final ShaderProgram prog, final boolean enable)
Attach or switch a shader program.
final Object attachObject(final String name, final Object obj)
Attach user object for the given name to this ShaderState.
synchronized void destroy(final GL2ES2 gl)
Calls release(gl, true, true, true).
boolean uniform(final GL2ES2 gl, final GLUniformData data)
Set the uniform data, if it's location is valid, i.e.
void ownUniform(final GLUniformData uniform)
Bind the GLUniform lifecycle to this ShaderState.
Constant single eye parameter of the viewer, relative to its ViewerPose.
final float distNoseToPupilX
IPD related horizontal distance from nose to pupil in meter.
final FovHVHalves fovhv
Field of view in both directions, may not be centered, either FovHVHalves#inTangents or radians.
final float distMiddleToPupilY
Vertical distance from middle-line to pupil in meter.
final Vec3f positionOffset
eye position vector used to define eye height in meter relative to actor.
final float eyeReliefZ
Z-axis eye relief in meter.
position and orientation of viewer.
final Quaternion orientation
Orientation of viewer.
final Vec3f position
position of viewer in meter.
Extend the NativeSurface interface with windowing information such as window-handle,...
Specifying NEWT's Window functionality:
void addGestureListener(GestureHandler.GestureListener gl)
Appends the given GestureHandler.GestureListener to the end of the list.
void addKeyListener(KeyListener l)
Appends the given com.jogamp.newt.event.KeyListener to the end of the list.
void removeGestureHandler(GestureHandler gh)
Removes the given GestureHandler from the list.
void removeKeyListener(KeyListener l)
void addMouseListener(MouseListener l)
Appends the given MouseListener to the end of the list.
void removeGestureListener(GestureHandler.GestureListener gl)
Removes the given GestureHandler.GestureListener from the list.
void addGestureHandler(GestureHandler gh)
Appends the given GestureHandler to the end of the list.
void removeMouseListener(MouseListener l)
Removes the given MouseListener from the list.
Listener for GestureEvents.
Generic gesture handler interface designed to allow pass-through filtering of InputEvents.
Listener for MouseEvents.
static final int GL_VERTEX_SHADER
GL_ES_VERSION_2_0, GL_VERSION_2_0, GL_EXT_vertex_shader, GL_ARB_vertex_shader Alias for: GL_VERTEX_SH...
static final int GL_FRAGMENT_SHADER
GL_ES_VERSION_2_0, GL_VERSION_2_0, GL_ATI_fragment_shader, GL_ARB_fragment_shader Alias for: GL_FRAGM...
An animator control interface, which implementation may drive a com.jogamp.opengl....
A higher-level abstraction than GLDrawable which supplies an event based mechanism (GLEventListener) ...
GLAnimatorControl getAnimator()
GL getGL()
Returns the GL pipeline object this GLAutoDrawable uses.
void setGLEventListenerInitState(GLEventListener listener, boolean initialized)
Sets the given listener's initialized state.
Object getUpstreamWidget()
Method may return the upstream UI toolkit object holding this GLAutoDrawable instance,...
void addGLEventListener(GLEventListener listener)
Adds the given listener to the end of this drawable queue.
boolean hasGLSL()
Indicates whether this GL object supports GLSL.
GL2ES2 getGL2ES2()
Casts this object to the GL2ES2 interface.
void setSwapInterval(int interval)
Set the swap interval of the current context and attached onscreen GLDrawable.
GLContext getContext()
Returns the GLContext associated which this GL object.
boolean getSampleBuffers()
Returns whether sample buffers for full-scene antialiasing (FSAA) should be allocated for this drawab...
GLCapabilitiesImmutable getChosenGLCapabilities()
Fetches the GLCapabilitiesImmutable corresponding to the chosen OpenGL capabilities (pixel format / v...
long getHandle()
Returns the GL drawable handle, guaranteed to be valid after realization and while it's surface is be...
boolean isGLOriented()
Returns true if the drawable is rendered in OpenGL's coordinate system, origin at bottom left.
NativeSurface getNativeSurface()
Returns the associated NativeSurface of this NativeSurfaceHolder.
void glDisable(int cap)
Entry point to C language function: void {@native glDisable}(GLenum cap) Part of GL_ES_VERSION_2_0...
static final int GL_COLOR_BUFFER_BIT
GL_ES_VERSION_2_0, GL_VERSION_1_1, GL_VERSION_1_0, GL_VERSION_ES_1_0 Define "GL_COLOR_BUFFER_BIT" wit...
void glClearColor(float red, float green, float blue, float alpha)
Entry point to C language function: void {@native glClearColor}(GLfloat red, GLfloat green,...
void glEnable(int cap)
Entry point to C language function: void {@native glEnable}(GLenum cap) Part of GL_ES_VERSION_2_0,...
static final int GL_DEPTH_TEST
GL_ES_VERSION_2_0, GL_VERSION_1_1, GL_VERSION_1_0, GL_VERSION_ES_1_0 Define "GL_DEPTH_TEST" with expr...
void glClear(int mask)
Entry point to C language function: void {@native glClear}(GLbitfield mask) Part of GL_ES_VERSION_...
void glFinish()
Entry point to C language function: void {@native glFinish}() Part of GL_ES_VERSION_2_0,...
static final int GL_DEPTH_BUFFER_BIT
GL_ES_VERSION_2_0, GL_VERSION_1_1, GL_VERSION_1_0, GL_VERSION_ES_1_0 Define "GL_DEPTH_BUFFER_BIT" wit...
static final int GL_CULL_FACE
GL_ES_VERSION_2_0, GL_VERSION_1_1, GL_VERSION_1_0, GL_VERSION_ES_1_0 Define "GL_CULL_FACE" with expre...
Subset of OpenGL fixed function pipeline's matrix operations.
static final int GL_PROJECTION
Matrix mode projection.
static final int GL_MODELVIEW
Matrix mode modelview.
Extended GLEventListener and CustomGLEventListener interface supporting stereoscopic client rendering...