Example usage for org.lwjgl.opengl GL11 glColor3d

List of usage examples for org.lwjgl.opengl GL11 glColor3d

Introduction

In this page you can find the example usage for org.lwjgl.opengl GL11 glColor3d.

Prototype

public static native void glColor3d(@NativeType("GLdouble") double red, @NativeType("GLdouble") double green,
        @NativeType("GLdouble") double blue);

Source Link

Document

Double version of #glColor3b Color3b

Usage

From source file:io.flob.blackheart.FontRenderer.java

License:Open Source License

public void render(int x, int y, Object text) {
    _font.drawString(x, y, "" + text, font_colour);
    GL11.glColor3d(1, 1, 1);
}

From source file:io.flob.blackheart.FontRenderer.java

License:Open Source License

public void render(int x, int y, Object text, Color _font_colour) {
    _font.drawString(x, y, "" + text, _font_colour);
    GL11.glColor3d(1, 1, 1);
}

From source file:io.flob.clicker.Button.java

License:Open Source License

private void render() {
    if (selected()) {
        GL11.glColor3d(0.75f, 0.75f, 0.75f);
    }/*from www .j  a  va2 s.c  om*/
    GL11.glTexCoord2f(_texture.getU(), _texture.getV());
    GL11.glVertex2f(position.getX(), position.getY());
    GL11.glTexCoord2f(_texture.getU2(), _texture.getV());
    GL11.glVertex2f(position.getX() + (size.getX()), position.getY());
    GL11.glTexCoord2f(_texture.getU2(), _texture.getV2());
    GL11.glVertex2f(position.getX() + (size.getX()), position.getY() + (size.getY()));
    GL11.glTexCoord2f(_texture.getU(), _texture.getV2());
    GL11.glVertex2f(position.getX(), position.getY() + (size.getY()));
    GL11.glColor3d(1, 1, 1);
}

From source file:matteroverdrive.guide.infograms.InfogramCreates.java

License:Open Source License

@Override
public void drawElement(int width, int mouseX, int mouseY) {
    bindTexture(background);/*from   w w w .  j a  v a 2  s  .co m*/
    GL11.glColor3d(1, 1, 1);
    RenderUtils.drawPlane(marginLeft, marginTop, 0, 115, 36);
    if (from != null) {
        GL11.glPushMatrix();
        GL11.glTranslated(marginLeft + 5, marginTop + 5, 0);
        GL11.glScaled(1.5, 1.5, 1.5);
        RenderUtils.renderStack(0, 0, from);
        GL11.glPopMatrix();
    }
    if (to != null) {
        GL11.glPushMatrix();
        GL11.glTranslated(marginLeft + 86, marginTop + 5, 0);
        GL11.glScaled(1.5, 1.5, 1.5);
        RenderUtils.renderStack(0, 0, to);
        GL11.glPopMatrix();
    }
}

From source file:matteroverdrive.guide.infograms.InfogramDepth.java

License:Open Source License

@Override
public void drawElement(int width, int mouseX, int mouseY) {
    float minPercent = 1 - Math.min(minDepth, 64) / 64f;
    float maxPercent = 1 - Math.min(maxDepth, 64) / 64f;

    if (maxDepth >= 0) {
        getFontRenderer().drawString(Integer.toString(maxDepth) + "-", 8, 8 + (int) (46 * maxPercent),
                Reference.COLOR_HOLO_GREEN.getColor());
    }//from  w ww . j  a v a2s  .  c  o m
    if (minDepth > 0) {
        getFontRenderer().drawString(Integer.toString(minDepth) + "-", 8, 8 + (int) (46 * minPercent),
                Reference.COLOR_HOLO_GREEN.getColor());
    }

    bindTexture(terrain_background);
    GL11.glColor3d(1, 1, 1);
    RenderUtils.drawPlane(marginLeft + 20.5, marginTop + 8, 0, 72.5, 53);

    RenderUtils.beginStencil();
    RenderUtils.drawStencil(marginLeft + 24, marginTop + 8 + (int) (53 * maxPercent), 24 + 69,
            8 + (int) (53 * minPercent), 1);
    bindTexture(terrain_background_stripes);
    GL11.glColor3d(1, 1, 1);
    RenderUtils.drawPlane(marginLeft + 24, marginTop + 8, 0, 69, 53);
    RenderUtils.endStencil();

    bindTexture(ore_lense_background);
    GL11.glColor3d(1, 1, 1);
    RenderUtils.drawPlane(marginLeft + 69, marginTop + 16, 0, 84, 41);

    if (stack != null) {
        GL11.glPushMatrix();
        GL11.glTranslated(marginLeft + 123, marginTop + 21, 0);
        GL11.glScaled(1.5, 1.5, 1.5);
        RenderUtils.renderStack(0, 0, stack);
        GL11.glPopMatrix();
    }
}

From source file:render.Render.java

License:Open Source License

