public SpatialSkyRender() { this.dspList = GLAllocation.generateDisplayLists( 1 ); }
@Override public void run() { GLAllocation.deleteDisplayLists( dspList ); }
public RenderCustomEndPortal(double y, double x1, double x2, double z1, double z2) { surfaceY = y; surfaceX1 = x1; surfaceX2 = x2; surfaceZ1 = z1; surfaceZ2 = z2; texBuffer = GLAllocation.createDirectFloatBuffer(16); }
GLAllocation.deleteDisplayLists(glListId); glListId = GLAllocation.generateDisplayLists(1); GlStateManager.glNewList(glListId, GL11.GL_COMPILE);
public ToolDireBuffer(int bufferSizeIn) { super(bufferSizeIn); this.byteBuffer = GLAllocation.createDirectByteBuffer(bufferSizeIn * 4); this.rawIntBuffer = this.byteBuffer.asIntBuffer(); this.rawShortBuffer = this.byteBuffer.asShortBuffer(); this.rawFloatBuffer = this.byteBuffer.asFloatBuffer(); }
private void growBuffer(int p_181670_1_) { if (MathHelper.roundUp(p_181670_1_, 4) / 4 > this.rawIntBuffer.remaining() || this.vertexCount * this.vertexFormat.getNextOffset() + p_181670_1_ > this.byteBuffer.capacity()) { int i = this.byteBuffer.capacity(); int j = i + MathHelper.roundUp(p_181670_1_, 2097152); LOGGER.debug("Needed to grow BufferBuilder buffer: Old size {} bytes, new size {} bytes.", Integer.valueOf(i), Integer.valueOf(j)); int k = this.rawIntBuffer.position(); ByteBuffer bytebuffer = GLAllocation.createDirectByteBuffer(j); this.byteBuffer.position(0); bytebuffer.put(this.byteBuffer); bytebuffer.rewind(); this.byteBuffer = bytebuffer; this.rawFloatBuffer = this.byteBuffer.asFloatBuffer().asReadOnlyBuffer(); this.rawIntBuffer = this.byteBuffer.asIntBuffer(); this.rawIntBuffer.position(k); this.rawShortBuffer = this.byteBuffer.asShortBuffer(); this.rawShortBuffer.position(k << 1); } }
public RenderLayer(Chunk chunk, int yMin, int yMax, PhysRenderChunk parent) { chunkToRender = chunk; this.yMin = yMin; this.yMax = yMax; this.parent = parent; markDirtyRenderLists(); glCallListCutout = GLAllocation.generateDisplayLists(4); glCallListCutoutMipped = glCallListCutout + 1; glCallListSolid = glCallListCutout + 2; glCallListTranslucent = glCallListCutout + 3; }
@Override public void destroy() { if ( displayList != 0 ) { GLAllocation.deleteDisplayLists( displayList ); displayList = 0; } }
private void compileDisplayList(float scale) { VertexBuffer vb = Tessellator.getInstance().getBuffer(); displayList = GLAllocation.generateDisplayLists(1); glNewList(displayList, GL_COMPILE); cubeList.forEach(cube -> cube.render(vb, scale)); glEndList(); compiled = true; }
@Override public void delete() { GLAllocation.deleteDisplayLists(this.id); } }
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); } 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(); }
private void clearRenderLists() { GLAllocation.deleteDisplayLists(glCallListCutout); GLAllocation.deleteDisplayLists(glCallListCutoutMipped); GLAllocation.deleteDisplayLists(glCallListSolid); GLAllocation.deleteDisplayLists(glCallListTranslucent); }
private void compileDisplayList(float scale) { this.displayList = GLAllocation.generateDisplayLists(1); GlStateManager.glNewList(this.displayList, 4864); VertexBuffer buffer = Tessellator.getInstance().getBuffer(); for (ModelBox box : this.cubeList) { box.render(buffer, scale); } GlStateManager.glEndList(); this.compiled = true; }
@Override public void deleteGlResources() { super.deleteGlResources(); GLAllocation.deleteDisplayLists(this.displayList); } }
private void compileDisplayList(float scale) { this.displayList = GLAllocation.generateDisplayLists(1); GlStateManager.glNewList(this.displayList, 4864); BufferBuilder buffer = Tessellator.getInstance().getBuffer(); for (ModelBox box : this.cubeList) { box.render(buffer, scale); } GlStateManager.glEndList(); this.compiled = true; } }
@SideOnly(Side.CLIENT) public void tick() { synchronized (lockCollection) { List<GLRenderList> newCollection = new ArrayList<>(collection); collection.stream().filter(ref -> !ref.check()).forEach(ref -> { GLAllocation.deleteDisplayLists(ref.getID()); newCollection.remove(ref); }); if (newCollection.size() != collection.size()) { collection = newCollection; } } } }
private Geometry buildDisplayList(BufferBuilder builder) { int id = GLAllocation.generateDisplayLists(1); builder.finishDrawing(); GlStateManager.glNewList(id, GL11.GL_COMPILE); new WorldVertexBufferUploader().draw(builder); GlStateManager.glEndList(); return new DisplayListGeometry(id); }
switch (layerToUpdate) { case CUTOUT: GLAllocation.deleteDisplayLists(glCallListCutout); GL11.glNewList(glCallListCutout, GL11.GL_COMPILE); break; case CUTOUT_MIPPED: GLAllocation.deleteDisplayLists(glCallListCutoutMipped); GL11.glNewList(glCallListCutoutMipped, GL11.GL_COMPILE); break; case SOLID: GLAllocation.deleteDisplayLists(glCallListSolid); GL11.glNewList(glCallListSolid, GL11.GL_COMPILE); break; case TRANSLUCENT: GLAllocation.deleteDisplayLists(glCallListTranslucent); GL11.glNewList(glCallListTranslucent, GL11.GL_COMPILE); break;
@Override @SideOnly(Side.CLIENT) public void renderDynamic(double x, double y, double z, float partialTicks, int destroyStage) { if (this.fluid == null) { return; } if (this.dspList == null) { this.dspList = GLAllocation.generateDisplayLists(1); } if (!isActive()) { return; } IAEFluidStack aeFluidStack = AEUtils.createFluidStack(this.fluid); aeFluidStack.setStackSize(this.amount); if (aeFluidStack != null) { GlStateManager.pushMatrix(); GlStateManager.translate(x + 0.5, y + 0.5, z + 0.5); GlStateManager.glNewList((Integer) this.dspList, GL11.GL_COMPILE_AND_EXECUTE); Tessellator tess = Tessellator.getInstance(); this.renderFluid(tess, aeFluidStack); GlStateManager.glEndList(); GlStateManager.popMatrix(); } }
displayList = GLAllocation.generateDisplayLists( 1 );