Example usage for org.lwjgl.opengl GL11 glEndList

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

Introduction

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

Prototype

public static native void glEndList();

Source Link

Document

Ends the definition of GL commands to be placed in a display list.

Usage

From source file:stevekung.mods.moreplanets.planets.mercury.dimension.sky.SkyProviderMercury.java

License:Creative Commons License

public SkyProviderMercury(IGalacticraftWorldProvider gcProvider) {
    this.sunSize = 17.5F * gcProvider.getSolarSize();

    int displayLists = GLAllocation.generateDisplayLists(3);
    this.starList = displayLists;
    this.glSkyList = displayLists + 1;
    this.glSkyList2 = displayLists + 2;

    // Bind stars to display list
    GL11.glPushMatrix();//from   w  w  w . j  av a2 s.co  m
    GL11.glNewList(this.starList, GL11.GL_COMPILE);
    this.renderStars();
    GL11.glEndList();
    GL11.glPopMatrix();

    Tessellator tessellator = Tessellator.instance;
    GL11.glNewList(this.glSkyList, GL11.GL_COMPILE);
    byte byte2 = 64;
    int i = 256 / byte2 + 2;
    float f = 16F;

    for (int j = -byte2 * i; j <= byte2 * i; j += byte2) {
        for (int l = -byte2 * i; l <= byte2 * i; l += byte2) {
            tessellator.startDrawingQuads();
            tessellator.addVertex(j + 0, f, l + 0);
            tessellator.addVertex(j + byte2, f, l + 0);
            tessellator.addVertex(j + byte2, f, l + byte2);
            tessellator.addVertex(j + 0, f, l + byte2);
            tessellator.draw();
        }
    }

    GL11.glEndList();
    GL11.glNewList(this.glSkyList2, GL11.GL_COMPILE);
    f = -16F;
    tessellator.startDrawingQuads();

    for (int k = -byte2 * i; k <= byte2 * i; k += byte2) {
        for (int i1 = -byte2 * i; i1 <= byte2 * i; i1 += byte2) {
            tessellator.addVertex(k + byte2, f, i1 + 0);
            tessellator.addVertex(k + 0, f, i1 + 0);
            tessellator.addVertex(k + 0, f, i1 + byte2);
            tessellator.addVertex(k + byte2, f, i1 + byte2);
        }
    }

    tessellator.draw();
    GL11.glEndList();
}

From source file:stevekung.mods.moreplanets.planets.nibiru.dimension.sky.SkyProviderNibiru.java

License:Creative Commons License

public SkyProviderNibiru(IGalacticraftWorldProvider marsProvider) {
    this.sunSize = 17.5F * marsProvider.getSolarSize();

    int displayLists = GLAllocation.generateDisplayLists(3);
    this.starList = displayLists;
    this.glSkyList = displayLists + 1;
    this.glSkyList2 = displayLists + 2;

    // Bind stars to display list
    GL11.glPushMatrix();//from www.j  a v a 2  s  . c  om
    GL11.glNewList(this.starList, GL11.GL_COMPILE);
    this.renderStars();
    GL11.glEndList();
    GL11.glPopMatrix();

    Tessellator tessellator = Tessellator.instance;
    GL11.glNewList(this.glSkyList, GL11.GL_COMPILE);
    byte byte2 = 64;
    int i = 256 / byte2 + 2;
    float f = 16F;

    for (int j = -byte2 * i; j <= byte2 * i; j += byte2) {
        for (int l = -byte2 * i; l <= byte2 * i; l += byte2) {
            tessellator.startDrawingQuads();
            tessellator.addVertex(j + 0, f, l + 0);
            tessellator.addVertex(j + byte2, f, l + 0);
            tessellator.addVertex(j + byte2, f, l + byte2);
            tessellator.addVertex(j + 0, f, l + byte2);
            tessellator.draw();
        }
    }

    GL11.glEndList();
    GL11.glNewList(this.glSkyList2, GL11.GL_COMPILE);
    f = -16F;
    tessellator.startDrawingQuads();

    for (int k = -byte2 * i; k <= byte2 * i; k += byte2) {
        for (int i1 = -byte2 * i; i1 <= byte2 * i; i1 += byte2) {
            tessellator.addVertex(k + byte2, f, i1 + 0);
            tessellator.addVertex(k + 0, f, i1 + 0);
            tessellator.addVertex(k + 0, f, i1 + byte2);
            tessellator.addVertex(k + byte2, f, i1 + byte2);
        }
    }
    tessellator.draw();
    GL11.glEndList();
}

