@Override public void reshape(GLAutoDrawable arg0, int arg1, int arg2, int arg3, int arg4) { GL2 gl2 = arg0.getGL().getGL2(); gl2.glMatrixMode(GL2.GL_PROJECTION); gl2.glLoadIdentity(); // coordinate system origin at lower left with width and height same as the window GLU glu = new GLU(); glu.gluOrtho2D(0.0f, getWidth(), 0.0f, getHeight()); gl2.glMatrixMode(GL2.GL_MODELVIEW); gl2.glLoadIdentity(); gl2.glViewport(0, 0, getWidth(), getHeight()); controller.updateExtents(arg3 / 2, arg4 / 2); } }
@Override public boolean run(final GLAutoDrawable glAutoDrawable) { glAutoDrawable.getGL().setSwapInterval(enabled ? 1 : 0); return false; } });
/** * * @return current GL (as GL2ES2) */ public javax.media.opengl.GL2ES2 getGL2ES2() { return gLDrawable.getGL().getGL2ES2(); }
@Override public void dispose(GLAutoDrawable drawable) { GL gl = drawable.getGL(); prenderer.forgetTextures(gl); } }
@Override public boolean run(final GLAutoDrawable drawable) { drawable.getGL().glFinish(); return true; } };
@Override public boolean run(GLAutoDrawable glad) { old.updateImage(glad.getGL(), data); return true; } });
@Override public void init(final GLAutoDrawable drawable) { final GL gl = drawable.getGL(); final String s = JoglVersion.getGLInfo(gl, null).toString(); System.err.println(s); } @Override
@Override public void init(final GLAutoDrawable drawable) { final GL gl = drawable.getGL(); final String s = JoglVersion.getGLInfo(gl, null).toString(); System.err.println(s); tareaVersion.append(s); }
@Override public void init( GLAutoDrawable drawable ) { // enable debuging. drawable.setGL( new DebugGL( drawable.getGL() ) ); LOG.info( "init event called." ); }
@Override public boolean run(final GLAutoDrawable drawable) { drawable.getGL().glViewport(0, 0, drawable.getSurfaceWidth(), drawable.getSurfaceHeight()); return false; // issue re-display w/ new viewport! } };
@Override public void dispose(GLAutoDrawable glDrawable) { GL4 gl = glDrawable.getGL().getGL4(); gl.glBindBuffer(GL.GL_ARRAY_BUFFER, 0); gl.glDeleteBuffers(1, vertexBufferId, 0); }
@Override public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) { if( !drawable.getAutoSwapBufferMode() ) { final GL2ES2 gl = drawable.getGL().getGL2ES2(); gl.glViewport(0, 0, width, height); } } }
@Override public boolean run(final GLAutoDrawable drawable) { drawable.getGL().glViewport(0, 0, drawable.getSurfaceWidth(), drawable.getSurfaceHeight()); return true; } };
final public static String[] getGLInfos(GLAutoDrawable drawable) { GL gl = drawable.getGL(); GLCapabilitiesImmutable c = drawable.getChosenGLCapabilities(); String[] ret = { c + "", c.getDoubleBuffered() + "", c.getStereo() + "", c.getStencilBits() + "", gl.getClass().getName(), gl.glGetString(GL.GL_VENDOR), gl.glGetString(GL.GL_RENDERER), gl.glGetString(GL.GL_VERSION) }; return ret; }
@Override public void dispose(final GLAutoDrawable drawable) { final GL2ES2 gl = drawable.getGL().getGL2ES2(); helper.disposeAllGLEventListener(drawable, false); for(int i=0; i<fbos.length; i++) { fbos[i].destroy(gl); fboTexs[i] = null; } if( ownsDevice ) { deviceRenderer.dispose(gl); } }
@Override public void reshape( GLAutoDrawable d, int x, int y, int width, int height ) { this.width = width; this.height = height; GL gl = d.getGL(); gl.glMatrixMode( GL.GL_PROJECTION ); gl.glLoadIdentity(); glu.gluPerspective( fov, (float) width / height, nearClippingPlane, farClippingPlane ); gl.glMatrixMode( GL.GL_MODELVIEW ); }
@Override public void reshape(GLAutoDrawable glDrawable, int x, int y, int width, int height) { this.gl = glDrawable.getGL().getGL4(); height = Math.max(1, height); gl.glViewport(0, 0, width, height); testGlError(); projection.peek().setData(M4x4.perspective((float) width / (float) height).getData()); updateProjectionMatrix(); }
@Override public void init(final GLAutoDrawable drawable) { final GL2ES2 gl = drawable.getGL().getGL2ES2(); deviceRenderer.init(gl); // We will do some offscreen rendering, setup FBO... final DimensionImmutable textureSize = deviceRenderer.getTextureCount() > 1 ? deviceRenderer.getSingleSurfaceSize() : deviceRenderer.getTotalSurfaceSize(); initFBOs(gl, textureSize); helper.init(drawable, false); gl.setSwapInterval(1); }