@Override public void display(GLAutoDrawable arg0) { getGL().getGL2().glClear(GL2.GL_COLOR_BUFFER_BIT); controller.updateTest(); getGL().glFlush(); }
GL2 gl = (GL2)glad.getGL(); gl.glClearColor(0, 0, 0, 1); gl.glClear(GL_COLOR_BUFFER_BIT);
@Override public void display(GLAutoDrawable drawable) { GL2 gl = drawable.getGL().getGL2(); // get the OpenGL 2 graphics context gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); // clear // color // and depth // buffers gl.glLoadIdentity(); // reset the model-view matrix // ----- Your OpenGL rendering code here (Render a white triangle for // testing) ----- gl.glTranslatef(0.0f, 0.0f, -6.0f); // translate into the screen gl.glColor3f(r, g, b); gl.glBegin(GL.GL_TRIANGLES); // draw using triangles long delay = System.currentTimeMillis() - time; double angle = speed * delay * Math.PI / 2000; float c = (float) Math.cos(angle); float s = (float) Math.sin(angle); gl.glVertex3f(c, s, 0.0f); gl.glVertex3f(-s, c, 0.0f); gl.glVertex3f(-c, -s, 0.0f); gl.glEnd(); } @Override
gl.glClear(GL2.GL_COLOR_BUFFER_BIT);
@Override public void display(final GLAutoDrawable drawable) { final GL2 gl = GLContext.getCurrentGL().getGL2(); gl.glClear(GL.GL_DEPTH_BUFFER_BIT | GL.GL_COLOR_BUFFER_BIT); if (packer == null) { return; } final TextureRenderer rend = getBackingStore(); final int w = rend.getWidth(); final int h = rend.getHeight(); rend.beginOrthoRendering(w, h); rend.drawOrthoRect(0, 0); rend.endOrthoRendering(); if ((frame.getWidth() != w) || (frame.getHeight() != h)) { EventQueue.invokeLater(new Runnable() { @Override public void run() { frame.setSize(w, h); } }); } }
@Override public void display(GLAutoDrawable drawable) { GL2 gl = drawable.getGL().getGL2(); gl.glClear(GL.GL_COLOR_BUFFER_BIT /* | GL.GL_DEPTH_BUFFER_BIT */); if(shared.layout != null) { int res = prenderer.prepare(gl); if(res == 1) { // Request a repaint, to generate the next texture. canvas.repaint(); } if(res == 2) { messageOverlay.setMessage("Texture rendering completed."); switchState(State.EXPLORE); } } shared.camera.apply(gl); if(shared.layout != null) { prenderer.drawParallelPlot(drawable, gl); } if(DEBUG) { arcball.debugRender(gl); } if(State.MENU.equals(state)) { menuOverlay.render(gl); } if(State.PREPARATION.equals(state)) { messageOverlay.render(gl); } }
gl.glClear( GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT );
gl.glClear( GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT );
@Override public void display(GLAutoDrawable glad) { GL2 gl = (GL2)glad.getGL(); gl.glBlendFunc(GL_SRC_ALPHA, blends[iBlend]); gl.glMatrixMode(GL2.GL_PROJECTION); gl.glLoadIdentity(); new GLU().gluOrtho2D(-width / 2 - 1, width / 2 + 1, -height/2 - 1, height/2 + 1); gl.glMatrixMode(GL2.GL_MODELVIEW); gl.glBindBuffer(GL_ARRAY_BUFFER, vbo[0]); if (useOpenGLContext) { queue.finish(); } else { //interleavedColorAndPositionsMem.map(queue, CLMem.MapFlags.Read); interleavedColorAndPositionsMem.read(queue, interleavedColorAndPositionsTemp, true); gl.glBufferSubData(GL_ARRAY_BUFFER, 0, (int)interleavedColorAndPositionsTemp.getValidBytes(), interleavedColorAndPositionsTemp.getByteBuffer()); //interleavedColorAndPositionsMem.unmap(queue, interleavedColorAndPositionsTemp); } gl.glClear(GL_COLOR_BUFFER_BIT); gl.glColor3f(1.0f, 1.0f, 1.0f); //gl.glEnableClientState(GL_VERTEX_ARRAY); //gl.glEnableClientState(GL_COLOR_ARRAY); //gl.glColorPointer(4, GL_UNSIGNED_BYTE, elementSize, gl.glInterleavedArrays(GL2.GL_C4UB_V2F, elementSize, 0); gl.glDrawArrays(GL_POINTS, 0, particlesCount); gl.glBindBuffer(GL_ARRAY_BUFFER, 0); if (!paused) updateKernelArgs(); }
FloatBuffer vertices = FloatBuffer.wrap(vertex_data); gl2.glClear(gl2.GL_COLOR_BUFFER_BIT | gl2.GL_DEPTH_BUFFER_BIT);