private void drawVboOrList(net.minecraft.client.renderer.vertex.VertexBuffer vbo, int displayList) { if (OpenGlHelper.useVbo()) { vbo.bindBuffer(); GlStateManager.glEnableClientState(GL11.GL_VERTEX_ARRAY); GlStateManager.glVertexPointer(3, GL11.GL_FLOAT, 12, 0); vbo.drawArrays(GL11.GL_QUADS); vbo.unbindBuffer(); GlStateManager.glDisableClientState(GL11.GL_VERTEX_ARRAY); } else { GlStateManager.callList(displayList); } }
public RenderOverlay(final World world, final RenderGlobal renderGlobal, final int index) { super(world, renderGlobal, index); this.vertexBuffer = OpenGlHelper.useVbo() ? new VertexBuffer(DefaultVertexFormats.POSITION_COLOR) : null; }
public CachedRenderer createRenderer(Tessellator tes) { if (OpenGlHelper.useVbo()) { return new VboRenderer(tes); } else { return new DisplayListRenderer(tes); } }
GlStateManager.color(f, f1, f2); if (OpenGlHelper.useVbo())
@Override public ListenableFuture<Object> uploadChunk(final BlockRenderLayer layer, final BufferBuilder buffer, final RenderChunk renderChunk, final CompiledChunk compiledChunk, final double distanceSq) { if (!Minecraft.getMinecraft().isCallingFromMinecraftThread() || OpenGlHelper.useVbo()) { return super.uploadChunk(layer, buffer, renderChunk, compiledChunk, distanceSq); } uploadDisplayList(buffer, ((RenderOverlayList) renderChunk).getDisplayList(layer, compiledChunk), renderChunk); buffer.setTranslation(0.0, 0.0, 0.0); return Futures.immediateFuture(null); } }
public RenderSchematic(final Minecraft minecraft) { super(minecraft); this.mc = minecraft; this.profiler = minecraft.mcProfiler; this.renderManager = minecraft.getRenderManager(); GlStateManager.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL11.GL_REPEAT); GlStateManager.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL11.GL_REPEAT); GlStateManager.bindTexture(0); this.vboEnabled = OpenGlHelper.useVbo(); if (this.vboEnabled) { initVbo(); } else { initList(); } }
@Override public void setupTerrain(final Entity viewEntity, final double partialTicks, final ICamera camera, final int frameCount, final boolean playerSpectator) { if (ConfigurationHandler.renderDistance != this.renderDistanceChunks || this.vboEnabled != OpenGlHelper.useVbo()) { loadRenderers();
@Override public void loadRenderers() { if (this.world != null) { if (this.renderDispatcher == null) { this.renderDispatcher = new ChunkRenderDispatcher(5); } if (this.renderDispatcherOverlay == null) { this.renderDispatcherOverlay = new OverlayRenderDispatcher(5); } this.displayListEntitiesDirty = true; this.renderDistanceChunks = ConfigurationHandler.renderDistance; final boolean vbo = this.vboEnabled; this.vboEnabled = OpenGlHelper.useVbo(); if (vbo && !this.vboEnabled) { initList(); } else if (!vbo && this.vboEnabled) { initVbo(); } if (this.viewFrustum != null) { this.viewFrustum.deleteGlResources(); } stopChunkUpdates(); this.viewFrustum = new ViewFrustumOverlay(this.world, this.renderDistanceChunks, this, this.renderChunkFactory); final double posX = PLAYER_POSITION_OFFSET.x; final double posZ = PLAYER_POSITION_OFFSET.z; this.viewFrustum.updateChunkPositions(posX, posZ); } }