Example usage for org.lwjgl.opengl GL11 GL_COMPILE

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

Introduction

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

Prototype

int GL_COMPILE

To view the source code for org.lwjgl.opengl GL11 GL_COMPILE.

Click Source Link

Document

ListMode

Usage

From source file:org.terasology.model.structures.AABB.java

License:Apache License

private void generateDisplayListSolid() {
    _displayListSolid = glGenLists(1);//  w ww .  j  a  v  a2s  .  c  o m

    glNewList(_displayListSolid, GL11.GL_COMPILE);
    glBegin(GL_QUADS);
    glColor4f(1.0f, 1.0f, 1.0f, 1.0f);

    GL11.glVertex3d(-_dimensions.x, _dimensions.y, _dimensions.z);
    GL11.glVertex3d(_dimensions.x, _dimensions.y, _dimensions.z);
    GL11.glVertex3d(_dimensions.x, _dimensions.y, -_dimensions.z);
    GL11.glVertex3d(-_dimensions.x, _dimensions.y, -_dimensions.z);

    GL11.glVertex3d(-_dimensions.x, -_dimensions.y, -_dimensions.z);
    GL11.glVertex3d(-_dimensions.x, -_dimensions.y, _dimensions.z);
    GL11.glVertex3d(-_dimensions.x, _dimensions.y, _dimensions.z);
    GL11.glVertex3d(-_dimensions.x, _dimensions.y, -_dimensions.z);

    GL11.glVertex3d(-_dimensions.x, -_dimensions.y, _dimensions.z);
    GL11.glVertex3d(_dimensions.x, -_dimensions.y, _dimensions.z);
    GL11.glVertex3d(_dimensions.x, _dimensions.y, _dimensions.z);
    GL11.glVertex3d(-_dimensions.x, _dimensions.y, _dimensions.z);

    GL11.glVertex3d(_dimensions.x, _dimensions.y, -_dimensions.z);
    GL11.glVertex3d(_dimensions.x, _dimensions.y, _dimensions.z);
    GL11.glVertex3d(_dimensions.x, -_dimensions.y, _dimensions.z);
    GL11.glVertex3d(_dimensions.x, -_dimensions.y, -_dimensions.z);

    GL11.glVertex3d(-_dimensions.x, _dimensions.y, -_dimensions.z);
    GL11.glVertex3d(_dimensions.x, _dimensions.y, -_dimensions.z);
    GL11.glVertex3d(_dimensions.x, -_dimensions.y, -_dimensions.z);
    GL11.glVertex3d(-_dimensions.x, -_dimensions.y, -_dimensions.z);

    GL11.glVertex3d(-_dimensions.x, -_dimensions.y, -_dimensions.z);
    GL11.glVertex3d(_dimensions.x, -_dimensions.y, -_dimensions.z);
    GL11.glVertex3d(_dimensions.x, -_dimensions.y, _dimensions.z);
    GL11.glVertex3d(-_dimensions.x, -_dimensions.y, _dimensions.z);
    glEnd();
    glEndList();

}

From source file:org.terasology.model.structures.AABB.java

License:Apache License

