Example usage for org.lwjgl.opengl GL11 glRectf

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

Introduction

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

Prototype

public static native void glRectf(@NativeType("GLfloat") float x1, @NativeType("GLfloat") float y1,
        @NativeType("GLfloat") float x2, @NativeType("GLfloat") float y2);

Source Link

Document

Float version of #glRecti Recti .

Usage

From source file:com.rvantwisk.cnctools.controls.opengl.PlatformActor.java

License:Open Source License

@Override
public void initialize() {

    display_list = GL11.glGenLists(1);/*from  w  ww  . j a  va  2  s . com*/

    GL11.glNewList(display_list, GL11.GL_COMPILE);

    // draw the grid
    GL11.glBegin(GL11.GL_LINES);

    for (int i = xneg; i <= xpos; i += openNess) {
        setColor(i);
        GL11.glVertex3f(i, yneg, ZPOS);
        GL11.glVertex3f(i, ypos, ZPOS);
    }

    for (int i = yneg; i <= ypos; i += openNess) {
        setColor(i);
        GL11.glVertex3f(xneg, i, ZPOS);
        GL11.glVertex3f(xpos, i, ZPOS);
    }

    GL11.glColor4f(color_fill[0], color_fill[1], color_fill[2], color_fill[3]);
    GL11.glRectf(xneg, yneg, xpos, ypos);
    GL11.glEnd();

    GL11.glEndList();
}

From source file:im.bci.jnuit.lwjgl.LwjglNuitRenderer.java

License:Open Source License

@Override
public void visit(Widget widget, ColoredBackground background) {
    GL11.glDisable(GL11.GL_TEXTURE_2D);//w  ww.jav  a 2 s. c  o m
    GL11.glColor4f(background.getRed(), background.getGreen(), background.getBlue(), background.getAlpha());
    GL11.glRectf(widget.getX(), widget.getY(), widget.getX() + widget.getWidth(),
            widget.getY() + widget.getHeight());
    GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
    GL11.glEnable(GL11.GL_TEXTURE_2D);
}

From source file:net.adam_keenan.voxel.hud.HUD.java

License:Creative Commons License

public static void drawCrosshairs() {

    float screenx = (float) Display.getWidth() / 2, screeny = (float) Display.getHeight() / 2;
    float x1, y1, x2, y2, width1 = 4, height1 = 20, width2 = height1, height2 = width1;
    x1 = screenx - width1 / 2;//from   www . ja va 2s . c  o m
    y1 = screeny - height1 / 2;
    x2 = screenx - width2 / 2;
    y2 = screeny - height2 / 2;

    FloatBuffer perspectiveProjectionMatrix;
    FloatBuffer orthographicProjectionMatrix;
    perspectiveProjectionMatrix = BufferUtils.createFloatBuffer(16);
    orthographicProjectionMatrix = BufferUtils.createFloatBuffer(16);
    GL11.glMatrixMode(GL11.GL_PROJECTION);
    GL11.glGetFloat(GL11.GL_PROJECTION_MATRIX, perspectiveProjectionMatrix);
    GL11.glLoadIdentity();
    GL11.glOrtho(0, Display.getWidth(), Display.getHeight(), 0, 1, -1);
    GL11.glGetFloat(GL11.GL_PROJECTION_MATRIX, orthographicProjectionMatrix);
    //      GL11.glLoadMatrix(perspectiveProjectionMatrix);

    GL11.glMatrixMode(GL11.GL_PROJECTION); // For text drawing
    GL11.glLoadMatrix(orthographicProjectionMatrix);
    GL11.glMatrixMode(GL11.GL_MODELVIEW);
    GL11.glPushMatrix();
    GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
    GL11.glLoadIdentity(); // Clears matrix

    GL11.glColor4f(0, 0, 0, .5f);
    GL11.glRectf(x1, y1, x1 + width1, y1 + height1);
    GL11.glRectf(x2, y2, x2 + (width2 - width1) / 2, y2 + height2);
    GL11.glRectf(x2 + (width2 + width1) / 2, y2, x2 + width2, y2 + height2);

    GL11.glPopMatrix();
    GL11.glPopAttrib();
    GL11.glMatrixMode(GL11.GL_PROJECTION);
    GL11.glLoadMatrix(perspectiveProjectionMatrix);
    GL11.glMatrixMode(GL11.GL_MODELVIEW);

}

From source file:org.fenggui.binding.render.lwjgl.LWJGLOpenGL.java

License:Open Source License

public void rect(float x1, float y1, float x2, float y2) {
    GL11.glRectf(x1, y1, x2, y2);
}

From source file:tk.ivybits.engine.gl.GL.java

License:Open Source License

public static void glRectf(float a, float b, float c, float d) {
    GL11.glRectf(a, b, c, d);
}