Package javax.media.opengl

Examples of javax.media.opengl.GL.glClear()


  public void display(GLAutoDrawable arg0) {
    if(!draw) return;
   
    GL gl = arg0.getGL();
   
    gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT)//Clear the buffers
    gl.glLoadIdentity();                      //Reset the view
    gl.glTranslatef(0.0f, -2.0f, zOffset);              //Translate the scene backwards   
   
    gl.glPolygonMode(GL.GL_FRONT_AND_BACK, render_mode);
    gl.glCullFace(GL.GL_FRONT);
View Full Code Here


  }
 
  @Override
  public void display(GLAutoDrawable drawable) {
    GL gl = drawable.getGL();
    gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
    onDisplay(drawable);
    canvas.swapBuffers();
  }

  @Override
View Full Code Here

        if ((buffers & Renderer.BUFFER_STENCIL) != 0) {
            clear |= GL.GL_STENCIL_BUFFER_BIT;

            gl.glClearStencil(_stencilClearValue);
            gl.glStencilMask(~0);
            gl.glClear(GL.GL_STENCIL_BUFFER_BIT);
        }

        if ((buffers & Renderer.BUFFER_ACCUMULATION) != 0) {
            clear |= GL2.GL_ACCUM_BUFFER_BIT;
        }
View Full Code Here

            gl.glEnable(GL.GL_SCISSOR_TEST);
            gl.glScissor(0, 0, cam.getWidth(), cam.getHeight());
            record.setClippingTestEnabled(true);
        }

        gl.glClear(clear);

        if (strict) {
            // put us back.
            JoglRendererUtil.applyScissors(record);
        }
View Full Code Here

    //gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
    if ((drawable instanceof GLJPanel)
        && !((GLJPanel) drawable).isOpaque()
        && ((GLJPanel) drawable)
            .shouldPreserveColorBufferIfTranslucent()) {
      gl.glClear(GL.GL_DEPTH_BUFFER_BIT);
    } else {
      gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
    }
   
    int teeth = 10;
View Full Code Here

        && !((GLJPanel) drawable).isOpaque()
        && ((GLJPanel) drawable)
            .shouldPreserveColorBufferIfTranslucent()) {
      gl.glClear(GL.GL_DEPTH_BUFFER_BIT);
    } else {
      gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
    }
   
    int teeth = 10;
    int i;
    float angle;
View Full Code Here

  }

  public void display(GLAutoDrawable gLDrawable) {
    final GL gl = gLDrawable.getGL();

    gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
    shapeManager.checkQueue(gl, glu);

    render(gl);
    gl.glFlush();
  }
View Full Code Here

  public void glClearDepthBuffer() {
//    PGL gl=((PGraphicsOpenGL)p.g).beginPGL();
//    gl.gl.glClear(gl.gl.GL_DEPTH_BUFFER_BIT);
//    ((PGraphicsOpenGL)p.g).endPGL();   
    GL gl=((PGraphicsOpenGL)p.g).beginGL();
    gl.glClear(gl.GL_DEPTH_BUFFER_BIT);
    ((PGraphicsOpenGL)p.g).endGL();   
  }

  public void keyEvent(KeyEvent ev) {
    if(ev.getID() == KeyEvent.KEY_PRESSED) keyPressed();
View Full Code Here

  }
 
 
  public void glClearDepthBuffer() {
    GL gl=((PGraphicsOpenGL)p.g).beginGL();
    gl.glClear(gl.GL_DEPTH_BUFFER_BIT);
    ((PGraphicsOpenGL)p.g).endGL();   
  }

  public void keyEvent(KeyEvent ev) {
    if(ev.getID() == KeyEvent.KEY_PRESSED) keyPressed();
View Full Code Here

  protected void clear(PGraphics graphics){
    if (MT4jSettings.getInstance().isOpenGlMode()){
      GL gl = Tools3D.getGL(mtApplication);
      gl.glClearColor(this.glClearColor.getR(), this.glClearColor.getG(), this.glClearColor.getB(), this.glClearColor.getAlpha());
      gl.glClear(
          GL.GL_COLOR_BUFFER_BIT
          |
          GL.GL_DEPTH_BUFFER_BIT
          );
//      gl.glDepthMask(false);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.