Package javax.media.opengl

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


        if (this.getPressedMaskTexture() == texture)
        {
            GL2 gl = dc.getGL().getGL2(); // GL initialization checks for GL2 compatibility.
            gl.glEnable(GL.GL_BLEND);
            gl.glBlendFunc(GL.GL_ZERO, GL.GL_SRC_COLOR);
            gl.glColor4f(1f, 1f, 1f, 1f);
        }
    }

    @SuppressWarnings({"UnusedDeclaration"})
    protected void doDrawPressedMask(DrawContext dc, int width, int height, double opacity, Position pickPosition)
View Full Code Here


    property.shape.setScale(property.size,
        property.size * property.ratio, property.size);

    // fill the shape
    if (property.isFilled) {
      gl.glColor4f(property.fillColor.getRed() / 255f,
          property.fillColor.getGreen() / 255f,
          property.fillColor.getBlue() / 255f,
          property.fillColor.getAlpha() / 255f);
      property.shape.fill(gl);
    }
View Full Code Here

    }

    // draw the border
    if (property.strokeWidth > 0.0f) {
      gl.glLineWidth(property.strokeWidth);
      gl.glColor4f(property.strokeColor.getRed() / 255f,
          property.strokeColor.getGreen() / 255f,
          property.strokeColor.getBlue() / 255f,
          property.strokeColor.getAlpha() / 255f);
      property.shape.draw(gl);
    }
View Full Code Here

      double centerX = property.positionX+property.size/2;
      double centerY = property.positionY+property.size/2;
      double halfWidth = 0.7;
      double halfHeight = 4;
      gl.glBegin(GL2.GL_QUADS);
      gl.glColor4f(1f, 1f, 1f, 0.5f);
      // vertical line
      gl.glVertex2d(centerX - halfWidth, centerY + halfHeight);
      gl.glVertex2d(centerX + halfWidth, centerY + halfHeight);
      gl.glVertex2d(centerX + halfWidth, centerY - halfHeight);
      gl.glVertex2d(centerX - halfWidth, centerY - halfHeight);
View Full Code Here

    }
    GL2 gl = scene.gl;
    gl.glPushName(property.shapeId);
    if (property.strokeWidth > 0.0f) {
      gl.glLineWidth(property.strokeWidth);
      gl.glColor4f(property.strokeColor.getRed() / 255f,
          property.strokeColor.getGreen() / 255f,
          property.strokeColor.getBlue() / 255f,
          property.strokeColor.getAlpha() / 255f);

      // get the real endpoints for the edge. Necessary to have the
View Full Code Here

    GL2 gl = scene.gl;
    texture.bind(gl);
    texture.enable(gl);

    Color foreground = scene.getForegroundColor();
    gl.glColor4f(foreground.getRed() / 255f,
        foreground.getGreen() / 255f,
        foreground.getBlue() / 255f,
        foreground.getAlpha() / 255f);

    gl.glPushMatrix();
View Full Code Here

  @Override
  public void drawSolidPolygon(Vec2[] vertices, int vertexCount, Color3f color) {
    GL2 gl = panel.getGL().getGL2();
    gl.glBegin(GL2.GL_TRIANGLE_FAN);
    gl.glColor4f(color.x, color.y, color.z, .4f);
    for (int i = 0; i < vertexCount; i++) {
      getWorldToScreenToOut(vertices[i], trans);
      gl.glVertex2f(trans.x, trans.y);
    }
    gl.glEnd();
View Full Code Here

      gl.glVertex2f(trans.x, trans.y);
    }
    gl.glEnd();

    gl.glBegin(GL2.GL_LINE_LOOP);
    gl.glColor4f(color.x, color.y, color.z, 1f);
    for (int i = 0; i < vertexCount; i++) {
      getWorldToScreenToOut(vertices[i], trans);
      gl.glVertex2f(trans.x, trans.y);
    }
    gl.glEnd();
View Full Code Here

            gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER, GL.GL_LINEAR);
            gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_LINEAR);
        }

        gl.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_TEXTURE_ENV_MODE, GL2.GL_MODULATE);
        gl.glColor4f(1.0f, 1.0f, 1.0f, alpha);

        // reset the polygon mode
        gl.glPolygonMode(GL.GL_FRONT_AND_BACK, GL2.GL_FILL);

        gl.glPixelStorei(GL.GL_UNPACK_ALIGNMENT, 1);
View Full Code Here

        if (VERBOSE) System.err.println("JoglPipeline.resetColoringAttributes()");

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

        if (!enableLight) {
            gl.glColor4f(r, g, b, a);
        }
        gl.glShadeModel(GL2.GL_SMOOTH);
    }

    /**
 
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.