public void StartRender() {

    if (flag)//  w  w w .j a  v a2 s. co  m
        this.resetGL();
    flag = false;

    GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_STENCIL_BUFFER_BIT);
    GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
    GL11.glClearColor(1.0F, 1.0F, 1.0F, 1.0F);

    GL11.glColor3d(0.0F, 0.0F, 0.0F);
    GL11.glPushMatrix();
    GL11.glScaled(Normal.toPlan(1), Normal.toPlan(1), 1);
    GL11.glTranslated(Normal.rx, Normal.ry, 0);
    // double zoom = 0.00001;
    // GL11.glOrtho( -width/2*zoom, width/2*zoom, -height/2*zoom, height/2*zoom, -1, 1 );

    GL11.glColor3d(0.4, 0.9, 0.1);

    //TODO : Make color class with getGreenFloat and getGreenRGB and chromatic wheel
    // this.drawLine(new Point(20,20), new Point(20+100,20));
    //FasT.getFasT().getLogger().debug("1 meter = " + Normal.normal(100, Unit.cm));
    // this.drawLine(new Point(20,40), new Point(20+Normal.toPlan(1),40));
    GL11.glColor3d(0, 1, 0);
    this.drawSquare(new Point(-1, -1).toReal(), new Point(1, 1).toReal());

    // this.drawLine(new Point(1,1).toReal(), new Point(1,1).toReal().add(new Point(1,0)));
    // this.drawLine(new Point(1,10), new Point(20,10));

    GL11.glColor3d(0.02, 0.8, 0.95);
    this.drawLine(new Point(10, 10).mouseToReal(), new Point(10, 10).mouseToReal().add(new Point(1, 0)));

    //Draw text to show this is 1 meter
}

From source file:render.Render.java

License:Open Source License

private void drawCircle(Point center, double radius, int num_segments, float[] color) {
    GL11.glColor3d(color[0], color[1], color[2]);
    GL11.glBegin(GL11.GL_POLYGON);//  ww  w.java  2s.co m
    for (int ii = 0; ii < num_segments; ii++) {
        float theta = 2.0f * 3.1415926f * ii / num_segments;//get the current angle 

        float x = (float) (radius * Math.cos(theta));//calculate the x component 
        float y = (float) (radius * Math.sin(theta));//calculate the y component 

        GL11.glVertex2d(x + center.getX(), y + center.getY());//output vertex 

    }
    GL11.glEnd();
}

From source file:render.Render.java

License:Open Source License

public void drawCorners(Point pos, double radius, float[] color) {
    GL11.glColor3d(color[0], color[1], color[2]);
    double d = radius / 2;

    GL11.glBegin(GL11.GL_LINE_STRIP);/*from  w w w. ja v a  2 s  .  c o  m*/
    GL11.glVertex2d(pos.getX() - radius, pos.getY() + d);
    GL11.glVertex2d(pos.getX() - radius, pos.getY() + radius);
    GL11.glVertex2d(pos.getX() - d, pos.getY() + radius);
    GL11.glEnd();

    GL11.glBegin(GL11.GL_LINE_STRIP);
    GL11.glVertex2d(pos.getX() + radius, pos.getY() - d);
    GL11.glVertex2d(pos.getX() + radius, pos.getY() - radius);
    GL11.glVertex2d(pos.getX() + d, pos.getY() - radius);
    GL11.glEnd();

    GL11.glBegin(GL11.GL_LINE_STRIP);
    GL11.glVertex2d(pos.getX() - radius, pos.getY() - d);
    GL11.glVertex2d(pos.getX() - radius, pos.getY() - radius);
    GL11.glVertex2d(pos.getX() - d, pos.getY() - radius);
    GL11.glEnd();

    GL11.glBegin(GL11.GL_LINE_STRIP);
    GL11.glVertex2d(pos.getX() + radius, pos.getY() + d);
    GL11.glVertex2d(pos.getX() + radius, pos.getY() + radius);
    GL11.glVertex2d(pos.getX() + d, pos.getY() + radius);
    GL11.glEnd();
}

From source file:render.Render.java

License:Open Source License

public void EndRender() {
    //Render debug
    if (this.showArrows) {
        for (logItem item : FasT.getFasT().getLogger().getVLog()) {
            Point p = item.getPoint();
            C c = item.getVec();//  www  .j a  v a 2  s .c o  m
            double[] color = item.getColor();

            GL11.glColor3d(color[0], color[1], color[2]);
            drawLine(p, c);
            GL11.glColor3d(0.1, 0.4, 0.8);

            Point max = new Point(p.getX() + c.getRe(), p.getY() + c.getIm());
            drawLine(max, c.getTheta().getRad() - 3 * Math.PI / 4, Normal.toReal(6));
            drawLine(max, c.getTheta().getRad() + 3 * Math.PI / 4, Normal.toReal(6));

            drawCircle(p, Normal.toReal(1), new float[] { 0.1f, 0.4f, 0.9f });
            //drawLine(new Point(p.getX()+c.getRe(),p.getY()+c.getIm()),new C(c.getTheta().getRad()+Math.PI/4,0.1));

        }
    }

    GL11.glPopMatrix();

    Display.update();

}

From source file:spaceshooter.entities.bullets.EntityPlayerBullet.java

License:Creative Commons License

@Override
public void draw() {
    GL11.glPushMatrix();/*from  w  ww .  ja va2  s  .c  o  m*/

    GL11.glColor3d(0, 100, 100);
    GL11.glBegin(GL11.GL_QUADS);
    GL11.glVertex2f(x, y);
    GL11.glVertex2f(x + width, y);
    GL11.glVertex2f(x + width, y + height);
    GL11.glVertex2f(x, y + height);
    GL11.glEnd();

    GL11.glPopMatrix();
}