private void generateDisplayListWire() {
    double offset = 0.001;

    _displayListWire = glGenLists(1);//w w w  . j  a v a  2  s  .  co m

    glNewList(_displayListWire, GL11.GL_COMPILE);
    glColor4f(0.0f, 0.0f, 0.0f, 1.0f);

    // FRONT
    glBegin(GL_LINE_LOOP);
    glVertex3d(-_dimensions.x - offset, -_dimensions.y - offset, -_dimensions.z - offset);
    glVertex3d(+_dimensions.x + offset, -_dimensions.y - offset, -_dimensions.z - offset);
    glVertex3d(+_dimensions.x + offset, +_dimensions.y + offset, -_dimensions.z - offset);
    glVertex3d(-_dimensions.x - offset, +_dimensions.y + offset, -_dimensions.z - offset);
    glEnd();

    // BACK
    glBegin(GL_LINE_LOOP);
    glVertex3d(-_dimensions.x - offset, -_dimensions.y - offset, +_dimensions.z + offset);
    glVertex3d(+_dimensions.x + offset, -_dimensions.y - offset, +_dimensions.z + offset);
    glVertex3d(+_dimensions.x + offset, +_dimensions.y + offset, +_dimensions.z + offset);
    glVertex3d(-_dimensions.x - offset, +_dimensions.y + offset, +_dimensions.z + offset);
    glEnd();

    // TOP
    glBegin(GL_LINE_LOOP);
    glVertex3d(-_dimensions.x - offset, -_dimensions.y - offset, -_dimensions.z - offset);
    glVertex3d(+_dimensions.x + offset, -_dimensions.y - offset, -_dimensions.z - offset);
    glVertex3d(+_dimensions.x + offset, -_dimensions.y - offset, +_dimensions.z + offset);
    glVertex3d(-_dimensions.x - offset, -_dimensions.y - offset, +_dimensions.z + offset);
    glEnd();

    // BOTTOM
    glBegin(GL_LINE_LOOP);
    glVertex3d(-_dimensions.x - offset, +_dimensions.y + offset, -_dimensions.z - offset);
    glVertex3d(+_dimensions.x + offset, +_dimensions.y + offset, -_dimensions.z - offset);
    glVertex3d(+_dimensions.x + offset, +_dimensions.y + offset, +_dimensions.z + offset);
    glVertex3d(-_dimensions.x - offset, +_dimensions.y + offset, +_dimensions.z + offset);
    glEnd();

    // LEFT
    glBegin(GL_LINE_LOOP);
    glVertex3d(-_dimensions.x - offset, -_dimensions.y - offset, -_dimensions.z - offset);
    glVertex3d(-_dimensions.x - offset, -_dimensions.y - offset, +_dimensions.z + offset);
    glVertex3d(-_dimensions.x - offset, +_dimensions.y + offset, +_dimensions.z + offset);
    glVertex3d(-_dimensions.x - offset, +_dimensions.y + offset, -_dimensions.z - offset);
    glEnd();

    // RIGHT
    glBegin(GL_LINE_LOOP);
    glVertex3d(+_dimensions.x + offset, -_dimensions.y - offset, -_dimensions.z - offset);
    glVertex3d(+_dimensions.x + offset, -_dimensions.y - offset, +_dimensions.z + offset);
    glVertex3d(+_dimensions.x + offset, +_dimensions.y + offset, +_dimensions.z + offset);
    glVertex3d(+_dimensions.x + offset, +_dimensions.y + offset, -_dimensions.z - offset);
    glEnd();
    glEndList();
}

From source file:org.terasology.rendering.AABBRenderer.java

License:Apache License

private void generateDisplayListSolid() {
    displayListSolid = glGenLists(1);/*w  w  w .  j  a  v  a2 s.c  o  m*/

    glNewList(displayListSolid, GL11.GL_COMPILE);
    glBegin(GL_QUADS);
    glColor4f(solidColor.x, solidColor.y, solidColor.z, solidColor.w);

    Vector3f dimensions = aabb.getExtents();

    GL11.glVertex3f(-dimensions.x, dimensions.y, dimensions.z);
    GL11.glVertex3f(dimensions.x, dimensions.y, dimensions.z);
    GL11.glVertex3f(dimensions.x, dimensions.y, -dimensions.z);
    GL11.glVertex3f(-dimensions.x, dimensions.y, -dimensions.z);

    GL11.glVertex3f(-dimensions.x, -dimensions.y, -dimensions.z);
    GL11.glVertex3f(-dimensions.x, -dimensions.y, dimensions.z);
    GL11.glVertex3f(-dimensions.x, dimensions.y, dimensions.z);
    GL11.glVertex3f(-dimensions.x, dimensions.y, -dimensions.z);

    GL11.glVertex3f(-dimensions.x, -dimensions.y, dimensions.z);
    GL11.glVertex3f(dimensions.x, -dimensions.y, dimensions.z);
    GL11.glVertex3f(dimensions.x, dimensions.y, dimensions.z);
    GL11.glVertex3f(-dimensions.x, dimensions.y, dimensions.z);

    GL11.glVertex3f(dimensions.x, dimensions.y, -dimensions.z);
    GL11.glVertex3f(dimensions.x, dimensions.y, dimensions.z);
    GL11.glVertex3f(dimensions.x, -dimensions.y, dimensions.z);
    GL11.glVertex3f(dimensions.x, -dimensions.y, -dimensions.z);

    GL11.glVertex3f(-dimensions.x, dimensions.y, -dimensions.z);
    GL11.glVertex3f(dimensions.x, dimensions.y, -dimensions.z);
    GL11.glVertex3f(dimensions.x, -dimensions.y, -dimensions.z);
    GL11.glVertex3f(-dimensions.x, -dimensions.y, -dimensions.z);

    GL11.glVertex3f(-dimensions.x, -dimensions.y, -dimensions.z);
    GL11.glVertex3f(dimensions.x, -dimensions.y, -dimensions.z);
    GL11.glVertex3f(dimensions.x, -dimensions.y, dimensions.z);
    GL11.glVertex3f(-dimensions.x, -dimensions.y, dimensions.z);
    glEnd();
    glEndList();

}

