ForgePatch/src/main/java/net/minecraftforge/client/MinecraftForgeClient.java

60 lines
1.3 KiB
Java
Raw Normal View History

2011-07-15 23:13:09 +00:00
/**
* This software is provided under the terms of the Minecraft Forge Public
2011-07-15 23:13:09 +00:00
* License v1.0.
*/
package net.minecraftforge.client;
import java.util.BitSet;
import net.minecraft.util.EnumWorldBlockLayer;
public class MinecraftForgeClient
{
public static int getRenderPass()
{
return ForgeHooksClient.renderPass;
}
public static EnumWorldBlockLayer getRenderLayer()
{
return ForgeHooksClient.renderLayer.get();
}
private static BitSet stencilBits = new BitSet(8);
static
{
stencilBits.set(0,8);
}
/**
* Reserve a stencil bit for use in rendering
*
* Note: you must check the Framebuffer you are working with to
* determine if stencil bits are enabled on it before use.
*
* @return A bit or -1 if no further stencil bits are available
*/
public static int reserveStencilBit()
{
int bit = stencilBits.nextSetBit(0);
if (bit >= 0)
{
stencilBits.clear(bit);
}
return bit;
}
/**
* Release the stencil bit for other use
*
* @param bit The bit from {@link #reserveStencilBit()}
*/
public static void releaseStencilBit(int bit)
{
if (bit >= 0 && bit < stencilBits.length())
{
stencilBits.set(bit);
}
}
}