Package javax.media.opengl

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


    @Override
    void updateMaterialColor(Context ctx, float r, float g, float b, float a) {
        if (VERBOSE) System.err.println("JoglPipeline.updateMaterialColor()");

    GL2 gl = context(ctx).getGL().getGL2();
        gl.glColor4f(r, g, b, a);
        gl.glDisable(GL2.GL_LIGHTING);
    }

    @Override
    void destroyContext(Drawable drawable, Context ctx) {
View Full Code Here


        } else {
            color[0] = red; color[1] = green; color[2] = blue;
        }
        color[3] = alpha;
        gl.glMaterialfv(GL.GL_FRONT_AND_BACK, GL2.GL_DIFFUSE, color, 0);
        gl.glColor4f(color[0], color[1], color[2], color[3]);

        if (lightEnable) {
            gl.glEnable(GL2.GL_LIGHTING);
        } else {
            gl.glDisable(GL2.GL_LIGHTING);
View Full Code Here

        if (lightEnable) {
            cr = dRed; cg = dGreen; cb = dBlue;
        } else {
            cr = red; cg = green; cb = blue;
        }
        gl.glColor4f(cr, cg, cb, alpha);
        if (shadeModel == ColoringAttributes.SHADE_FLAT) {
            gl.glShadeModel(GL2.GL_FLAT);
        } else {
            gl.glShadeModel(GL2.GL_SMOOTH);
        }
View Full Code Here

                            gl.glNormal3f(varray[normoff], varray[normoff+1], varray[normoff+2]);
                        }
                    }
                    if ((vformat & GeometryArray.COLOR) != 0) {
                        if (useAlpha) {
                            gl.glColor4f(varray[coloroff],
                                    varray[coloroff+1],
                                    varray[coloroff+2],
                                    varray[coloroff+3] * alpha);
                        } else {
                            if ((vformat & GeometryArray.WITH_ALPHA) != 0) { // alpha is present
View Full Code Here

                                    varray[coloroff+1],
                                    varray[coloroff+2],
                                    varray[coloroff+3] * alpha);
                        } else {
                            if ((vformat & GeometryArray.WITH_ALPHA) != 0) { // alpha is present
                                gl.glColor4f(varray[coloroff],
                                        varray[coloroff+1],
                                        varray[coloroff+2],
                                        varray[coloroff+3]);
                            } else {
                                gl.glColor3f(varray[coloroff],
View Full Code Here

                            cr = varray[coloroff];
                            cg = varray[coloroff + 1];
                            cb = varray[coloroff + 2];
                            ca = alpha;
                        }
                        gl.glColor4f(cr, cg, cb, ca);
                    } else {
                        if ((vformat & GeometryArray.WITH_ALPHA) != 0) { // alpha is present
                            gl.glColor4f(varray[coloroff],
                                    varray[coloroff + 1],
                                    varray[coloroff + 2],
View Full Code Here

                            ca = alpha;
                        }
                        gl.glColor4f(cr, cg, cb, ca);
                    } else {
                        if ((vformat & GeometryArray.WITH_ALPHA) != 0) { // alpha is present
                            gl.glColor4f(varray[coloroff],
                                    varray[coloroff + 1],
                                    varray[coloroff + 2],
                                    varray[coloroff + 3]);
                        } else {
                            gl.glColor3f(varray[coloroff],
View Full Code Here

  public void getColor(Color4f color) {
    color.set(this.color);
  }
  public void applyColor() {
    GL2 gl = drawable.getGL().getGL2();
    gl.glColor4f(color.x, color.y, color.z, color.w);
  }
 
  public void setBaseColor(Color4f color) {
    endPrimitivesKeepImage();
    this.baseColor = color;
View Full Code Here

        if(l == null) continue;

        p = l.getPoint(0);
        c = l.getColor(0);
        if(c == null) c = color;
        gl.glColor4f(c.x, c.y, c.z, c.w);
          gl.glVertex2f(p.x, p.y);
 
          p = l.getPoint(1);
        c = l.getColor(1);
        if(c == null) c = color;
View Full Code Here

          gl.glVertex2f(p.x, p.y);
 
          p = l.getPoint(1);
        c = l.getColor(1);
        if(c == null) c = color;
        gl.glColor4f(c.x, c.y, c.z, c.w);
          gl.glVertex2f(p.x, p.y);
      }
      // reset color;
      applyColor();
    } 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.