List of usage examples for org.lwjgl.opengl GL11 GL_COMPILE
int GL_COMPILE
To view the source code for org.lwjgl.opengl GL11 GL_COMPILE.
Click Source Link
From source file:com.ardor3d.renderer.lwjgl.LwjglRenderer.java
License:Open Source License
/** * Start a new display list. All further renderer commands that can be stored in a display list are part of this new * list until {@link #endDisplayList()} is called. * /*from w ww . ja v a 2s. c om*/ * @return id of new display list */ public int startDisplayList() { final int id = GL11.glGenLists(1); GL11.glNewList(id, GL11.GL_COMPILE); return id; }
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 www .j a v a 2 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);//from w w w.j a v a 2 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(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 ww w .j a v a 2 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(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 w w w. j a v a 2s.c o 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.github.begla.blockmania.blocks.Block.java
License:Apache License
/** * Generates the display list used for rendering the block. * * @return The id of the display list/* www. j a va 2 s . com*/ */ private int generateDisplayList() { int id = glGenLists(1); glNewList(id, GL11.GL_COMPILE); glBegin(GL_QUADS); GL11.glColor3f(1.0f, 1.0f, 1.0f); // TOP GL11.glTexCoord2f(calcTextureOffsetFor(SIDE.TOP).x, calcTextureOffsetFor(SIDE.TOP).y); GL11.glVertex3f(-0.5f, 0.5f, 0.5f); GL11.glTexCoord2f(calcTextureOffsetFor(SIDE.TOP).x + 0.0624f, calcTextureOffsetFor(SIDE.TOP).y); GL11.glVertex3f(0.5f, 0.5f, 0.5f); GL11.glTexCoord2f(calcTextureOffsetFor(SIDE.TOP).x + 0.0624f, calcTextureOffsetFor(SIDE.TOP).y + 0.0624f); GL11.glVertex3f(0.5f, 0.5f, -0.5f); GL11.glTexCoord2f(calcTextureOffsetFor(SIDE.TOP).x, calcTextureOffsetFor(SIDE.TOP).y + 0.0624f); GL11.glVertex3f(-0.5f, 0.5f, -0.5f); // LEFT GL11.glTexCoord2f(calcTextureOffsetFor(SIDE.LEFT).x, calcTextureOffsetFor(SIDE.LEFT).y + 0.0624f); GL11.glVertex3f(-0.5f, -0.5f, -0.5f); GL11.glTexCoord2f(calcTextureOffsetFor(SIDE.LEFT).x + 0.0624f, calcTextureOffsetFor(SIDE.LEFT).y + 0.0624f); GL11.glVertex3f(-0.5f, -0.5f, 0.5f); GL11.glTexCoord2f(calcTextureOffsetFor(SIDE.LEFT).x + 0.0624f, calcTextureOffsetFor(SIDE.LEFT).y); GL11.glVertex3f(-0.5f, 0.5f, 0.5f); GL11.glTexCoord2f(calcTextureOffsetFor(SIDE.LEFT).x, calcTextureOffsetFor(SIDE.LEFT).y); GL11.glVertex3f(-0.5f, 0.5f, -0.5f); // BACK GL11.glTexCoord2f(calcTextureOffsetFor(SIDE.BACK).x, calcTextureOffsetFor(SIDE.BACK).y + 0.0624f); GL11.glVertex3f(-0.5f, -0.5f, 0.5f); GL11.glTexCoord2f(calcTextureOffsetFor(SIDE.BACK).x + 0.0624f, calcTextureOffsetFor(SIDE.BACK).y + 0.0624f); GL11.glVertex3f(0.5f, -0.5f, 0.5f); GL11.glTexCoord2f(calcTextureOffsetFor(SIDE.BACK).x + 0.0624f, calcTextureOffsetFor(SIDE.BACK).y); GL11.glVertex3f(0.5f, 0.5f, 0.5f); GL11.glTexCoord2f(calcTextureOffsetFor(SIDE.BACK).x, calcTextureOffsetFor(SIDE.BACK).y); GL11.glVertex3f(-0.5f, 0.5f, 0.5f); // RIGHT GL11.glTexCoord2f(calcTextureOffsetFor(SIDE.RIGHT).x, calcTextureOffsetFor(SIDE.RIGHT).y); GL11.glVertex3f(0.5f, 0.5f, -0.5f); GL11.glTexCoord2f(calcTextureOffsetFor(SIDE.RIGHT).x + 0.0624f, calcTextureOffsetFor(SIDE.RIGHT).y); GL11.glVertex3f(0.5f, 0.5f, 0.5f); GL11.glTexCoord2f(calcTextureOffsetFor(SIDE.RIGHT).x + 0.0624f, calcTextureOffsetFor(SIDE.RIGHT).y + 0.0624f); GL11.glVertex3f(0.5f, -0.5f, 0.5f); GL11.glTexCoord2f(calcTextureOffsetFor(SIDE.RIGHT).x, calcTextureOffsetFor(SIDE.RIGHT).y + 0.0624f); GL11.glVertex3f(0.5f, -0.5f, -0.5f); GL11.glColor3f(0.5f, 0.5f, 0.5f); // FRONT GL11.glTexCoord2f(calcTextureOffsetFor(SIDE.FRONT).x, calcTextureOffsetFor(SIDE.FRONT).y); GL11.glVertex3f(-0.5f, 0.5f, -0.5f); GL11.glTexCoord2f(calcTextureOffsetFor(SIDE.FRONT).x + 0.0624f, calcTextureOffsetFor(SIDE.FRONT).y); GL11.glVertex3f(0.5f, 0.5f, -0.5f); GL11.glTexCoord2f(calcTextureOffsetFor(SIDE.FRONT).x + 0.0624f, calcTextureOffsetFor(SIDE.FRONT).y + 0.0624f); GL11.glVertex3f(0.5f, -0.5f, -0.5f); GL11.glTexCoord2f(calcTextureOffsetFor(SIDE.FRONT).x, calcTextureOffsetFor(SIDE.FRONT).y + 0.0624f); GL11.glVertex3f(-0.5f, -0.5f, -0.5f); // BOTTOM GL11.glTexCoord2f(calcTextureOffsetFor(SIDE.BOTTOM).x, calcTextureOffsetFor(SIDE.BOTTOM).y); GL11.glVertex3f(-0.5f, -0.5f, -0.5f); GL11.glTexCoord2f(calcTextureOffsetFor(SIDE.BOTTOM).x + 0.0624f, calcTextureOffsetFor(SIDE.BOTTOM).y); GL11.glVertex3f(0.5f, -0.5f, -0.5f); GL11.glTexCoord2f(calcTextureOffsetFor(SIDE.BOTTOM).x + 0.0624f, calcTextureOffsetFor(SIDE.BOTTOM).y + 0.0624f); GL11.glVertex3f(0.5f, -0.5f, 0.5f); GL11.glTexCoord2f(calcTextureOffsetFor(SIDE.BOTTOM).x, calcTextureOffsetFor(SIDE.BOTTOM).y + 0.0624f); GL11.glVertex3f(-0.5f, -0.5f, 0.5f); GL11.glEnd(); glEndList(); return id; }
From source file:com.github.begla.blockmania.rendering.helper.Primitives.java
License:Apache License
public static int generateColoredBlock(Vector4f color, float size) { int id = glGenLists(1); GL11.glNewList(id, GL11.GL_COMPILE); GL11.glBegin(GL11.GL_QUADS);//from ww w.j a va2s . co m GL11.glColor4f(color.x, color.y, color.z, color.w); float sHalf = size / 2; // TOP GL11.glVertex3f(-sHalf, sHalf, sHalf); GL11.glVertex3f(sHalf, sHalf, sHalf); GL11.glVertex3f(sHalf, sHalf, -sHalf); GL11.glVertex3f(-sHalf, sHalf, -sHalf); // LEFT GL11.glVertex3f(-sHalf, -sHalf, -sHalf); GL11.glVertex3f(-sHalf, -sHalf, sHalf); GL11.glVertex3f(-sHalf, sHalf, sHalf); GL11.glVertex3f(-sHalf, sHalf, -sHalf); // RIGHT GL11.glVertex3f(sHalf, sHalf, -sHalf); GL11.glVertex3f(sHalf, sHalf, sHalf); GL11.glVertex3f(sHalf, -sHalf, sHalf); GL11.glVertex3f(sHalf, -sHalf, -sHalf); GL11.glColor4f(0.85f * color.x, 0.85f * color.y, 0.85f * color.z, color.w); // FRONT GL11.glVertex3f(-sHalf, sHalf, -sHalf); GL11.glVertex3f(sHalf, sHalf, -sHalf); GL11.glVertex3f(sHalf, -sHalf, -sHalf); GL11.glVertex3f(-sHalf, -sHalf, -sHalf); // BACK GL11.glVertex3f(-sHalf, -sHalf, sHalf); GL11.glVertex3f(sHalf, -sHalf, sHalf); GL11.glVertex3f(sHalf, sHalf, sHalf); GL11.glVertex3f(-sHalf, sHalf, sHalf); // BOTTOM GL11.glVertex3f(-sHalf, -sHalf, -sHalf); GL11.glVertex3f(sHalf, -sHalf, -sHalf); GL11.glVertex3f(sHalf, -sHalf, sHalf); GL11.glVertex3f(-sHalf, -sHalf, sHalf); GL11.glEnd(); GL11.glEndList(); return id; }
From source file:com.github.begla.blockmania.rendering.particles.BlockParticle.java
License:Apache License
protected void renderParticle() { if (_displayLists[_blockType] == 0) { _displayLists[_blockType] = glGenLists(1); glNewList(_displayLists[_blockType], GL11.GL_COMPILE); drawParticle();/* www. j a v a2 s .co m*/ glEndList(); } BlockParticleEmitter pE = (BlockParticleEmitter) getParent(); double lightValueSun = ((double) pE.getParent().getWorldProvider().getLightAtPosition(_position, Chunk.LIGHT_TYPE.SUN)); lightValueSun = (lightValueSun / 15.0) * pE.getParent().getDaylight(); double lightValueBlock = pE.getParent().getWorldProvider().getLightAtPosition(_position, Chunk.LIGHT_TYPE.BLOCK); lightValueBlock = lightValueBlock / 15.0; float lightValue = (float) Math.max(lightValueSun, lightValueBlock) * _lightOffset; int light = GL20.glGetUniformLocation(ShaderManager.getInstance().getShader("particle"), "light"); int texOffsetX = GL20.glGetUniformLocation(ShaderManager.getInstance().getShader("particle"), "texOffsetX"); int texOffsetY = GL20.glGetUniformLocation(ShaderManager.getInstance().getShader("particle"), "texOffsetY"); GL20.glUniform1f(light, lightValue); GL20.glUniform1f(texOffsetX, _texOffsetX); GL20.glUniform1f(texOffsetY, _texOffsetY); glCallList(_displayLists[_blockType]); }
From source file:com.github.begla.blockmania.world.horizon.Skysphere.java
License:Apache License
private void drawSphere() { if (_displayListSphere == -1) { _displayListSphere = glGenLists(1); Sphere sphere = new Sphere(); glNewList(_displayListSphere, GL11.GL_COMPILE); sphere.draw(16, 16, 128);/*ww w . j av a 2 s . c o m*/ glEndList(); } glCallList(_displayListSphere); }
From source file:com.kegare.frozenland.client.renderer.FrozenlandSkyRenderer.java
License:Minecraft Mod Public
public FrozenlandSkyRenderer() { this.starGLCallList = GLAllocation.generateDisplayLists(3); GL11.glPushMatrix();/*from ww w . ja v a 2 s. c om*/ GL11.glNewList(starGLCallList, GL11.GL_COMPILE); renderStars(); GL11.glEndList(); GL11.glPopMatrix(); }