From source file:stevekung.mods.moreplanets.planets.pluto.dimension.sky.SkyProviderPluto.java

License:Creative Commons License

public SkyProviderPluto(IGalacticraftWorldProvider gcProvider) {
    this.sunSize = 17.5F * gcProvider.getSolarSize();
    GL11.glPushMatrix();// w  w  w  .  jav a2  s  . c om
    GL11.glNewList(this.starGLCallList, GL11.GL_COMPILE);
    this.renderStars();
    GL11.glEndList();
    GL11.glPopMatrix();
    Tessellator tessellator = Tessellator.instance;
    this.glSkyList = this.starGLCallList + 1;
    GL11.glNewList(this.glSkyList, GL11.GL_COMPILE);
    byte byte2 = 64;
    int i = 256 / byte2 + 2;
    float f = 16F;

    for (int j = -byte2 * i; j <= byte2 * i; j += byte2) {
        for (int l = -byte2 * i; l <= byte2 * i; l += byte2) {
            tessellator.startDrawingQuads();
            tessellator.addVertex(j + 0, f, l + 0);
            tessellator.addVertex(j + byte2, f, l + 0);
            tessellator.addVertex(j + byte2, f, l + byte2);
            tessellator.addVertex(j + 0, f, l + byte2);
            tessellator.draw();
        }
    }

    GL11.glEndList();
    this.glSkyList2 = this.starGLCallList + 2;
    GL11.glNewList(this.glSkyList2, GL11.GL_COMPILE);
    f = -16F;
    tessellator.startDrawingQuads();

    for (int k = -byte2 * i; k <= byte2 * i; k += byte2) {
        for (int i1 = -byte2 * i; i1 <= byte2 * i; i1 += byte2) {
            tessellator.addVertex(k + byte2, f, i1 + 0);
            tessellator.addVertex(k + 0, f, i1 + 0);
            tessellator.addVertex(k + 0, f, i1 + byte2);
            tessellator.addVertex(k + byte2, f, i1 + byte2);
        }
    }

    tessellator.draw();
    GL11.glEndList();
}

From source file:stevekung.mods.moreplanets.planets.polongnius.dimension.sky.SkyProviderPolongnius.java

License:Creative Commons License

public SkyProviderPolongnius(IGalacticraftWorldProvider marsProvider) {
    this.sunSize = 17.5F * marsProvider.getSolarSize();

    int displayLists = GLAllocation.generateDisplayLists(3);
    this.starList = displayLists;
    this.glSkyList = displayLists + 1;
    this.glSkyList2 = displayLists + 2;

    // Bind stars to display list
    GL11.glPushMatrix();/*from  www.ja v  a 2  s  . c om*/
    GL11.glNewList(this.starList, GL11.GL_COMPILE);
    this.renderStars();
    GL11.glEndList();
    GL11.glPopMatrix();

    Tessellator tessellator = Tessellator.instance;
    GL11.glNewList(this.glSkyList, GL11.GL_COMPILE);
    byte byte2 = 64;
    int i = 256 / byte2 + 2;
    float f = 16F;

    for (int j = -byte2 * i; j <= byte2 * i; j += byte2) {
        for (int l = -byte2 * i; l <= byte2 * i; l += byte2) {
            tessellator.startDrawingQuads();
            tessellator.addVertex(j + 0, f, l + 0);
            tessellator.addVertex(j + byte2, f, l + 0);
            tessellator.addVertex(j + byte2, f, l + byte2);
            tessellator.addVertex(j + 0, f, l + byte2);
            tessellator.draw();
        }
    }

    GL11.glEndList();
    GL11.glNewList(this.glSkyList2, GL11.GL_COMPILE);
    f = -16F;
    tessellator.startDrawingQuads();

    for (int k = -byte2 * i; k <= byte2 * i; k += byte2) {
        for (int i1 = -byte2 * i; i1 <= byte2 * i; i1 += byte2) {
            tessellator.addVertex(k + byte2, f, i1 + 0);
            tessellator.addVertex(k + 0, f, i1 + 0);
            tessellator.addVertex(k + 0, f, i1 + byte2);
            tessellator.addVertex(k + byte2, f, i1 + byte2);
        }
    }
    tessellator.draw();
    GL11.glEndList();
}

