List of usage examples for org.lwjgl.opengl GL11 glEndList
public static native void glEndList();
From source file:shadowmage.ancient_framework.client.model.Primitive.java
License:Open Source License
public void buildDisplayList() { if (this.displayListNumber < 0) { this.displayListNumber = GL11.glGenLists(1); }/*from w ww .j av a2 s . com*/ GL11.glNewList(displayListNumber, GL11.GL_COMPILE); if (x != 0 || y != 0 || z != 0) { GL11.glTranslatef(x, y, z); } if (rx != 0) { GL11.glRotatef(rx, 1, 0, 0); } if (ry != 0) { GL11.glRotatef(ry, 0, 1, 0); } if (rz != 0) { GL11.glRotatef(rz, 0, 0, 1); } renderForDisplayList(); if (x != 0 || y != 0 || z != 0) { GL11.glTranslatef(-x, -y, -z); } if (rx != 0) { GL11.glRotatef(-rx, 1, 0, 0); } if (ry != 0) { GL11.glRotatef(-ry, 0, 1, 0); } if (rz != 0) { GL11.glRotatef(-rz, 0, 0, 1); } GL11.glEndList(); setCompiled(true); }
From source file:shadowmage.meim.client.gui.GuiModelEditor.java
License:Open Source License
private void renderGrid() { GL11.glDisable(GL11.GL_TEXTURE_2D);/*w w w . j a v a 2s . c o m*/ GL11.glDisable(GL11.GL_LIGHTING); GL11.glLineWidth(2.f); if (gridDisplayList >= 0) { GL11.glCallList(gridDisplayList); } else { gridDisplayList = GL11.glGenLists(1); GL11.glNewList(gridDisplayList, GL11.GL_COMPILE_AND_EXECUTE); GL11.glColor4f(0.f, 0.f, 1.f, 1.f); for (int x = -5; x <= 5; x++) { GL11.glBegin(GL11.GL_LINE_LOOP); GL11.glVertex3f(x, 0.f, -5.f); GL11.glVertex3f(x, 0.f, 5.f); GL11.glEnd(); } for (int z = -5; z <= 5; z++) { GL11.glBegin(GL11.GL_LINE_LOOP); GL11.glVertex3f(-5.f, 0.f, z); GL11.glVertex3f(5.f, 0.f, z); GL11.glEnd(); } GL11.glColor4f(1.f, 1.f, 1.f, 1.f); GL11.glEndList(); } GL11.glEnable(GL11.GL_LIGHTING); GL11.glEnable(GL11.GL_TEXTURE_2D); }
From source file:stevekung.mods.moreplanets.core.handler.SkyProviderMarsMP.java
License:Creative Commons License
public SkyProviderMarsMP(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 ww.ja va 2s .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.moons.deimos.dimension.sky.SkyProviderDeimos.java
License:Creative Commons License
public SkyProviderDeimos(IGalacticraftWorldProvider gcProvider) { this.sunSize = 17.5F * gcProvider.getSolarSize(); GL11.glPushMatrix();/*w w w . java 2 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.moons.io.dimension.sky.SkyProviderIo.java
License:Creative Commons License
public SkyProviderIo(IGalacticraftWorldProvider provider) { int displayLists = GLAllocation.generateDisplayLists(3); this.starList = displayLists; this.glSkyList = displayLists + 1; this.glSkyList2 = displayLists + 2; // Bind stars to display list GL11.glPushMatrix();//from ww w .j a va 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:stevekung.mods.moreplanets.moons.koentus.dimension.sky.SkyProviderKoentus.java
License:Creative Commons License
public SkyProviderKoentus(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 ww w . j a v a 2 s. com 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.moons.phobos.dimension.sky.SkyProviderPhobos.java
License:Creative Commons License
public SkyProviderPhobos(IGalacticraftWorldProvider gcProvider) { this.sunSize = 17.5F * gcProvider.getSolarSize(); GL11.glPushMatrix();// w w w . j a va 2 s . c o m 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.diona.dimension.sky.SkyProviderDiona.java
License:Creative Commons License
public SkyProviderDiona(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 .ja va2 s. com 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.fronos.dimension.sky.SkyProviderFronos.java
License:Creative Commons License
public SkyProviderFronos(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();//ww w . j a v a 2 s . 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.kapteynb.dimension.sky.SkyProviderKapteynB.java
License:Creative Commons License
public SkyProviderKapteynB(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 ww w .j a va2s . 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(); }