From source file:org.terasology.rendering.AABBRenderer.java

License:Apache License

private void generateDisplayListWire() {
    float offset = 0.001f;

    displayListWire = glGenLists(1);/*  www  . j a  v  a  2s .  c o  m*/

    glNewList(displayListWire, GL11.GL_COMPILE);
    glColor4f(0.0f, 0.0f, 0.0f, 1.0f);

    Vector3f dimensions = aabb.getExtents();

    // FRONT
    glBegin(GL_LINE_LOOP);
    glVertex3f(-dimensions.x - offset, -dimensions.y - offset, -dimensions.z - offset);
    glVertex3f(+dimensions.x + offset, -dimensions.y - offset, -dimensions.z - offset);
    glVertex3f(+dimensions.x + offset, +dimensions.y + offset, -dimensions.z - offset);
    glVertex3f(-dimensions.x - offset, +dimensions.y + offset, -dimensions.z - offset);
    glEnd();

    // BACK
    glBegin(GL_LINE_LOOP);
    glVertex3f(-dimensions.x - offset, -dimensions.y - offset, +dimensions.z + offset);
    glVertex3f(+dimensions.x + offset, -dimensions.y - offset, +dimensions.z + offset);
    glVertex3f(+dimensions.x + offset, +dimensions.y + offset, +dimensions.z + offset);
    glVertex3f(-dimensions.x - offset, +dimensions.y + offset, +dimensions.z + offset);
    glEnd();

    // TOP
    glBegin(GL_LINE_LOOP);
    glVertex3f(-dimensions.x - offset, -dimensions.y - offset, -dimensions.z - offset);
    glVertex3f(+dimensions.x + offset, -dimensions.y - offset, -dimensions.z - offset);
    glVertex3f(+dimensions.x + offset, -dimensions.y - offset, +dimensions.z + offset);
    glVertex3f(-dimensions.x - offset, -dimensions.y - offset, +dimensions.z + offset);
    glEnd();

    // BOTTOM
    glBegin(GL_LINE_LOOP);
    glVertex3f(-dimensions.x - offset, +dimensions.y + offset, -dimensions.z - offset);
    glVertex3f(+dimensions.x + offset, +dimensions.y + offset, -dimensions.z - offset);
    glVertex3f(+dimensions.x + offset, +dimensions.y + offset, +dimensions.z + offset);
    glVertex3f(-dimensions.x - offset, +dimensions.y + offset, +dimensions.z + offset);
    glEnd();

    // LEFT
    glBegin(GL_LINE_LOOP);
    glVertex3f(-dimensions.x - offset, -dimensions.y - offset, -dimensions.z - offset);
    glVertex3f(-dimensions.x - offset, -dimensions.y - offset, +dimensions.z + offset);
    glVertex3f(-dimensions.x - offset, +dimensions.y + offset, +dimensions.z + offset);
    glVertex3f(-dimensions.x - offset, +dimensions.y + offset, -dimensions.z - offset);
    glEnd();

    // RIGHT
    glBegin(GL_LINE_LOOP);
    glVertex3f(+dimensions.x + offset, -dimensions.y - offset, -dimensions.z - offset);
    glVertex3f(+dimensions.x + offset, -dimensions.y - offset, +dimensions.z + offset);
    glVertex3f(+dimensions.x + offset, +dimensions.y + offset, +dimensions.z + offset);
    glVertex3f(+dimensions.x + offset, +dimensions.y + offset, -dimensions.z - offset);
    glEnd();
    glEndList();
}

