Examples of glPushAttrib()


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

    //copy camera transform
    gl.glGetDoublev(GL.GL_MODELVIEW_MATRIX, camera, 0);
   

    for ( DrawShape shape: toDraw) {
      gl.glPushAttrib(GL.GL_LIGHTING_BIT);
      gl.glPushMatrix();
      gl.glMultMatrixd(shape.getTransform().toArray(), 0);

     
      if (shape.getReferenceBody().deactivated) {
View Full Code Here

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

        gl.glLoadIdentity();

        gl.glViewport(0, 0, glDrawable.getWidth(), glDrawable.getHeight());

        // Store enabled state and disable lighting, texture mapping and the depth buffer
        gl.glPushAttrib(GL.GL_ENABLE_BIT);
        gl.glDisable(GL.GL_BLEND);
        gl.glDisable(GL.GL_LIGHTING);
        gl.glDisable(GL.GL_TEXTURE_2D);
        gl.glDisable(GL.GL_DEPTH_TEST);
View Full Code Here

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

        gl.glLoadIdentity();

        gl.glViewport(0, 0, glDrawable.getWidth(), glDrawable.getHeight());

        // Store enabled state and disable lighting, texture mapping and the depth buffer
        gl.glPushAttrib(GL.GL_ENABLE_BIT);
        gl.glDisable(GL.GL_BLEND);
        gl.glDisable(GL.GL_LIGHTING);
        gl.glDisable(GL.GL_TEXTURE_2D);
        gl.glDisable(GL.GL_DEPTH_TEST);
View Full Code Here

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

  public static void disableDepthBuffer(PGraphics g){
    switch (MT4jSettings.getInstance().getRendererMode()) {
    case MT4jSettings.OPENGL_MODE:
//      GL gl = ((PGraphicsOpenGL)pa.g).gl;
      GL gl = ((PGraphicsOpenGL)g).gl;
      gl.glPushAttrib(GL.GL_DEPTH_BUFFER_BIT);//FIXME TEST
      gl.glDepthFunc(javax.media.opengl.GL.GL_ALWAYS); //turn off Z buffering
      break;
    case MT4jSettings.P3D_MODE:
//      /*
//      for(int i=0;i<((PGraphics3D)pa.g).zbuffer.length;i++){
View Full Code Here

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

     
//      /*
      boolean clipping = false;
      if (GLStencilUtil.getInstance().isClipActive()){
        clipping = true;
        gl.glPushAttrib(GL.GL_STENCIL_BUFFER_BIT);
        gl.glClearStencil(GLStencilUtil.getInstance().stencilValueStack.peek());
        gl.glClear(GL.GL_STENCIL_BUFFER_BIT);
        //      gl.glDisable(GL.GL_STENCIL_TEST);
      }
//      */
 
View Full Code Here

Examples of javax.media.opengl.GL2.glPushAttrib()

                | GL2.GL_COLOR_BUFFER_BIT // for alpha test func and ref, and blend
                | GL2.GL_DEPTH_BUFFER_BIT // for depth func
                | GL2.GL_ENABLE_BIT // for enable/disable changes
                | GL2.GL_HINT_BIT | GL2.GL_LINE_BIT; // for antialiasing and line attrs

        gl.glPushAttrib(attrMask);

        if (!dc.isPickingMode())
        {
            gl.glEnable(GL.GL_BLEND);
            OGLUtil.applyBlending(gl, false);
View Full Code Here

Examples of javax.media.opengl.GL2.glPushAttrib()

        GLContext context = context(ctx);
    GL2 gl = context.getGL().getGL2();

        // Temporarily disable fragment and most 3D operations
        gl.glPushAttrib(GL2.GL_ENABLE_BIT | GL2.GL_TEXTURE_BIT | GL2.GL_POLYGON_BIT |
                GL2.GL_CURRENT_BIT );

        disableAttribForRaster(gl);

        /* Setup filter mode if needed */
 
View Full Code Here

Examples of javax.media.opengl.GL2.glPushAttrib()

    GL2 gl = context(ctx).getGL().getGL2();

        int glType = GL.GL_RGBA;

        // Temporarily disable fragment and most 3D operations
        gl.glPushAttrib(GL2.GL_ENABLE_BIT | GL2.GL_TEXTURE_BIT | GL.GL_DEPTH_BUFFER_BIT | GL2.GL_POLYGON_BIT);
        disableAttribFor2D(gl);

        // Reset the polygon mode
        gl.glPolygonMode(GL.GL_FRONT_AND_BACK, GL2.GL_FILL);
View Full Code Here

Examples of javax.media.opengl.GL2.glPushAttrib()

    GL2 gl = context(ctx).getGL().getGL2();

        float[] color = new float[4];

        gl.glPushAttrib(GL2.GL_TRANSFORM_BIT);
        gl.glMatrixMode(GL.GL_TEXTURE);
        gl.glLoadIdentity();
        gl.glPopAttrib();
        gl.glTexEnvfv(GL2.GL_TEXTURE_ENV, GL2.GL_TEXTURE_ENV_COLOR, color, 0);
        gl.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_TEXTURE_ENV_MODE, GL.GL_REPLACE);
View Full Code Here

Examples of javax.media.opengl.GL2.glPushAttrib()

        // Mask of which buffers to clear, this always includes color & depth
        int clearMask = GL.GL_DEPTH_BUFFER_BIT | GL.GL_COLOR_BUFFER_BIT;

        // Issue 239 - clear stencil if specified
        if (clearStencil) {
            gl.glPushAttrib(GL.GL_DEPTH_BUFFER_BIT | GL.GL_STENCIL_BUFFER_BIT);

            gl.glClearStencil(0);
            gl.glStencilMask(~0);
            clearMask |= GL.GL_STENCIL_BUFFER_BIT;
        } else {
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.