List of usage examples for org.lwjgl.opengl GL11 glCallList
public static native void glCallList(@NativeType("GLuint") int list);
From source file:fable.framework.ui.views.chiPlotView.java
License:Open Source License
/** * Display list (glCallList )created and compiled previously in * drawReliefList.//w w w . ja va 2 s .c o m * */ static void drawRelief() { canvas.setCurrent(); try { GLContext.useContext(canvas); } catch (LWJGLException e) { e.printStackTrace(); } GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT); if (!freeze) grip.adjust(); if (image != null) { GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT); GL11.glDisable(GL11.GL_LIGHTING); // Execute a display list here GL11.glCallList(reliefList); GL11.glEnable(GL11.GL_LIGHTING); } }
From source file:fable.imageviewer.views.ReliefView.java
License:Open Source License
private void drawRelief() { canvas.setCurrent();/* ww w . j a v a 2 s . co m*/ try { GLContext.useContext(canvas); } catch (LWJGLException ex) { FableUtils.excMsg(ReliefView.class, "Error in drawRelief using GLContext.useContext", ex); } // context.makeCurrent(); // gl = context.getGL (); GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT); if (!freeze) grip.adjust(); if (image != null) { GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT); GL11.glDisable(GL11.GL_LIGHTING); GL11.glCallList(reliefList); GL11.glEnable(GL11.GL_LIGHTING); } }
From source file:fexcraft.tmt.slim.ModelRendererTurbo.java
private void callDisplayList(float f) { if (displayList == null) { compileDisplayList(f);//for the optimized models we actually gotta do stuff backwards. } else if (useLegacyCompiler) { GL11.glCallList(displayList); } else {/*ww w .j a va 2s . c om*/ TextureManager renderEngine = Minecraft.getMinecraft().renderEngine; Collection<TextureGroup> textures = textureGroup.values(); Iterator<TextureGroup> itr = textures.iterator(); for (int i = 0; itr.hasNext(); i++) { TextureGroup curTexGroup = itr.next(); curTexGroup.loadTexture(); GL11.glCallList(displayListArray[i]); if (!defaultTexture.equals("")) { renderEngine.bindTexture(new ResourceLocation("", defaultTexture)); } } } }
From source file:hellfirepvp.astralsorcery.client.render.tile.TESRCelestialCrystals.java
License:Open Source License
private void renderCelestialCrystals(int stage) { GL11.glPushMatrix();/*from w ww . jav a 2s .c o m*/ texCelestialCrystals.bind(); int dlSelected; WavefrontObject obj; switch (stage) { case 0: dlSelected = dlC0; obj = OBJModelLibrary.crystalsStage0; break; case 1: dlSelected = dlC1; obj = OBJModelLibrary.crystalsStage1; break; case 2: dlSelected = dlC2; obj = OBJModelLibrary.crystalsStage2; break; case 3: dlSelected = dlC3; obj = OBJModelLibrary.crystalsStage3; break; case 4: dlSelected = dlC4; obj = OBJModelLibrary.crystalsStage4; break; default: dlSelected = dlC0; obj = OBJModelLibrary.crystalsStage0; break; } if (dlSelected == -1) { dlSelected = GLAllocation.generateDisplayLists(1); switch (stage) { case 0: dlC0 = dlSelected; break; case 1: dlC1 = dlSelected; break; case 2: dlC2 = dlSelected; break; case 3: dlC3 = dlSelected; break; case 4: dlC4 = dlSelected; break; default: dlC0 = dlSelected; break; } GL11.glNewList(dlSelected, GL11.GL_COMPILE); obj.renderAll(true); GL11.glEndList(); } GL11.glCallList(dlSelected); GL11.glPopMatrix(); }
From source file:hellfirepvp.astralsorcery.client.render.tile.TESRCollectorCrystal.java
License:Open Source License
private static void renderTile(BindableResource tex) { GL11.glPushMatrix();//from w ww . j a va 2 s . c o m GL11.glScalef(0.13F, 0.13F, 0.13F); tex.bind(); if (dlCrystal == -1) { dlCrystal = GLAllocation.generateDisplayLists(1); GL11.glNewList(dlCrystal, GL11.GL_COMPILE); OBJModelLibrary.bigCrystal.renderAll(true); GL11.glEndList(); } GL11.glCallList(dlCrystal); GL11.glPopMatrix(); }
From source file:hellfirepvp.astralsorcery.client.render.tile.TESRTranslucentBlock.java
License:Open Source License
public static void renderTranslucentBlocks() { TextureHelper.refreshTextureBindState(); TextureHelper.setActiveTextureToAtlasSprite(); GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS); GL11.glPushMatrix();//from ww w. j a v a 2 s . co m RenderingUtils.removeStandartTranslationFromTESRMatrix(Minecraft.getMinecraft().getRenderPartialTicks()); GlStateManager.color(1F, 1F, 1F, 1F); if (batchDList == -1) { batchBlocks(); hash = hashBlocks(); blocks.clear(); } else { int currentHash = hashBlocks(); if (hash != currentHash) { GLAllocation.deleteDisplayLists(batchDList); batchBlocks(); hash = currentHash; blocks.clear(); } } GL11.glEnable(GL11.GL_BLEND); Blending.ADDITIVEDARK.apply(); GL11.glCallList(batchDList); blocks.clear(); Blending.DEFAULT.apply(); GL11.glPopMatrix(); GL11.glPopAttrib(); }
From source file:illarion.graphics.lwjgl.render.TextureRenderDisplaylist.java
License:Open Source License
/** * Draw a texture using display lists at a specified location. * //from w w w .j a v a2 s .c o m * @param x the x coordinate of the texture * @param y the y coordinate of the texture * @param z the z coordinate (so the layer) of the texture * @param width the width of the area the texture shall be rendered on * @param height the height of the area the texture shall be rendered on * @param texture the texture that shall be drawn * @param color the color that is supposed to be used with that texture * @param mirror mirror the texture horizontal * @param rotation the value the texture is rotated by */ @Override public void drawTexture(final float x, final float y, final float z, final float width, final float height, final TextureLWJGL texture, final SpriteColor color, final boolean mirror, final float rotation) { DriverSettingsLWJGL.getInstance().enableTexture(texture.getTextureID()); color.setActiveColor(); GL11.glPushMatrix(); int xmod = 1; if (mirror) { xmod = -1; GL11.glTranslatef(x + width, y, z); } else { GL11.glTranslatef(x, y, z); } if (rotation != 0.f) { GL11.glRotatef(rotation, 0, 0, 1); } GL11.glScalef(width * xmod, height, 1.f); GL11.glTranslatef(0.5f, 0.5f, 0); GL11.glCallList(texture.getDisplayListID()); GL11.glPopMatrix(); }
From source file:io.flob.blackheart.Level.java
License:Open Source License
public void tick() throws Exception { if (display_list_dirty) { load_display_list();/*from w ww . ja v a2 s . c om*/ } ByteBuffer temp = ByteBuffer.allocateDirect(16); temp.order(ByteOrder.nativeOrder()); float fog_colour[] = new float[] { 0f, 0f, 0f, 0f }; GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_EXP); temp.asFloatBuffer().put(fog_colour).flip(); GL11.glFog(GL11.GL_FOG_COLOR, temp.asFloatBuffer()); GL11.glFogf(GL11.GL_FOG_DENSITY, 0.25f); GL11.glHint(GL11.GL_FOG_HINT, GL11.GL_DONT_CARE); GL11.glFogf(GL11.GL_FOG_START, 0); GL11.glFogf(GL11.GL_FOG_END, 200); _barry.tick(); try { Collections.sort(objects_dynamic, this.sort_objects); } catch (Exception ex) { Output.error(ex.getMessage()); } if (Debug.collision_boxs) { _game._core._display.flush_texture(); for (int count = 0; count < objects_static.size(); count++) { if (objects_static.get(count) instanceof ICollidable) { ICollidable objcet = (ICollidable) objects_static.get(count); objcet.collision_box().render(); } } for (int count = 0; count < objects_dynamic.size(); count++) { if (objects_dynamic.get(count) instanceof ICollidable) { ICollidable objcet = (ICollidable) objects_dynamic.get(count); objcet.collision_box().render(); } } _barry.collision_box().render(); _barry.ray_picker().collision_box().render(); } GL11.glPushMatrix(); _game._core._texture.game_atlas.bind(); if (_game.anaglyph()) { GL11.glTranslatef(1 * 0.03f, 0, 0); GL11.glColorMask(true, false, false, true); } GL11.glBegin(GL11.GL_QUADS); GL11.glCallList(display_list); for (int count = 0; count < objects_dynamic.size(); count++) { objects_dynamic.get(count).tick(); } GL11.glEnd(); if (_game.anaglyph()) { GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT); GL11.glColorMask(false, true, true, true); GL11.glTranslatef(-1 * 0.03f, 0, 0); GL11.glBegin(GL11.GL_QUADS); GL11.glCallList(display_list); for (int count = 0; count < objects_dynamic.size(); count++) { objects_dynamic.get(count)._render(); } GL11.glEnd(); GL11.glColorMask(true, true, true, true); } GL11.glPopMatrix(); for (int count = 0; count < objects_dynamic.size(); count++) { if (objects_dynamic.get(count).IRemove()) { objects_dynamic.remove(count); } } _hud.tick(); if (_barry.health() <= 0) { _game._core.state(_game._core._game_dead); } }
From source file:io.flob.blackheart.Level.java
License:Open Source License
public void _render() throws Exception { // assume the texture is already bound _barry._look_through();/* w w w.j ava 2 s .co m*/ GL11.glBegin(GL11.GL_QUADS); GL11.glCallList(display_list); for (int count = 0; count < objects_dynamic.size(); count++) { objects_dynamic.get(count)._render(); } GL11.glEnd(); }
From source file:io.root.gfx.glutils.GL.java
License:Apache License
public static void glCallList(int id) { GL11.glCallList(id); }