From source file:stevekung.mods.moreplanets.planets.siriusb.dimension.sky.SkyProviderSiriusB.java

License:Creative Commons License

public SkyProviderSiriusB(IGalacticraftWorldProvider gcProvider) {
    this.sunSize = 17.5F * gcProvider.getSolarSize();

    int displayLists = GLAllocation.generateDisplayLists(3);
    this.starList = displayLists;
    this.glSkyList = displayLists + 1;
    this.glSkyList2 = displayLists + 2;

    // Bind stars to display list
    GL11.glPushMatrix();/*  ww  w  .j  a v a  2s . c  o m*/
    GL11.glNewList(this.starList, GL11.GL_COMPILE);
    this.renderStars();
    GL11.glEndList();
    GL11.glPopMatrix();

    Tessellator tessellator = Tessellator.instance;
    GL11.glNewList(this.glSkyList, GL11.GL_COMPILE);
    byte byte2 = 64;
    int i = 256 / byte2 + 2;
    float f = 16F;

    for (int j = -byte2 * i; j <= byte2 * i; j += byte2) {
        for (int l = -byte2 * i; l <= byte2 * i; l += byte2) {
            tessellator.startDrawingQuads();
            tessellator.addVertex(j + 0, f, l + 0);
            tessellator.addVertex(j + byte2, f, l + 0);
            tessellator.addVertex(j + byte2, f, l + byte2);
            tessellator.addVertex(j + 0, f, l + byte2);
            tessellator.draw();
        }
    }

    GL11.glEndList();
    GL11.glNewList(this.glSkyList2, GL11.GL_COMPILE);
    f = -16F;
    tessellator.startDrawingQuads();

    for (int k = -byte2 * i; k <= byte2 * i; k += byte2) {
        for (int i1 = -byte2 * i; i1 <= byte2 * i; i1 += byte2) {
            tessellator.addVertex(k + byte2, f, i1 + 0);
            tessellator.addVertex(k + 0, f, i1 + 0);
            tessellator.addVertex(k + 0, f, i1 + byte2);
            tessellator.addVertex(k + byte2, f, i1 + byte2);
        }
    }

    tessellator.draw();
    GL11.glEndList();
}

From source file:stevekung.mods.moreplanets.planets.venus.dimension.sky.SkyProviderVenus.java

License:Creative Commons License

public SkyProviderVenus(IGalacticraftWorldProvider marsProvider) {
    this.sunSize = 17.5F * marsProvider.getSolarSize();

    int displayLists = GLAllocation.generateDisplayLists(3);
    this.starList = displayLists;
    this.glSkyList = displayLists + 1;
    this.glSkyList2 = displayLists + 2;

    // Bind stars to display list
    GL11.glPushMatrix();/*from  w w  w  . j a v  a 2 s .  co m*/
    GL11.glNewList(this.starList, GL11.GL_COMPILE);
    this.renderStars();
    GL11.glEndList();
    GL11.glPopMatrix();

    Tessellator tessellator = Tessellator.instance;
    GL11.glNewList(this.glSkyList, GL11.GL_COMPILE);
    byte byte2 = 64;
    int i = 256 / byte2 + 2;
    float f = 16F;

    for (int j = -byte2 * i; j <= byte2 * i; j += byte2) {
        for (int l = -byte2 * i; l <= byte2 * i; l += byte2) {
            tessellator.startDrawingQuads();
            tessellator.addVertex(j + 0, f, l + 0);
            tessellator.addVertex(j + byte2, f, l + 0);
            tessellator.addVertex(j + byte2, f, l + byte2);
            tessellator.addVertex(j + 0, f, l + byte2);
            tessellator.draw();
        }
    }

    GL11.glEndList();
    GL11.glNewList(this.glSkyList2, GL11.GL_COMPILE);
    f = -16F;
    tessellator.startDrawingQuads();

    for (int k = -byte2 * i; k <= byte2 * i; k += byte2) {
        for (int i1 = -byte2 * i; i1 <= byte2 * i; i1 += byte2) {
            tessellator.addVertex(k + byte2, f, i1 + 0);
            tessellator.addVertex(k + 0, f, i1 + 0);
            tessellator.addVertex(k + 0, f, i1 + byte2);
            tessellator.addVertex(k + byte2, f, i1 + byte2);
        }
    }

    tessellator.draw();
    GL11.glEndList();
}

