Examples of glPushAttrib()


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

            gl.glClearStencil(0);
            gl.glStencilMask(~0);
            clearMask |= GL.GL_STENCIL_BUFFER_BIT;
        } else {
            gl.glPushAttrib(GL.GL_DEPTH_BUFFER_BIT);
        }

        gl.glDepthMask(true);
        gl.glClearColor(r, g, b, jctx.getAlphaClearValue());
        gl.glClear(clearMask);
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);

        disableAttribFor2D(gl);
        gl.glDepthMask(false);
        gl.glEnable(GL.GL_TEXTURE_2D);
View Full Code Here

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

    GL2 gl = context(ctx).getGL().getGL2();
        gl.glHint(GL2.GL_PERSPECTIVE_CORRECTION_HINT,
                (perspCorrectionMode == TextureAttributes.NICEST) ? GL.GL_NICEST : GL.GL_FASTEST);

        // set OGL texture matrix
        gl.glPushAttrib(GL2.GL_TRANSFORM_BIT);
        gl.glMatrixMode(GL.GL_TEXTURE);

        if (isIdentity) {
            gl.glLoadIdentity();
        } else if (gl.isExtensionAvailable("GL_VERSION_1_3")) {
View Full Code Here

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

     */
    public static void draw(final GLAutoDrawable drawable, final Polygon polygon, final Circle circle, final boolean showOverlap)
    {
        // store the current color and stencil buffer
        final GL2 gl = (GL2) drawable.getGL();
        gl.glPushAttrib(GL2.GL_CURRENT_BIT);

        if (showOverlap)
        {
            /*
             * Comment the following two lines if you want to also drawing the
View Full Code Here

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

        gl.glColorMask(true, true, true, true);
        gl.glStencilFunc(GL.GL_EQUAL, 1, 1);
        gl.glStencilOp(GL.GL_ZERO, GL.GL_ZERO, GL.GL_ZERO);

        // push the current color
        gl.glPushAttrib(GL2.GL_CURRENT_BIT);

        // use the current polygon's color
        gl.glColor3f(color.getRed(), color.getGreen(), color.getBlue());

        // if only 1 vertex, draw a point
View Full Code Here

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

            return;

        final GL2 gl = (GL2) drawable.getGL();

        // push the current color
        gl.glPushAttrib(GL2.GL_CURRENT_BIT);

        // use the current polygon's color
        gl.glColor3f(color.getRed(), color.getGreen(), color.getBlue());

        // if only 1 vertex, draw a point
View Full Code Here

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

    gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_STENCIL_BUFFER_BIT);
   
    // check if we need to highlight pixels which are inside the polygon
    if (this.insideOutsideTest) {
      // push the current color
      gl.glPushAttrib(GL2.GL_CURRENT_BIT);
      gl.glPointSize(3);
      gl.glBegin(GL.GL_POINTS);  
      for (int y = 0; y < this.canvas.getHeight(); y++) {
        for (int x = 0; x < this.canvas.getWidth(); x++) {
          if (this.shapes[selectedShapeIndex].isInside(x, y))
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.