From source file:org.terasology.rendering.backdrop.Skysphere.java

License:Apache License

private void drawSkysphere(float zFar) {
    if (displayListSphere == -1) {
        displayListSphere = glGenLists(1);

        Sphere sphere = new Sphere();
        sphere.setTextureFlag(true);// www  .  ja  va2s.c  o  m

        glNewList(displayListSphere, GL11.GL_COMPILE);

        float skyBoxDistance = (zFar > 1024 ? 1024.0f : zFar * 0.95f);
        sphere.draw(skyBoxDistance, 16, 128);

        glEndList();
    }

    glCallList(displayListSphere);
}

From source file:org.terasology.rendering.dag.nodes.BackdropNode.java

License:Apache License

private void initSkysphere(float sphereRadius) {
    Sphere sphere = new Sphere();
    sphere.setTextureFlag(true);//from  www . j  a  v a2  s  . com

    skySphere = glGenLists(1);

    glNewList(skySphere, GL11.GL_COMPILE);
    sphere.draw(sphereRadius, SLICES, STACKS);
    glEndList();
}

From source file:org.terasology.rendering.dag.nodes.BackdropReflectionNode.java

License:Apache License

private void initSkysphere() {
    Sphere sphere = new Sphere();
    sphere.setTextureFlag(true);/*from   w  w w  .j  av a  2  s.  c o m*/

    skySphere = glGenLists(1);

    glNewList(skySphere, GL11.GL_COMPILE);
    sphere.draw(RADIUS, SLICES, STACKS);
    glEndList();
}

From source file:org.terasology.rendering.dag.nodes.DeferredPointLightsNode.java

License:Apache License

private void initLightSphereDisplayList() {
    lightSphereDisplayList = glGenLists(1);
    Sphere sphere = new Sphere();

    glNewList(lightSphereDisplayList, GL11.GL_COMPILE);
    sphere.draw(1, 8, 8);//  www  .  jav  a 2s  .com
    glEndList();
}

From source file:org.terasology.rendering.gui.components.UICrosshair.java

License:Apache License

private void generateDisplayList() {
    _displayList = glGenLists(1);//from w  ww  .  j av  a2s .c  om

    glNewList(_displayList, GL11.GL_COMPILE);
    glBegin(GL_LINES);
    glColor3f(1.0f, 1.0f, 1.0f);
    glVertex2f(-8f, 0f);
    glVertex2f(8f, 0f);
    glVertex2f(0f, -8f);
    glVertex2f(0f, 8f);
    glEnd();
    glEndList();
}

From source file:org.terasology.rendering.opengl.OpenGLUtils.java

License:Apache License

private static void renderQuad() {
    if (displayListQuad == -1) {
        displayListQuad = glGenLists(1);

        glNewList(displayListQuad, GL11.GL_COMPILE);

        glBegin(GL_QUADS);/*from ww w  . j  av  a  2  s  .  com*/
        glColor4f(1.0f, 1.0f, 1.0f, 1.0f);

        glTexCoord2d(0.0, 0.0);
        glVertex3i(-1, -1, -1);

        glTexCoord2d(1.0, 0.0);
        glVertex3i(1, -1, -1);

        glTexCoord2d(1.0, 1.0);
        glVertex3i(1, 1, -1);

        glTexCoord2d(0.0, 1.0);
        glVertex3i(-1, 1, -1);

        glEnd();

        glEndList();
    }

    glCallList(displayListQuad);
}