List of usage examples for org.lwjgl.opengl GL11 glEndList
public static native void glEndList();
From source file:buildcraft.transport.RenderPipe.java
License:Minecraft Mod Public
private void initializeDisplayPowerList(World world) { if (initialized) return;//ww w . ja va 2 s . c o m initialized = true; BlockInterface block = new BlockInterface(); block.texture = 0 * 16 + 4; float size = Utils.pipeMaxPos - Utils.pipeMinPos; for (int s = 0; s < displayPowerStages; ++s) { displayPowerList[s] = GLAllocation.generateDisplayLists(1); GL11.glNewList(displayPowerList[s], 4864 /* GL_COMPILE */); float minSize = 0.005F; float unit = (size - minSize) / 2F / displayPowerStages; block.minY = 0.5 - (minSize / 2F) - unit * s; block.maxY = 0.5 + (minSize / 2F) + unit * s; block.minZ = 0.5 - (minSize / 2F) - unit * s; block.maxZ = 0.5 + (minSize / 2F) + unit * s; block.minX = 0; block.maxX = 0.5 + (minSize / 2F) + unit * s; RenderEntityBlock.renderBlock(block, world, 0, 0, 0, false, true); GL11.glEndList(); } for (int i = 0; i < displayPowerStages; ++i) displayPowerLimits[displayPowerStages - i - 1] = maxPower - Math.sqrt(maxPower * maxPower / (displayPowerStages - 1) * i); }
From source file:cn.lambdalib.util.deprecated.Mesh.java
License:MIT License
private void redraw(Material mat, boolean execute) { if (doesBuffer) { if (listID == -1) { listID = GL11.glGenLists(1); GL11.glNewList(listID, execute ? GL11.GL_COMPILE_AND_EXECUTE : GL11.GL_COMPILE); }/*from w w w. j a v a 2 s . c o m*/ } mat.onRenderStage(RenderStage.START); GL11.glPushMatrix(); mat.onRenderStage(RenderStage.BEFORE_TESSELLATE); Tessellator t = Tessellator.instance; t.startDrawing(GL11.GL_TRIANGLES); mat.onRenderStage(RenderStage.START_TESSELLATE); if (uvs != null) { if (triangles != null) { for (int i : triangles) { double[] vert = vertices[i]; double[] uv = uvs[i]; if (normals != null) { t.setNormal(normals[i][0], normals[i][1], normals[i][2]); } t.addVertexWithUV(vert[0], vert[1], vert[2], uv[0], uv[1]); } } } else { if (triangles != null) { for (int i : triangles) { double[] vert = vertices[i]; if (normals != null) { t.setNormal(normals[i][0], normals[i][1], normals[i][2]); } t.addVertex(vert[0], vert[1], vert[2]); } } } t.draw(); GL11.glPopMatrix(); mat.onRenderStage(RenderStage.END); for (Mesh m : this.sub) { m.draw(mat); } if (doesBuffer) { GL11.glEndList(); } }
From source file:com.ardor3d.renderer.lwjgl.LwjglFont.java
License:Open Source License
/** * <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. *//* ww w . j av a 2 s. c o m*/ public void buildDisplayList() { float cx; float cy; base = GL11.glGenLists(256); for (int loop = 0; loop < 256; loop++) { cx = (loop % 16) / 16.0f; cy = (loop / 16) / 16.0f; GL11.glNewList(base + loop, GL11.GL_COMPILE); GL11.glBegin(GL11.GL_QUADS); GL11.glTexCoord2f(cx, 1 - cy - 0.0625f); GL11.glVertex2i(0, 0); GL11.glTexCoord2f(cx + 0.0625f, 1 - cy - 0.0625f); GL11.glVertex2i(16, 0); GL11.glTexCoord2f(cx + 0.0625f, 1 - cy); GL11.glVertex2i(16, 16); GL11.glTexCoord2f(cx, 1 - cy); GL11.glVertex2i(0, 16); GL11.glEnd(); GL11.glTranslatef(10, 0, 0); GL11.glEndList(); } }
From source file:com.ardor3d.renderer.lwjgl.LwjglRenderer.java
License:Open Source License
/** * Ends a display list. Will likely cause an OpenGL exception is a display list is not currently being generated. */ public void endDisplayList() { GL11.glEndList(); }
From source file:com.blogspot.jabelarminecraft.blocksmith.proxy.ClientProxy.java
License:Open Source License
public void createSphereCallList() { Sphere sphere = new Sphere(); //GLU_POINT will render it as dots. //GLU_LINE will render as wireframe //GLU_SILHOUETTE will render as ?shadowed? wireframe //GLU_FILL as a solid. sphere.setDrawStyle(GLU.GLU_FILL);/*from w w w . j a v a2 s . c o m*/ //GLU_SMOOTH will try to smoothly apply lighting //GLU_FLAT will have a solid brightness per face, and will not shade. //GLU_NONE will be completely solid, and probably will have no depth to it's appearance. sphere.setNormals(GLU.GLU_SMOOTH); //GLU_INSIDE will render as if you are inside the sphere, making it appear inside out.(Similar to how ender portals are rendered) sphere.setOrientation(GLU.GLU_OUTSIDE); sphereIdOutside = GL11.glGenLists(1); //Create a new list to hold our sphere data. GL11.glNewList(sphereIdOutside, GL11.GL_COMPILE); //binds the texture ResourceLocation rL = new ResourceLocation(BlockSmith.MODID + ":textures/entities/sphere.png"); Minecraft.getMinecraft().getTextureManager().bindTexture(rL); //The drawing the sphere is automatically doing is getting added to our list. Careful, the last 2 variables //control the detail, but have a massive impact on performance. 32x32 is a good balance on my machine.s sphere.draw(0.5F, 32, 32); GL11.glEndList(); //GLU_INSIDE will render as if you are inside the sphere, making it appear inside out.(Similar to how ender portals are rendered) sphere.setOrientation(GLU.GLU_INSIDE); sphereIdInside = GL11.glGenLists(1); //Create a new list to hold our sphere data. GL11.glNewList(sphereIdInside, GL11.GL_COMPILE); Minecraft.getMinecraft().getTextureManager().bindTexture(rL); //The drawing the sphere is automatically doing is getting added to our list. Careful, the last 2 variables //control the detail, but have a massive impact on performance. 32x32 is a good balance on my machine.s sphere.draw(0.5F, 32, 32); GL11.glEndList(); }
From source file:com.blogspot.jabelarminecraft.magicbeans.proxy.ClientProxy.java
License:Open Source License
public void createSphereCallList() { Sphere sphere = new Sphere(); //GLU_POINT will render it as dots. //GLU_LINE will render as wireframe //GLU_SILHOUETTE will render as ?shadowed? wireframe //GLU_FILL as a solid. sphere.setDrawStyle(GLU.GLU_FILL);//w ww.j a v a2 s . c om //GLU_SMOOTH will try to smoothly apply lighting //GLU_FLAT will have a solid brightness per face, and will not shade. //GLU_NONE will be completely solid, and probably will have no depth to it's appearance. sphere.setNormals(GLU.GLU_SMOOTH); //GLU_INSIDE will render as if you are inside the sphere, making it appear inside out.(Similar to how ender portals are rendered) sphere.setOrientation(GLU.GLU_OUTSIDE); sphereIdOutside = GL11.glGenLists(1); //Create a new list to hold our sphere data. GL11.glNewList(sphereIdOutside, GL11.GL_COMPILE); //binds the texture ResourceLocation rL = new ResourceLocation(MagicBeans.MODID + ":textures/entities/sphere.png"); Minecraft.getMinecraft().getTextureManager().bindTexture(rL); //The drawing the sphere is automatically doing is getting added to our list. Careful, the last 2 variables //control the detail, but have a massive impact on performance. 32x32 is a good balance on my machine.s sphere.draw(0.5F, 32, 32); GL11.glEndList(); //GLU_INSIDE will render as if you are inside the sphere, making it appear inside out.(Similar to how ender portals are rendered) sphere.setOrientation(GLU.GLU_INSIDE); sphereIdInside = GL11.glGenLists(1); //Create a new list to hold our sphere data. GL11.glNewList(sphereIdInside, GL11.GL_COMPILE); Minecraft.getMinecraft().getTextureManager().bindTexture(rL); //The drawing the sphere is automatically doing is getting added to our list. Careful, the last 2 variables //control the detail, but have a massive impact on performance. 32x32 is a good balance on my machine.s sphere.draw(0.5F, 32, 32); GL11.glEndList(); }
From source file:com.blogspot.jabelarminecraft.movinglightsource.proxy.ClientProxy.java
License:Open Source License
public void createSphereCallList() { Sphere sphere = new Sphere(); //GLU_POINT will render it as dots. //GLU_LINE will render as wireframe //GLU_SILHOUETTE will render as ?shadowed? wireframe //GLU_FILL as a solid. sphere.setDrawStyle(GLU.GLU_FILL);//from w w w. j a v a 2s . c o m //GLU_SMOOTH will try to smoothly apply lighting //GLU_FLAT will have a solid brightness per face, and will not shade. //GLU_NONE will be completely solid, and probably will have no depth to it's appearance. sphere.setNormals(GLU.GLU_SMOOTH); //GLU_INSIDE will render as if you are inside the sphere, making it appear inside out.(Similar to how ender portals are rendered) sphere.setOrientation(GLU.GLU_OUTSIDE); sphereIdOutside = GL11.glGenLists(1); //Create a new list to hold our sphere data. GL11.glNewList(sphereIdOutside, GL11.GL_COMPILE); //binds the texture ResourceLocation rL = new ResourceLocation(MovingLightSource.MODID + ":textures/entities/sphere.png"); Minecraft.getMinecraft().getTextureManager().bindTexture(rL); //The drawing the sphere is automatically doing is getting added to our list. Careful, the last 2 variables //control the detail, but have a massive impact on performance. 32x32 is a good balance on my machine.s sphere.draw(0.5F, 32, 32); GL11.glEndList(); //GLU_INSIDE will render as if you are inside the sphere, making it appear inside out.(Similar to how ender portals are rendered) sphere.setOrientation(GLU.GLU_INSIDE); sphereIdInside = GL11.glGenLists(1); //Create a new list to hold our sphere data. GL11.glNewList(sphereIdInside, GL11.GL_COMPILE); Minecraft.getMinecraft().getTextureManager().bindTexture(rL); //The drawing the sphere is automatically doing is getting added to our list. Careful, the last 2 variables //control the detail, but have a massive impact on performance. 32x32 is a good balance on my machine.s sphere.draw(0.5F, 32, 32); GL11.glEndList(); }
From source file:com.blogspot.jabelarminecraft.wildanimals.models.ModelRendererWildAnimals.java
License:Open Source License
/** * Compiles a GL display list for this model *///from www. j av a2s. co m @SideOnly(Side.CLIENT) private void compileDisplayList(float par1) { this.displayList = GLAllocation.generateDisplayLists(1); GL11.glNewList(this.displayList, GL11.GL_COMPILE); Tessellator tessellator = Tessellator.instance; for (int i = 0; i < this.cubeList.size(); ++i) { ((ModelBoxWildAnimals) this.cubeList.get(i)).render(tessellator, par1); } GL11.glEndList(); this.compiled = true; }
From source file:com.CiD.MysteryMod.TecEvolution.Buildcraft.FluidRenderer.java
License:Minecraft Mod Public
public static int[] getFluidDisplayLists(FluidStack fluidStack, World world, boolean flowing) { if (fluidStack == null) { return null; }//from w ww.j av a 2s. c o m Fluid fluid = fluidStack.getFluid(); if (fluid == null) { return null; } Map<Fluid, int[]> cache = flowing ? flowingRenderCache : stillRenderCache; int[] diplayLists = cache.get(fluid); if (diplayLists != null) { return diplayLists; } diplayLists = new int[DISPLAY_STAGES]; if (fluid.getBlock() != null) { liquidBlock.baseBlock = fluid.getBlock(); liquidBlock.texture = getFluidTexture(fluidStack, flowing); } else { liquidBlock.baseBlock = Blocks.water; liquidBlock.texture = getFluidTexture(fluidStack, flowing); } cache.put(fluid, diplayLists); GL11.glDisable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_BLEND); GL11.glDisable(GL11.GL_CULL_FACE); for (int s = 0; s < DISPLAY_STAGES; ++s) { diplayLists[s] = GLAllocation.generateDisplayLists(1); GL11.glNewList(diplayLists[s], 4864 /*GL_COMPILE*/); liquidBlock.minX = 0f; liquidBlock.minY = 0; liquidBlock.minZ = 0; liquidBlock.maxX = 1f; liquidBlock.maxY = (float) s / (float) DISPLAY_STAGES; liquidBlock.maxZ = 1; RenderEntityBlock.INSTANCE.renderBlock(liquidBlock); GL11.glEndList(); } GL11.glColor4f(1, 1, 1, 1); GL11.glEnable(GL11.GL_CULL_FACE); GL11.glEnable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_LIGHTING); return diplayLists; }
From source file:com.github.begla.blockmania.game.mobs.GelatinousCube.java
License:Apache License
private void generateDisplayList() { _displayListOuterBody = glGenLists(1); _displayListInnerBody = glGenLists(1); glNewList(_displayListOuterBody, GL_COMPILE); glBegin(GL_QUADS);/*from ww w . j ava2 s . c o m*/ GL11.glColor4f(1.0f, 1.0f, 1.0f, 0.8f); // TOP GL11.glTexCoord2f(0f / 64f, 28f / 32f); GL11.glVertex3f(-WIDTH_HALF, HEIGHT_HALF, WIDTH_HALF); GL11.glTexCoord2f(6f / 64f, 28f / 32f); GL11.glVertex3f(WIDTH_HALF, HEIGHT_HALF, WIDTH_HALF); GL11.glTexCoord2f(6f / 64f, 22f / 32f); GL11.glVertex3f(WIDTH_HALF, HEIGHT_HALF, -WIDTH_HALF); GL11.glTexCoord2f(0f / 64f, 22f / 32f); GL11.glVertex3f(-WIDTH_HALF, HEIGHT_HALF, -WIDTH_HALF); // LEFT GL11.glTexCoord2f(0f / 64f, 28f / 32f); GL11.glVertex3f(-WIDTH_HALF, -HEIGHT_HALF, -WIDTH_HALF); GL11.glTexCoord2f(6f / 64f, 28f / 32f); GL11.glVertex3f(-WIDTH_HALF, -HEIGHT_HALF, WIDTH_HALF); GL11.glTexCoord2f(6f / 64f, 22f / 32f); GL11.glVertex3f(-WIDTH_HALF, HEIGHT_HALF, WIDTH_HALF); GL11.glTexCoord2f(0f / 64f, 22f / 32f); GL11.glVertex3f(-WIDTH_HALF, HEIGHT_HALF, -WIDTH_HALF); // BACK GL11.glTexCoord2f(0f / 64f, 28f / 32f); GL11.glVertex3f(-WIDTH_HALF, -HEIGHT_HALF, WIDTH_HALF); GL11.glTexCoord2f(6f / 64f, 28f / 32f); GL11.glVertex3f(WIDTH_HALF, -HEIGHT_HALF, WIDTH_HALF); GL11.glTexCoord2f(6f / 64f, 22f / 32f); GL11.glVertex3f(WIDTH_HALF, HEIGHT_HALF, WIDTH_HALF); GL11.glTexCoord2f(0f / 64f, 22f / 32f); GL11.glVertex3f(-WIDTH_HALF, HEIGHT_HALF, WIDTH_HALF); // RIGHT GL11.glTexCoord2f(0f / 64f, 28f / 32f); GL11.glVertex3f(WIDTH_HALF, HEIGHT_HALF, -WIDTH_HALF); GL11.glTexCoord2f(6f / 64f, 28f / 32f); GL11.glVertex3f(WIDTH_HALF, HEIGHT_HALF, WIDTH_HALF); GL11.glTexCoord2f(6f / 64f, 22f / 32f); GL11.glVertex3f(WIDTH_HALF, -HEIGHT_HALF, WIDTH_HALF); GL11.glTexCoord2f(0f / 64f, 22f / 32f); GL11.glVertex3f(WIDTH_HALF, -HEIGHT_HALF, -WIDTH_HALF); GL11.glColor4f(0.8f, 0.8f, 0.8f, 0.8f); // FRONT GL11.glTexCoord2f(0f / 64f, 28f / 32f); GL11.glVertex3f(-WIDTH_HALF, HEIGHT_HALF, -WIDTH_HALF); GL11.glTexCoord2f(6f / 64f, 28f / 32f); GL11.glVertex3f(WIDTH_HALF, HEIGHT_HALF, -WIDTH_HALF); GL11.glTexCoord2f(6f / 64f, 22f / 32f); GL11.glVertex3f(WIDTH_HALF, -HEIGHT_HALF, -WIDTH_HALF); GL11.glTexCoord2f(0f / 64f, 22f / 32f); GL11.glVertex3f(-WIDTH_HALF, -HEIGHT_HALF, -WIDTH_HALF); // BOTTOM GL11.glTexCoord2f(0f / 64f, 28f / 32f); GL11.glVertex3f(-WIDTH_HALF, -HEIGHT_HALF, -WIDTH_HALF); GL11.glTexCoord2f(6f / 64f, 28f / 32f); GL11.glVertex3f(WIDTH_HALF, -HEIGHT_HALF, -WIDTH_HALF); GL11.glTexCoord2f(6f / 64f, 22f / 32f); GL11.glVertex3f(WIDTH_HALF, -HEIGHT_HALF, WIDTH_HALF); GL11.glTexCoord2f(0f / 64f, 22f / 32f); GL11.glVertex3f(-WIDTH_HALF, -HEIGHT_HALF, WIDTH_HALF); GL11.glEnd(); GL11.glEndList(); glNewList(_displayListInnerBody, GL_COMPILE); glBegin(GL_QUADS); GL11.glColor4f(0.8f, 0.8f, 0.8f, 1.0f); // TOP GL11.glTexCoord2f(0f / 64f, 28f / 32f); GL11.glVertex3f(-WIDTH_HALF / 2, HEIGHT_HALF / 2, WIDTH_HALF / 2); GL11.glTexCoord2f(6f / 64f, 28f / 32f); GL11.glVertex3f(WIDTH_HALF / 2, HEIGHT_HALF / 2, WIDTH_HALF / 2); GL11.glTexCoord2f(6f / 64f, 22f / 32f); GL11.glVertex3f(WIDTH_HALF / 2, HEIGHT_HALF / 2, -WIDTH_HALF / 2); GL11.glTexCoord2f(0f / 64f, 22f / 32f); GL11.glVertex3f(-WIDTH_HALF / 2, HEIGHT_HALF / 2, -WIDTH_HALF / 2); // LEFT GL11.glTexCoord2f(0f / 64f, 28f / 32f); GL11.glVertex3f(-WIDTH_HALF / 2, -HEIGHT_HALF / 2, -WIDTH_HALF / 2); GL11.glTexCoord2f(6f / 64f, 28f / 32f); GL11.glVertex3f(-WIDTH_HALF / 2, -HEIGHT_HALF / 2, WIDTH_HALF / 2); GL11.glTexCoord2f(6f / 64f, 22f / 32f); GL11.glVertex3f(-WIDTH_HALF / 2, HEIGHT_HALF / 2, WIDTH_HALF / 2); GL11.glTexCoord2f(0f / 64f, 22f / 32f); GL11.glVertex3f(-WIDTH_HALF / 2, HEIGHT_HALF / 2, -WIDTH_HALF / 2); // BACK GL11.glTexCoord2f(0f / 64f, 28f / 32f); GL11.glVertex3f(-WIDTH_HALF / 2, -HEIGHT_HALF / 2, WIDTH_HALF / 2); GL11.glTexCoord2f(6f / 64f, 28f / 32f); GL11.glVertex3f(WIDTH_HALF / 2, -HEIGHT_HALF / 2, WIDTH_HALF / 2); GL11.glTexCoord2f(6f / 64f, 22f / 32f); GL11.glVertex3f(WIDTH_HALF / 2, HEIGHT_HALF / 2, WIDTH_HALF / 2); GL11.glTexCoord2f(0f / 64f, 22f / 32f); GL11.glVertex3f(-WIDTH_HALF / 2, HEIGHT_HALF / 2, WIDTH_HALF / 2); // RIGHT GL11.glTexCoord2f(0f / 64f, 28f / 32f); GL11.glVertex3f(WIDTH_HALF / 2, HEIGHT_HALF / 2, -WIDTH_HALF / 2); GL11.glTexCoord2f(6f / 64f, 28f / 32f); GL11.glVertex3f(WIDTH_HALF / 2, HEIGHT_HALF / 2, WIDTH_HALF / 2); GL11.glTexCoord2f(6f / 64f, 22f / 32f); GL11.glVertex3f(WIDTH_HALF / 2, -HEIGHT_HALF / 2, WIDTH_HALF / 2); GL11.glTexCoord2f(0f / 64f, 22f / 32f); GL11.glVertex3f(WIDTH_HALF / 2, -HEIGHT_HALF / 2, -WIDTH_HALF / 2); GL11.glColor4f(0.6f, 0.6f, 0.6f, 1.0f); // FRONT GL11.glTexCoord2f(0f / 64f, 28f / 32f); GL11.glVertex3f(-WIDTH_HALF / 2, HEIGHT_HALF / 2, -WIDTH_HALF / 2); GL11.glTexCoord2f(6f / 64f, 28f / 32f); GL11.glVertex3f(WIDTH_HALF / 2, HEIGHT_HALF / 2, -WIDTH_HALF / 2); GL11.glTexCoord2f(6f / 64f, 22f / 32f); GL11.glVertex3f(WIDTH_HALF / 2, -HEIGHT_HALF / 2, -WIDTH_HALF / 2); GL11.glTexCoord2f(0f / 64f, 22f / 32f); GL11.glVertex3f(-WIDTH_HALF / 2, -HEIGHT_HALF / 2, -WIDTH_HALF / 2); // BOTTOM GL11.glTexCoord2f(0f / 64f, 28f / 32f); GL11.glVertex3f(-WIDTH_HALF / 2, -HEIGHT_HALF / 2, -WIDTH_HALF / 2); GL11.glTexCoord2f(6f / 64f, 28f / 32f); GL11.glVertex3f(WIDTH_HALF / 2, -HEIGHT_HALF / 2, -WIDTH_HALF / 2); GL11.glTexCoord2f(6f / 64f, 22f / 32f); GL11.glVertex3f(WIDTH_HALF / 2, -HEIGHT_HALF / 2, WIDTH_HALF / 2); GL11.glTexCoord2f(0f / 64f, 22f / 32f); GL11.glVertex3f(-WIDTH_HALF / 2, -HEIGHT_HALF / 2, WIDTH_HALF / 2); GL11.glEnd(); GL11.glEndList(); }