net.minecraft.client.renderer.GLAllocation Java Examples

The following examples show how to use net.minecraft.client.renderer.GLAllocation. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MobileChunkRenderer.java    From archimedes-ships with MIT License 6 votes vote down vote up
public void markRemoved()
{
	isRemoved = true;
	
	try
	{
		if (glRenderList != 0)
		{
			ArchimedesShipMod.modLog.debug("Deleting mobile chunk display list " + glRenderList);
			GLAllocation.deleteDisplayLists(glRenderList);
			glRenderList = 0;
		}
	} catch (Exception e)
	{
		ArchimedesShipMod.modLog.error("Failed to destroy mobile chunk display list", e);
	}
}
 
Example #2
Source File: TcModelRenderer.java    From TofuCraftReload with MIT License 5 votes vote down vote up
@SideOnly(Side.CLIENT)
private void compileDisplayPane() {
    this.displayList = GLAllocation.generateDisplayLists(1);
    GlStateManager.glNewList(this.displayList, 4864);
    BufferBuilder vertexbuffer = Tessellator.getInstance().getBuffer();
    
    for (int i = 0; i < this.paneList.size(); ++i)
    {
    	ModelPane pane = (ModelPane)this.paneList.get(i);
        pane.render(vertexbuffer, 0.0625F);
    }
    
    GlStateManager.glEndList();
    this.compiled = true;
}
 
Example #3
Source File: RenderChunkSchematicList.java    From litematica with GNU Lesser General Public License v3.0 5 votes vote down vote up
public RenderChunkSchematicList(World worldIn, RenderGlobal renderGlobalIn, int index)
{
    super(worldIn, renderGlobalIn, index);

    this.baseDisplayList = GLAllocation.generateDisplayLists(LIST_SIZE);
    this.baseOverlay = this.baseDisplayList + BLOCK_LAYERS;
}
 
Example #4
Source File: EntityRocket.java    From AdvancedRocketry with MIT License 5 votes vote down vote up
@Override
public void setDead() {
	super.setDead();

	if(storage != null && storage.world.displayListIndex != -1)
		GLAllocation.deleteDisplayLists(storage.world.displayListIndex);

	//unlink any connected tiles
	Iterator<IInfrastructure> connectedTiles = connectedInfrastructure.iterator();
	while(connectedTiles.hasNext()) {
		connectedTiles.next().unlinkRocket();
		connectedTiles.remove();
	}

}
 
Example #5
Source File: RenderCustomEndPortal.java    From EnderStorage with MIT License 5 votes vote down vote up
public RenderCustomEndPortal(double y, double x1, double x2, double z1, double z2)
{
    surfaceY = y;
    surfaceX1 = x1;
    surfaceX2 = x2;
    surfaceZ1 = z1;
    surfaceZ2 = z2;
    field_40448_a = GLAllocation.createDirectFloatBuffer(16);
}
 
Example #6
Source File: RenderChunkSchematicList.java    From litematica with GNU Lesser General Public License v3.0 4 votes vote down vote up
public void deleteGlResources()
{
    super.deleteGlResources();

    GLAllocation.deleteDisplayLists(this.baseDisplayList, LIST_SIZE);
}
 
Example #7
Source File: RotorSpecialRenderer.java    From BigReactors with MIT License 4 votes vote down vote up
int generateRotor(RotorInfo rotorInfo) {
	int list = GLAllocation.generateDisplayLists(1);
	GL11.glNewList(list,  GL11.GL_COMPILE);

	ForgeDirection rotorDir = rotorInfo.rotorDirection;
	int rotorLen = rotorInfo.rotorLength;
	CoordTriplet currentRotorCoord = new CoordTriplet(0,0,0);

	Tessellator tessellator = Tessellator.instance;
	if(rotorDir.offsetX != 0) {
		tessellator.setTranslation(0, -0.5, -0.5);
	}
	else if(rotorDir.offsetY != 0) {
		tessellator.setTranslation(-0.5, 0, -0.5);
	}
	else {
		tessellator.setTranslation(-0.5, -0.5, 0);
	}

	tessellator.startDrawingQuads();
	tessellator.setBrightness(256);
	tessellator.setColorOpaque(255, 255, 255);
	
	CoordTriplet bladeCoord = new CoordTriplet(0,0,0);
	int rotorIdx = 0;
	boolean[] hasBlades = new boolean[4];
	ForgeDirection[] bladeDirs = StaticUtils.neighborsBySide[rotorInfo.rotorDirection.ordinal()];

	while(rotorIdx < rotorInfo.rotorLength) {
		
		for(int i = 0; i < hasBlades.length; i++) {
			hasBlades[i] = rotorInfo.bladeLengths[rotorIdx][i] > 0;
		}

		RotorSimpleRenderer.renderRotorShaft(BigReactors.blockTurbineRotorPart, renderBlocks, BlockTurbineRotorPart.METADATA_SHAFT, rotorDir, hasBlades, currentRotorCoord.x, currentRotorCoord.y, currentRotorCoord.z, false);
		for(int bladeIdx = 0; bladeIdx < bladeDirs.length; bladeIdx++) {
			bladeCoord.copy(currentRotorCoord);
			int bladeLen = 0;
			bladeCoord.translate(bladeDirs[bladeIdx]);
			while(bladeLen < rotorInfo.bladeLengths[rotorIdx][bladeIdx]) {
				RotorSimpleRenderer.renderBlade(renderBlocks, bladeCoord.x, bladeCoord.y, bladeCoord.z, BigReactors.blockTurbineRotorPart, BlockTurbineRotorPart.METADATA_BLADE, rotorInfo.rotorDirection);
				bladeLen++;
				bladeCoord.translate(bladeDirs[bladeIdx]);
			}
		}
		rotorIdx++;
		currentRotorCoord.translate(rotorDir);
	}
	tessellator.setTranslation(0, 0, 0);
	tessellator.draw();
	
	GL11.glEndList();
	return list;
}