本文整理汇总了Java中net.minecraft.client.renderer.OpenGlHelper.useVbo方法的典型用法代码示例。如果您正苦于以下问题:Java OpenGlHelper.useVbo方法的具体用法?Java OpenGlHelper.useVbo怎么用?Java OpenGlHelper.useVbo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.client.renderer.OpenGlHelper
的用法示例。
在下文中一共展示了OpenGlHelper.useVbo方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: RenderChunk
import net.minecraft.client.renderer.OpenGlHelper; //导入方法依赖的package包/类
public RenderChunk(World worldIn, RenderGlobal renderGlobalIn, BlockPos blockPosIn, int indexIn)
{
this.world = worldIn;
this.renderGlobal = renderGlobalIn;
this.index = indexIn;
if (!blockPosIn.equals(this.getPosition()))
{
this.setPosition(blockPosIn);
}
if (OpenGlHelper.useVbo())
{
for (int i = 0; i < EnumWorldBlockLayer.values().length; ++i)
{
this.vertexBuffers[i] = new VertexBuffer(DefaultVertexFormats.BLOCK);
}
}
}
示例2: RenderChunk
import net.minecraft.client.renderer.OpenGlHelper; //导入方法依赖的package包/类
public RenderChunk(World p_i47120_1_, RenderGlobal p_i47120_2_, int p_i47120_3_)
{
for (int i = 0; i < this.mapEnumFacing.length; ++i)
{
this.mapEnumFacing[i] = new BlockPos.MutableBlockPos();
}
this.world = p_i47120_1_;
this.renderGlobal = p_i47120_2_;
this.index = p_i47120_3_;
if (OpenGlHelper.useVbo())
{
for (int j = 0; j < BlockRenderLayer.values().length; ++j)
{
this.vertexBuffers[j] = new VertexBuffer(DefaultVertexFormats.BLOCK);
}
}
}
示例3: uploadChunk
import net.minecraft.client.renderer.OpenGlHelper; //导入方法依赖的package包/类
public ListenableFuture<Object> uploadChunk(final EnumWorldBlockLayer player, final WorldRenderer p_178503_2_, final RenderChunk chunkRenderer, final CompiledChunk compiledChunkIn)
{
if (Minecraft.getMinecraft().isCallingFromMinecraftThread())
{
if (OpenGlHelper.useVbo())
{
this.uploadVertexBuffer(p_178503_2_, chunkRenderer.getVertexBufferByLayer(player.ordinal()));
}
else
{
this.uploadDisplayList(p_178503_2_, ((ListedRenderChunk)chunkRenderer).getDisplayList(player, compiledChunkIn), chunkRenderer);
}
p_178503_2_.setTranslation(0.0D, 0.0D, 0.0D);
return Futures.<Object>immediateFuture((Object)null);
}
else
{
ListenableFutureTask<Object> listenablefuturetask = ListenableFutureTask.<Object>create(new Runnable()
{
public void run()
{
ChunkRenderDispatcher.this.uploadChunk(player, p_178503_2_, chunkRenderer, compiledChunkIn);
}
}, (Object)null);
synchronized (this.queueChunkUploads)
{
this.queueChunkUploads.add(listenablefuturetask);
return listenablefuturetask;
}
}
}
示例4: preRenderChunkLayer
import net.minecraft.client.renderer.OpenGlHelper; //导入方法依赖的package包/类
public static void preRenderChunkLayer()
{
if (OpenGlHelper.useVbo())
{
GL11.glEnableClientState(GL11.GL_NORMAL_ARRAY);
GL20.glEnableVertexAttribArray(Shaders.midTexCoordAttrib);
GL20.glEnableVertexAttribArray(Shaders.tangentAttrib);
GL20.glEnableVertexAttribArray(Shaders.entityAttrib);
}
}
示例5: postRenderChunkLayer
import net.minecraft.client.renderer.OpenGlHelper; //导入方法依赖的package包/类
public static void postRenderChunkLayer()
{
if (OpenGlHelper.useVbo())
{
GL11.glDisableClientState(GL11.GL_NORMAL_ARRAY);
GL20.glDisableVertexAttribArray(Shaders.midTexCoordAttrib);
GL20.glDisableVertexAttribArray(Shaders.tangentAttrib);
GL20.glDisableVertexAttribArray(Shaders.entityAttrib);
}
}
示例6: preRenderChunkLayer
import net.minecraft.client.renderer.OpenGlHelper; //导入方法依赖的package包/类
public static void preRenderChunkLayer(BlockRenderLayer blockLayerIn)
{
if (Shaders.isRenderBackFace(blockLayerIn))
{
GlStateManager.disableCull();
}
if (OpenGlHelper.useVbo())
{
GL11.glEnableClientState(GL11.GL_NORMAL_ARRAY);
GL20.glEnableVertexAttribArray(Shaders.midTexCoordAttrib);
GL20.glEnableVertexAttribArray(Shaders.tangentAttrib);
GL20.glEnableVertexAttribArray(Shaders.entityAttrib);
}
}
示例7: postRenderChunkLayer
import net.minecraft.client.renderer.OpenGlHelper; //导入方法依赖的package包/类
public static void postRenderChunkLayer(BlockRenderLayer blockLayerIn)
{
if (OpenGlHelper.useVbo())
{
GL11.glDisableClientState(GL11.GL_NORMAL_ARRAY);
GL20.glDisableVertexAttribArray(Shaders.midTexCoordAttrib);
GL20.glDisableVertexAttribArray(Shaders.tangentAttrib);
GL20.glDisableVertexAttribArray(Shaders.entityAttrib);
}
if (Shaders.isRenderBackFace(blockLayerIn))
{
GlStateManager.enableCull();
}
}
示例8: uploadChunk
import net.minecraft.client.renderer.OpenGlHelper; //导入方法依赖的package包/类
public ListenableFuture<Object> uploadChunk(final BlockRenderLayer p_188245_1_, final VertexBuffer p_188245_2_, final RenderChunk p_188245_3_, final CompiledChunk p_188245_4_, final double p_188245_5_)
{
if (Minecraft.getMinecraft().isCallingFromMinecraftThread())
{
if (OpenGlHelper.useVbo())
{
this.uploadVertexBuffer(p_188245_2_, p_188245_3_.getVertexBufferByLayer(p_188245_1_.ordinal()));
}
else
{
this.uploadDisplayList(p_188245_2_, ((ListedRenderChunk)p_188245_3_).getDisplayList(p_188245_1_, p_188245_4_), p_188245_3_);
}
p_188245_2_.setTranslation(0.0D, 0.0D, 0.0D);
return Futures.<Object>immediateFuture((Object)null);
}
else
{
ListenableFutureTask<Object> listenablefuturetask = ListenableFutureTask.<Object>create(new Runnable()
{
public void run()
{
ChunkRenderDispatcher.this.uploadChunk(p_188245_1_, p_188245_2_, p_188245_3_, p_188245_4_, p_188245_5_);
}
}, (Object)null);
synchronized (this.queueChunkUploads)
{
this.queueChunkUploads.add(new ChunkRenderDispatcher.PendingUpload(listenablefuturetask, p_188245_5_));
return listenablefuturetask;
}
}
}