SkyRenderer.java 文件源码

java
阅读 18 收藏 0 点赞 0 评论 0

项目:justenoughdimensions 作者:
private void generateStars()
{
    Tessellator tessellator = Tessellator.getInstance();
    BufferBuilder bufferBuilder = tessellator.getBuffer();

    if (this.starVBO != null)
    {
        this.starVBO.deleteGlBuffers();
    }

    if (this.starGLCallList >= 0)
    {
        GLAllocation.deleteDisplayLists(this.starGLCallList);
        this.starGLCallList = -1;
    }

    if (this.vboEnabled)
    {
        this.starVBO = new net.minecraft.client.renderer.vertex.VertexBuffer(this.vertexBufferFormat);
        this.renderStars(bufferBuilder);
        bufferBuilder.finishDrawing();
        bufferBuilder.reset();
        this.starVBO.bufferData(bufferBuilder.getByteBuffer());
    }
    else
    {
        this.starGLCallList = GLAllocation.generateDisplayLists(1);
        GlStateManager.pushMatrix();
        GlStateManager.glNewList(this.starGLCallList, 4864);
        this.renderStars(bufferBuilder);
        tessellator.draw();
        GlStateManager.glEndList();
        GlStateManager.popMatrix();
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号