From source file:taiga.mcmods.buildguide.BlockMarker.java

private void createDisplayList() {
    //if neded create the list
    if (displaylist == -1)
        displaylist = GL11.glGenLists(1);

    GL11.glNewList(displaylist, GL11.GL_COMPILE_AND_EXECUTE);

    GL11.glDisable(GL11.GL_FOG);//from  ww  w .ja v  a  2  s .c  o  m
    GL11.glDisable(GL11.GL_LIGHTING);
    GL11.glDisable(GL11.GL_BLEND);
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glEnable(GL11.GL_POINT_SMOOTH);

    GL11.glBegin(GL11.GL_POINTS);
    if (color != null)
        GL11.glColor3ub((byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue());
    for (Point3D pt : points)
        GL11.glVertex3d(pt.getX(), pt.getY(), pt.getZ());
    GL11.glEnd();

    GL11.glEnable(GL11.GL_TEXTURE_2D);

    GL11.glEndList();

    regendisplist = false;
}

From source file:valkyrienwarfare.mod.client.render.FastBlockModelRenderer.java

License:Open Source License

private static void renderBlockModelHighQualityHighRam(BufferBuilder BufferBuilder, Tessellator tessellator,
        World world, IBlockState blockstateToRender, int brightness) {
    Map<Integer, Integer> brightnessToGLListMap = highRamGLList.get(blockstateToRender);

    if (brightnessToGLListMap == null) {
        highRamGLList.put(blockstateToRender, new HashMap<Integer, Integer>());
        brightnessToGLListMap = highRamGLList.get(blockstateToRender);
    }//from   w ww. j ava  2 s.co m

    Integer glListForBrightness = brightnessToGLListMap.get(brightness);
    if (glListForBrightness == null) {
        GL11.glPushMatrix();
        int glList = GLAllocation.generateDisplayLists(1);
        GL11.glNewList(glList, GL11.GL_COMPILE);
        renderBlockModelHighQuality(BufferBuilder, tessellator, world, blockstateToRender, brightness);
        GL11.glEndList();
        GL11.glPopMatrix();
        glListForBrightness = glList;
        brightnessToGLListMap.put(brightness, glList);
    }

    GL11.glPushMatrix();
    GL11.glCallList(glListForBrightness);
    GL11.glPopMatrix();
}

From source file:yk.myengine.optiseq.states.LWJGLFont.java

/**
 * <code>buildDisplayList</code> sets up the 256 display lists that are used
 * to render each font character. Each list quad is 16x16, as defined by the
 * font image size./*from   w  ww .  j  a va2s  .co m*/
 */
public void buildDisplayList() {
    final int displacement = 10;
    final int symbolWidth = 16;
    final int symbolHeight = 16;
    final int symbolNumX = 16;
    final int symbolNumY = 16;
    final int symbolNumber = 256;
    float cx;
    float cy;
    final float texSymSizeX = (float) 1 / symbolNumX;
    final float texSymSizeY = (float) 1 / symbolNumY;
    base = GL11.glGenLists(symbolNumber);
    final float addDisY = texSymSizeY / 100;

    for (int loop = 0; loop < symbolNumber; loop++) {
        cx = (loop % symbolNumX) * texSymSizeX;
        cy = (loop / symbolNumY) * texSymSizeX;

        GL11.glNewList(base + loop, GL11.GL_COMPILE);
        GL11.glBegin(GL11.GL_QUADS);

        GL11.glTexCoord2f(cx, 1 - cy - addDisY);
        GL11.glVertex2i(0, symbolHeight);

        GL11.glTexCoord2f(cx, 1 - cy - texSymSizeY + addDisY);
        GL11.glVertex2i(0, 0);

        GL11.glTexCoord2f(cx + texSymSizeX, 1 - cy - texSymSizeY + addDisY);
        GL11.glVertex2i(symbolWidth, 0);

        GL11.glTexCoord2f(cx + texSymSizeX, 1 - cy - addDisY);
        GL11.glVertex2i(symbolWidth, symbolHeight);

        GL11.glEnd();
        GL11.glTranslatef(displacement, 0, 0);
        GL11.glEndList();
    }
}