當前位置: 首頁>>代碼示例>>Java>>正文


Java GLAllocation類代碼示例

本文整理匯總了Java中net.minecraft.client.renderer.GLAllocation的典型用法代碼示例。如果您正苦於以下問題:Java GLAllocation類的具體用法?Java GLAllocation怎麽用?Java GLAllocation使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


GLAllocation類屬於net.minecraft.client.renderer包,在下文中一共展示了GLAllocation類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: makeMipmapBuffers

import net.minecraft.client.renderer.GLAllocation; //導入依賴的package包/類
public static IntBuffer[] makeMipmapBuffers(Dimension[] p_makeMipmapBuffers_0_, int[][] p_makeMipmapBuffers_1_)
{
    if (p_makeMipmapBuffers_0_ == null)
    {
        return null;
    }
    else
    {
        IntBuffer[] aintbuffer = new IntBuffer[p_makeMipmapBuffers_0_.length];

        for (int i = 0; i < p_makeMipmapBuffers_0_.length; ++i)
        {
            Dimension dimension = p_makeMipmapBuffers_0_[i];
            int j = dimension.width * dimension.height;
            IntBuffer intbuffer = GLAllocation.createDirectIntBuffer(j);
            int[] aint = p_makeMipmapBuffers_1_[i];
            intbuffer.clear();
            intbuffer.put(aint);
            intbuffer.clear();
            aintbuffer[i] = intbuffer;
        }

        return aintbuffer;
    }
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:26,代碼來源:Mipmaps.java

示例2: compileDisplayList

import net.minecraft.client.renderer.GLAllocation; //導入依賴的package包/類
/**
 * Compiles a GL display list for this model
 */
private void compileDisplayList(float scale)
{
    if (this.displayList == 0)
    {
        this.savedScale = scale;
        this.displayList = GLAllocation.generateDisplayLists(1);
    }

    GL11.glNewList(this.displayList, GL11.GL_COMPILE);
    WorldRenderer worldrenderer = Tessellator.getInstance().getWorldRenderer();

    for (int i = 0; i < this.cubeList.size(); ++i)
    {
        ((ModelBox)this.cubeList.get(i)).render(worldrenderer, scale);
    }

    for (int j = 0; j < this.spriteList.size(); ++j)
    {
        ModelSprite modelsprite = (ModelSprite)this.spriteList.get(j);
        modelsprite.render(Tessellator.getInstance(), scale);
    }

    GL11.glEndList();
    this.compiled = true;
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:29,代碼來源:ModelRenderer.java

示例3: compileDisplayList

import net.minecraft.client.renderer.GLAllocation; //導入依賴的package包/類
/**
 * Compiles a GL display list for this model
 */
private void compileDisplayList(float scale)
{
    this.displayList = GLAllocation.generateDisplayLists(1);
    GL11.glNewList(this.displayList, GL11.GL_COMPILE);
    WorldRenderer worldrenderer = Tessellator.getInstance().getWorldRenderer();

    for (int i = 0; i < this.cubeList.size(); ++i)
    {
        ((ModelBox)this.cubeList.get(i)).render(worldrenderer, scale);
    }

    for (int j = 0; j < this.spriteList.size(); ++j)
    {
        ModelSprite modelsprite = (ModelSprite)this.spriteList.get(j);
        modelsprite.render(Tessellator.getInstance(), scale);
    }

    GL11.glEndList();
    this.compiled = true;
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:24,代碼來源:ModelRenderer.java

示例4: compileDisplayList

import net.minecraft.client.renderer.GLAllocation; //導入依賴的package包/類
/**
 * Compiles a GL display list for this model
 */
private void compileDisplayList(float scale)
{
    if (this.displayList == 0)
    {
        this.savedScale = scale;
        this.displayList = GLAllocation.generateDisplayLists(1);
    }

    GlStateManager.glNewList(this.displayList, 4864);
    VertexBuffer vertexbuffer = Tessellator.getInstance().getBuffer();

    for (int i = 0; i < this.cubeList.size(); ++i)
    {
        ((ModelBox)this.cubeList.get(i)).render(vertexbuffer, scale);
    }

    for (int j = 0; j < this.spriteList.size(); ++j)
    {
        ModelSprite modelsprite = (ModelSprite)this.spriteList.get(j);
        modelsprite.render(Tessellator.getInstance(), scale);
    }

    GlStateManager.glEndList();
    this.compiled = true;
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:29,代碼來源:ModelRenderer.java

示例5: compileDisplayList

import net.minecraft.client.renderer.GLAllocation; //導入依賴的package包/類
/**
 * Compiles a GL display list for this model
 */
@SideOnly(Side.CLIENT)
private void compileDisplayList(float scale)
{
    this.displayList = GLAllocation.generateDisplayLists(1);
    GlStateManager.glNewList(this.displayList, 4864);
    VertexBuffer vertexbuffer = Tessellator.getInstance().getBuffer();

    for (int i = 0; i < this.cubeList.size(); ++i)
    {
        ((ModelBox)this.cubeList.get(i)).render(vertexbuffer, scale);
    }

    GlStateManager.glEndList();
    this.compiled = true;
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:19,代碼來源:ModelRenderer.java

示例6: render

import net.minecraft.client.renderer.GLAllocation; //導入依賴的package包/類
public void render(float partialTicks) {
	
	boolean ineff = false;
	
	if(ineff){
		updateSimpleRender(partialTicks);
		return;
	}
	
    if (needsUpdate) {
    	if (glRenderList >= 0) {
            GLAllocation.deleteDisplayLists(glRenderList);
            glRenderList = -1;
        }
		glRenderList = GLAllocation.generateDisplayLists(1);
        GL11.glNewList(glRenderList, GL11.GL_COMPILE);
        updateSimpleRender(partialTicks);
        GL11.glEndList();
        needsUpdate = false;
    }
    if(this.glRenderList >=0){
    	GlStateManager.callList(glRenderList);
    }
}
 
開發者ID:Alec-WAM,項目名稱:CrystalMod,代碼行數:25,代碼來源:ChunkRenderer.java

示例7: compileDisplayList

import net.minecraft.client.renderer.GLAllocation; //導入依賴的package包/類
/**
 * Compiles a GL display list for this model
 */
@SideOnly(Side.CLIENT)
protected void compileDisplayList(float scale)
{
    this.displayList = GLAllocation.generateDisplayLists(1);
    GlStateManager.glNewList(this.displayList, 4864);
    VertexBuffer vertexbuffer = Tessellator.getInstance().getBuffer();

    for (int i = 0; i < this.cubeList.size(); ++i)
    {
        ((ModelBox) this.cubeList.get(i)).render(vertexbuffer, scale);
    }

    GlStateManager.glEndList();
    this.compiled = true;
}
 
開發者ID:mchorse,項目名稱:metamorph,代碼行數:19,代碼來源:ModelCustomRenderer.java

示例8: compileDisplayList

import net.minecraft.client.renderer.GLAllocation; //導入依賴的package包/類
private void compileDisplayList (float worldScale) {
    if (this.useLegacyCompiler)
        this.compileLegacyDisplayList(worldScale);
    else {
        final Collection<TextureGroup> textures = this.textureGroup.values();
        final Iterator<TextureGroup> itr = textures.iterator();
        this.displayListArray = new int[this.textureGroup.size()];
        for (int i = 0; itr.hasNext(); i++) {
            this.displayListArray[i] = GLAllocation.generateDisplayLists(1);
            GL11.glNewList(this.displayListArray[i], 4864);
            final Tessellator tessellator = Tessellator.getInstance();
            final TextureGroup usedGroup = itr.next();
            for (int j = 0; j < usedGroup.poly.size(); j++)
                usedGroup.poly.get(j).draw(tessellator, worldScale);
            GL11.glEndList();
        }
    }
    this.compiled = true;
}
 
開發者ID:MinecraftModDevelopmentMods,項目名稱:MMDLib-old,代碼行數:20,代碼來源:ModelRendererTurbo.java

示例9: update

import net.minecraft.client.renderer.GLAllocation; //導入依賴的package包/類
public boolean update(BlockSlice slice) {
  if (!changed) {
    return false;
  }
  for (int pass = 0; pass < 2; pass++) {
    if (glDisplayList[pass] < 0) {
      glDisplayList[pass] = GLAllocation.generateDisplayLists(1);
    }
    GL11.glPushMatrix();
    GL11.glNewList(glDisplayList[pass], GL11.GL_COMPILE);
    if (slice.sculpture.needRenderPass(pass)) {
      build(slice, pass);
    }
    GL11.glEndList();
    GL11.glPopMatrix();
  }

  changed = false;
  return true;
}
 
開發者ID:twothe,項目名稱:DaVincing,代碼行數:21,代碼來源:SculptureRenderCompiler.java

示例10: makeMipmapBuffers

import net.minecraft.client.renderer.GLAllocation; //導入依賴的package包/類
public static IntBuffer[] makeMipmapBuffers(Dimension[] mipmapDimensions, int[][] mipmapDatas)
{
    if (mipmapDimensions == null)
    {
        return null;
    }
    else
    {
        IntBuffer[] mipmapBuffers = new IntBuffer[mipmapDimensions.length];

        for (int i = 0; i < mipmapDimensions.length; ++i)
        {
            Dimension dim = mipmapDimensions[i];
            int bufLen = dim.width * dim.height;
            IntBuffer buf = GLAllocation.createDirectIntBuffer(bufLen);
            int[] data = mipmapDatas[i];
            buf.clear();
            buf.put(data);
            buf.clear();
            mipmapBuffers[i] = buf;
        }

        return mipmapBuffers;
    }
}
 
開發者ID:MinecraftModdedClients,項目名稱:Resilience-Client-Source,代碼行數:26,代碼來源:Mipmaps.java

示例11: compileDisplayList

import net.minecraft.client.renderer.GLAllocation; //導入依賴的package包/類
private static void compileDisplayList()
{
    displayList = GLAllocation.generateDisplayLists(1);
    GlStateManager.glNewList(displayList, 4864);
    BufferBuilder vertexbuffer = Tessellator.getInstance().getBuffer();

    vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX_NORMAL);

    for(RawQuad q : quads)
    {
        for(int i = 0; i < 4; i++)
        {
            Vertex v = q.getVertex(i);
            Vec3d n = v.getNormal();
            vertexbuffer.pos(v.x, v.y, v.z).tex(v.u, v.v).normal((float)n.x, (float)n.y, (float)n.z).endVertex();
        }
    }

    Tessellator.getInstance().draw();

    GlStateManager.glEndList();



}
 
開發者ID:grondag,項目名稱:Hard-Science,代碼行數:26,代碼來源:RenderLavaBlob.java

示例12: update

import net.minecraft.client.renderer.GLAllocation; //導入依賴的package包/類
public boolean update(BlockSlice slice){
	if(glDisplayList != null && !changed)return false;
	
	if(glDisplayList == null)glDisplayList = new int[]{-1,-1};
	for(int pass = 0; pass < 2; pass++){
		if(glDisplayList[pass] < 0)glDisplayList[pass] = GLAllocation.generateDisplayLists(1);
		GL11.glPushMatrix();
		GL11.glNewList(glDisplayList[pass], GL11.GL_COMPILE);
		if(slice.sculpture.needRenderPass(pass))
			build(slice,pass);
		GL11.glEndList();
		GL11.glPopMatrix();
	}		
	
	changed = false;
	return true;
}
 
開發者ID:hypercross,項目名稱:minepainter,代碼行數:18,代碼來源:SculptureRenderCompiler.java

示例13: markRemoved

import net.minecraft.client.renderer.GLAllocation; //導入依賴的package包/類
public void markRemoved()
{
	isRemoved = true;
	
	try
	{
		if (glRenderList != 0)
		{
			ArchimedesShipMod.modLog.debug("Deleting mobile chunk display list " + glRenderList);
			GLAllocation.deleteDisplayLists(glRenderList);
			glRenderList = 0;
		}
	} catch (Exception e)
	{
		ArchimedesShipMod.modLog.error("Failed to destroy mobile chunk display list", e);
	}
}
 
開發者ID:Ckathode,項目名稱:archimedes-ships,代碼行數:18,代碼來源:MobileChunkRenderer.java

示例14: compileDisplayList

import net.minecraft.client.renderer.GLAllocation; //導入依賴的package包/類
/**
 * Compiles a GL display list for this model
 */
@SideOnly(Side.CLIENT)
private void compileDisplayList(float par1)
{
    this.displayList = GLAllocation.generateDisplayLists(1);
    GL11.glNewList(this.displayList, GL11.GL_COMPILE);
    Tessellator tessellator = Tessellator.instance;

    for (int i = 0; i < this.cubeList.size(); ++i)
    {
        ((ModelBox)this.cubeList.get(i)).render(tessellator, par1);
    }

    GL11.glEndList();
    this.compiled = true;
}
 
開發者ID:HATB0T,項目名稱:RuneCraftery,代碼行數:19,代碼來源:ModelRenderer.java

示例15: compileDisplayList

import net.minecraft.client.renderer.GLAllocation; //導入依賴的package包/類
/**
 * Compiles a GL display list for this model
 */
@SideOnly(Side.CLIENT)
private void compileDisplayList(float par1) {
	this.displayList = GLAllocation.generateDisplayLists(1);
	GL11.glNewList(this.displayList, GL11.GL_COMPILE);
	Tessellator var2 = Tessellator.instance;

	for (int var3 = 0; var3 < this.cubeList.size(); ++var3) {
		((ModelBox) this.cubeList.get(var3)).render(var2, par1);
	}

	for(int i = 0; i < this.objs.size(); i++){
		this.objs.get(i).render(par1);
	}

	GL11.glEndList();
	this.compiled = true;
}
 
開發者ID:uzzaco2002,項目名稱:secri,代碼行數:21,代碼來源:MaemeModelRenderer.java


注:本文中的net.minecraft.client.renderer.GLAllocation類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。