Use DisplayInteger to abstract away some GL11 calls
This commit is contained in:
parent
260b9ed62f
commit
c642792cb6
1 changed files with 19 additions and 0 deletions
|
@ -7,6 +7,7 @@ import mekanism.common.ISpecialBounds;
|
||||||
import mekanism.common.MekanismUtils;
|
import mekanism.common.MekanismUtils;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.renderer.GLAllocation;
|
||||||
import net.minecraft.client.renderer.OpenGlHelper;
|
import net.minecraft.client.renderer.OpenGlHelper;
|
||||||
import net.minecraft.client.renderer.RenderBlocks;
|
import net.minecraft.client.renderer.RenderBlocks;
|
||||||
import net.minecraft.client.renderer.RenderHelper;
|
import net.minecraft.client.renderer.RenderHelper;
|
||||||
|
@ -265,6 +266,24 @@ public class MekanismRenderer
|
||||||
{
|
{
|
||||||
return obj instanceof DisplayInteger && ((DisplayInteger)obj).display == display;
|
return obj instanceof DisplayInteger && ((DisplayInteger)obj).display == display;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static DisplayInteger createAndStart()
|
||||||
|
{
|
||||||
|
DisplayInteger newInteger = new DisplayInteger();
|
||||||
|
newInteger.display = GLAllocation.generateDisplayLists(1);
|
||||||
|
GL11.glNewList(newInteger.display, GL11.GL_COMPILE);
|
||||||
|
return newInteger;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void endList()
|
||||||
|
{
|
||||||
|
GL11.glEndList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void render()
|
||||||
|
{
|
||||||
|
GL11.glCallList(display);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TextureMap getTextureMap(int type)
|
public static TextureMap getTextureMap(int type)
|
||||||
|
|
Loading…
Reference in a new issue