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


Java DefaultVertexFormats類代碼示例

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


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

示例1: drawSprite

import net.minecraft.client.renderer.vertex.DefaultVertexFormats; //導入依賴的package包/類
/**
 * Draws a sprite from assets/textures/gui/container/stats_icons.png
 */
private void drawSprite(int p_146527_1_, int p_146527_2_, int p_146527_3_, int p_146527_4_)
{
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    this.mc.getTextureManager().bindTexture(statIcons);
    float f = 0.0078125F;
    float f1 = 0.0078125F;
    int i = 18;
    int j = 18;
    Tessellator tessellator = Tessellator.getInstance();
    WorldRenderer worldrenderer = tessellator.getWorldRenderer();
    worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
    worldrenderer.pos((double)(p_146527_1_ + 0), (double)(p_146527_2_ + 18), (double)this.zLevel).tex((double)((float)(p_146527_3_ + 0) * 0.0078125F), (double)((float)(p_146527_4_ + 18) * 0.0078125F)).endVertex();
    worldrenderer.pos((double)(p_146527_1_ + 18), (double)(p_146527_2_ + 18), (double)this.zLevel).tex((double)((float)(p_146527_3_ + 18) * 0.0078125F), (double)((float)(p_146527_4_ + 18) * 0.0078125F)).endVertex();
    worldrenderer.pos((double)(p_146527_1_ + 18), (double)(p_146527_2_ + 0), (double)this.zLevel).tex((double)((float)(p_146527_3_ + 18) * 0.0078125F), (double)((float)(p_146527_4_ + 0) * 0.0078125F)).endVertex();
    worldrenderer.pos((double)(p_146527_1_ + 0), (double)(p_146527_2_ + 0), (double)this.zLevel).tex((double)((float)(p_146527_3_ + 0) * 0.0078125F), (double)((float)(p_146527_4_ + 0) * 0.0078125F)).endVertex();
    tessellator.draw();
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:21,代碼來源:GuiStats.java

示例2: renderPathLine

import net.minecraft.client.renderer.vertex.DefaultVertexFormats; //導入依賴的package包/類
public void renderPathLine(float p_190067_1_, Path p_190067_2_)
{
    Tessellator tessellator = Tessellator.getInstance();
    VertexBuffer vertexbuffer = tessellator.getBuffer();
    vertexbuffer.begin(3, DefaultVertexFormats.POSITION_COLOR);

    for (int i = 0; i < p_190067_2_.getCurrentPathLength(); ++i)
    {
        PathPoint pathpoint = p_190067_2_.getPathPointFromIndex(i);

        if (this.addDistanceToPlayer(pathpoint) <= 40.0F)
        {
            float f = (float)i / (float)p_190067_2_.getCurrentPathLength() * 0.33F;
            int j = i == 0 ? 0 : MathHelper.hsvToRGB(f, 0.9F, 0.9F);
            int k = j >> 16 & 255;
            int l = j >> 8 & 255;
            int i1 = j & 255;
            vertexbuffer.pos((double)pathpoint.xCoord - this.xo + 0.5D, (double)pathpoint.yCoord - this.yo + 0.5D, (double)pathpoint.zCoord - this.zo + 0.5D).color(k, l, i1, 255).endVertex();
        }
    }

    tessellator.draw();
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:24,代碼來源:DebugRendererPathfinding.java

示例3: blitSlotIcon

import net.minecraft.client.renderer.vertex.DefaultVertexFormats; //導入依賴的package包/類
private void blitSlotIcon(int p_148171_1_, int p_148171_2_, int p_148171_3_, int p_148171_4_)
{
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    this.mc.getTextureManager().bindTexture(Gui.STAT_ICONS);
    float f = 0.0078125F;
    float f1 = 0.0078125F;
    int i = 18;
    int j = 18;
    Tessellator tessellator = Tessellator.getInstance();
    VertexBuffer vertexbuffer = tessellator.getBuffer();
    vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX);
    vertexbuffer.pos((double)(p_148171_1_ + 0), (double)(p_148171_2_ + 18), (double)GuiFlatPresets.this.zLevel).tex((double)((float)(p_148171_3_ + 0) * 0.0078125F), (double)((float)(p_148171_4_ + 18) * 0.0078125F)).endVertex();
    vertexbuffer.pos((double)(p_148171_1_ + 18), (double)(p_148171_2_ + 18), (double)GuiFlatPresets.this.zLevel).tex((double)((float)(p_148171_3_ + 18) * 0.0078125F), (double)((float)(p_148171_4_ + 18) * 0.0078125F)).endVertex();
    vertexbuffer.pos((double)(p_148171_1_ + 18), (double)(p_148171_2_ + 0), (double)GuiFlatPresets.this.zLevel).tex((double)((float)(p_148171_3_ + 18) * 0.0078125F), (double)((float)(p_148171_4_ + 0) * 0.0078125F)).endVertex();
    vertexbuffer.pos((double)(p_148171_1_ + 0), (double)(p_148171_2_ + 0), (double)GuiFlatPresets.this.zLevel).tex((double)((float)(p_148171_3_ + 0) * 0.0078125F), (double)((float)(p_148171_4_ + 0) * 0.0078125F)).endVertex();
    tessellator.draw();
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:18,代碼來源:GuiFlatPresets.java

示例4: render

import net.minecraft.client.renderer.vertex.DefaultVertexFormats; //導入依賴的package包/類
@Override
public void render() {
    FMLClientHandler.instance().getClient().getTextureManager().bindTexture(getTexture());
    int width = getWidth() + (getParameters() != null && getParameters().length > 0 ? 10 : 0);
    int height = getHeight() + (hasStepOutput() ? 10 : 0);
    Pair<Double, Double> maxUV = getMaxUV();
    double u = maxUV.getLeft();
    double v = maxUV.getRight();
    BufferBuilder wr = Tessellator.getInstance().getBuffer();
    wr.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX);
    wr.pos(0, 0, 0).tex(0, 0).endVertex();
    wr.pos(0, height, 0).tex(0, v).endVertex();
    wr.pos(width, height, 0).tex(u, v).endVertex();
    wr.pos(width, 0, 0).tex(u, 0).endVertex();
    Tessellator.getInstance().draw();
}
 
開發者ID:TeamPneumatic,項目名稱:pnc-repressurized,代碼行數:17,代碼來源:ProgWidget.java

示例5: func_148224_c

import net.minecraft.client.renderer.vertex.DefaultVertexFormats; //導入依賴的package包/類
private void func_148224_c(int p_148224_1_, int p_148224_2_, int p_148224_3_, int p_148224_4_)
{
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    this.mc.getTextureManager().bindTexture(Gui.statIcons);
    float f = 0.0078125F;
    float f1 = 0.0078125F;
    int i = 18;
    int j = 18;
    Tessellator tessellator = Tessellator.getInstance();
    WorldRenderer worldrenderer = tessellator.getWorldRenderer();
    worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
    worldrenderer.pos((double)(p_148224_1_ + 0), (double)(p_148224_2_ + 18), (double)GuiCreateFlatWorld.this.zLevel).tex((double)((float)(p_148224_3_ + 0) * 0.0078125F), (double)((float)(p_148224_4_ + 18) * 0.0078125F)).endVertex();
    worldrenderer.pos((double)(p_148224_1_ + 18), (double)(p_148224_2_ + 18), (double)GuiCreateFlatWorld.this.zLevel).tex((double)((float)(p_148224_3_ + 18) * 0.0078125F), (double)((float)(p_148224_4_ + 18) * 0.0078125F)).endVertex();
    worldrenderer.pos((double)(p_148224_1_ + 18), (double)(p_148224_2_ + 0), (double)GuiCreateFlatWorld.this.zLevel).tex((double)((float)(p_148224_3_ + 18) * 0.0078125F), (double)((float)(p_148224_4_ + 0) * 0.0078125F)).endVertex();
    worldrenderer.pos((double)(p_148224_1_ + 0), (double)(p_148224_2_ + 0), (double)GuiCreateFlatWorld.this.zLevel).tex((double)((float)(p_148224_3_ + 0) * 0.0078125F), (double)((float)(p_148224_4_ + 0) * 0.0078125F)).endVertex();
    tessellator.draw();
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:18,代碼來源:GuiCreateFlatWorld.java

示例6: drawBackground

import net.minecraft.client.renderer.vertex.DefaultVertexFormats; //導入依賴的package包/類
/**
 * Draws the background (i is always 0 as of 1.2.2)
 */
public void drawBackground(int tint)
{
    GlStateManager.disableLighting();
    GlStateManager.disableFog();
    Tessellator tessellator = Tessellator.getInstance();
    WorldRenderer worldrenderer = tessellator.getWorldRenderer();
    this.mc.getTextureManager().bindTexture(optionsBackground);
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    float f = 32.0F;
    worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
    worldrenderer.pos(0.0D, (double)this.height, 0.0D).tex(0.0D, (double)((float)this.height / 32.0F + (float)tint)).color(64, 64, 64, 255).endVertex();
    worldrenderer.pos((double)this.width, (double)this.height, 0.0D).tex((double)((float)this.width / 32.0F), (double)((float)this.height / 32.0F + (float)tint)).color(64, 64, 64, 255).endVertex();
    worldrenderer.pos((double)this.width, 0.0D, 0.0D).tex((double)((float)this.width / 32.0F), (double)tint).color(64, 64, 64, 255).endVertex();
    worldrenderer.pos(0.0D, 0.0D, 0.0D).tex(0.0D, (double)tint).color(64, 64, 64, 255).endVertex();
    tessellator.draw();
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:20,代碼來源:GuiScreen.java

示例7: drawTexturedModalRectZ

import net.minecraft.client.renderer.vertex.DefaultVertexFormats; //導入依賴的package包/類
public void drawTexturedModalRectZ(final float i, final float y, final int k, final int i1, final int j1, final int k1, final float zLevel) {
		float f = 0.015625F;
		float f1 = 0.03125F;
		Tessellator tesselator = Tessellator.getInstance();
		VertexBuffer vertexbuffer = tesselator.getBuffer();
		vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX);
/*
		tesselator.getWorldRenderer().addVertexWithUV(i + 0, y + k1, zLevel, (k + 0) * f, (i1 + k1) * f1);
		tesselator.getWorldRenderer().addVertexWithUV(i + j1, y + k1, zLevel, (k + j1) * f, (i1 + k1) * f1);
		tesselator.getWorldRenderer().addVertexWithUV(i + j1, y + 0, zLevel, (k + j1) * f, (i1 + 0) * f1);
		tesselator.getWorldRenderer().addVertexWithUV(i + 0, y + 0, zLevel, (k + 0) * f, (i1 + 0) * f1);
		*/
		
		vertexbuffer.pos(i + 0, y + k1, zLevel);
		vertexbuffer.pos(i + j1, y + k1, zLevel);
		vertexbuffer.pos(i + j1, y + 0, zLevel);
		vertexbuffer.pos(i + 0, y + 0, zLevel);

		tesselator.draw();
    }
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:21,代碼來源:SlotAlt.java

示例8: drawSprite

import net.minecraft.client.renderer.vertex.DefaultVertexFormats; //導入依賴的package包/類
/**
 * Draws a sprite from assets/textures/gui/container/stats_icons.png
 */
private void drawSprite(int p_146527_1_, int p_146527_2_, int p_146527_3_, int p_146527_4_)
{
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    this.mc.getTextureManager().bindTexture(STAT_ICONS);
    float f = 0.0078125F;
    float f1 = 0.0078125F;
    int i = 18;
    int j = 18;
    Tessellator tessellator = Tessellator.getInstance();
    VertexBuffer vertexbuffer = tessellator.getBuffer();
    vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX);
    vertexbuffer.pos((double)(p_146527_1_ + 0), (double)(p_146527_2_ + 18), (double)this.zLevel).tex((double)((float)(p_146527_3_ + 0) * 0.0078125F), (double)((float)(p_146527_4_ + 18) * 0.0078125F)).endVertex();
    vertexbuffer.pos((double)(p_146527_1_ + 18), (double)(p_146527_2_ + 18), (double)this.zLevel).tex((double)((float)(p_146527_3_ + 18) * 0.0078125F), (double)((float)(p_146527_4_ + 18) * 0.0078125F)).endVertex();
    vertexbuffer.pos((double)(p_146527_1_ + 18), (double)(p_146527_2_ + 0), (double)this.zLevel).tex((double)((float)(p_146527_3_ + 18) * 0.0078125F), (double)((float)(p_146527_4_ + 0) * 0.0078125F)).endVertex();
    vertexbuffer.pos((double)(p_146527_1_ + 0), (double)(p_146527_2_ + 0), (double)this.zLevel).tex((double)((float)(p_146527_3_ + 0) * 0.0078125F), (double)((float)(p_146527_4_ + 0) * 0.0078125F)).endVertex();
    tessellator.draw();
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:21,代碼來源:GuiStats.java

示例9: RenderChunk

import net.minecraft.client.renderer.vertex.DefaultVertexFormats; //導入依賴的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);
        }
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:20,代碼來源:RenderChunk.java

示例10: drawLine

import net.minecraft.client.renderer.vertex.DefaultVertexFormats; //導入依賴的package包/類
public static void drawLine(double x, double y, double x2, double y2, float red, float green, float blue, float lineWidth, float fadeSpeed) {
    int count = FMLClientHandler.instance().getClient().player.ticksExisted;
    float alpha = fadeSpeed + MathHelper.sin((float) (count + x)) * 0.3F + 0.3F;
    
    Tessellator tess = Tessellator.getInstance();
    VertexBuffer buff = tess.getBuffer();
    
    GL11.glPushMatrix();
    GL11.glLineWidth(lineWidth);
    GL11.glDisable(3553);
    GL11.glBlendFunc(770, 771);
    buff.begin(3, DefaultVertexFormats.POSITION_COLOR);
    buff.pos(x, y, 0).color(red, green, blue, alpha).endVertex();
    buff.pos(x2, y2, 0).color(red, green, blue, alpha).endVertex();
    tess.draw();
    
    GL11.glBlendFunc(770, 771);
    GL11.glDisable(32826);
    GL11.glDisable(3042);
    GL11.glEnable(3553);
    GL11.glPopMatrix();
}
 
開發者ID:jaredlll08,項目名稱:Machines-and-Stuff,代碼行數:23,代碼來源:RenderUtils.java

示例11: func_148171_c

import net.minecraft.client.renderer.vertex.DefaultVertexFormats; //導入依賴的package包/類
private void func_148171_c(int p_148171_1_, int p_148171_2_, int p_148171_3_, int p_148171_4_)
{
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    this.mc.getTextureManager().bindTexture(Gui.statIcons);
    float f = 0.0078125F;
    float f1 = 0.0078125F;
    int i = 18;
    int j = 18;
    Tessellator tessellator = Tessellator.getInstance();
    WorldRenderer worldrenderer = tessellator.getWorldRenderer();
    worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
    worldrenderer.pos((double)(p_148171_1_ + 0), (double)(p_148171_2_ + 18), (double)GuiFlatPresets.this.zLevel).tex((double)((float)(p_148171_3_ + 0) * 0.0078125F), (double)((float)(p_148171_4_ + 18) * 0.0078125F)).endVertex();
    worldrenderer.pos((double)(p_148171_1_ + 18), (double)(p_148171_2_ + 18), (double)GuiFlatPresets.this.zLevel).tex((double)((float)(p_148171_3_ + 18) * 0.0078125F), (double)((float)(p_148171_4_ + 18) * 0.0078125F)).endVertex();
    worldrenderer.pos((double)(p_148171_1_ + 18), (double)(p_148171_2_ + 0), (double)GuiFlatPresets.this.zLevel).tex((double)((float)(p_148171_3_ + 18) * 0.0078125F), (double)((float)(p_148171_4_ + 0) * 0.0078125F)).endVertex();
    worldrenderer.pos((double)(p_148171_1_ + 0), (double)(p_148171_2_ + 0), (double)GuiFlatPresets.this.zLevel).tex((double)((float)(p_148171_3_ + 0) * 0.0078125F), (double)((float)(p_148171_4_ + 0) * 0.0078125F)).endVertex();
    tessellator.draw();
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:18,代碼來源:GuiFlatPresets.java

示例12: drawOutlinedRect

import net.minecraft.client.renderer.vertex.DefaultVertexFormats; //導入依賴的package包/類
public static void drawOutlinedRect(int x, int y, int w, int h, int color, float width) {
    float r = (float)(color >> 16 & 255) / 255.0F;
    float g = (float)(color >> 8 & 255) / 255.0F;
    float b = (float)(color & 255) / 255.0F;
    float a = (float)(color >> 24 & 255) / 255.0F;
    Tessellator tessellator = Tessellator.getInstance();
    BufferBuilder BufferBuilder = tessellator.getBuffer();

    GlStateManager.enableBlend();
    GlStateManager.disableTexture2D();
    GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
    GlStateManager.color(r, g, b, a);

    GL11.glLineWidth(width);

    BufferBuilder.begin(GL11.GL_LINE_LOOP, DefaultVertexFormats.POSITION);
    BufferBuilder.pos((double)x, (double)y, 0.0D).endVertex();
    BufferBuilder.pos((double)x, (double)y + h, 0.0D).endVertex();
    BufferBuilder.pos((double)x + w, (double)y + h, 0.0D).endVertex();
    BufferBuilder.pos((double)x + w, (double)y, 0.0D).endVertex();
    tessellator.draw();

    GlStateManager.enableTexture2D();
    GlStateManager.disableBlend();
}
 
開發者ID:fr1kin,項目名稱:ForgeHax,代碼行數:26,代碼來源:SurfaceHelper.java

示例13: loadTexture

import net.minecraft.client.renderer.vertex.DefaultVertexFormats; //導入依賴的package包/類
@Override
public void loadTexture(IResourceManager resourceManager) throws IOException
{
    TextureUtil.uploadTextureImageAllocate(this.getGlTextureId(), image, false, false);

    ImmutableList.Builder<BakedQuad> builder = ImmutableList.builder();
    tasi = new TextureAtlasSpriteBufferedImage(this.rl, this.image);
    tasi.load(Minecraft.getMinecraft().getResourceManager(), rl);
    builder.addAll(ItemLayerModel.getQuadsForSprite(0, tasi, DefaultVertexFormats.ITEM, Optional.empty()));
    quads = builder.build();
}
 
開發者ID:iChun,項目名稱:Clef,代碼行數:12,代碼來源:Instrument.java

示例14: drawTexturedModalRect

import net.minecraft.client.renderer.vertex.DefaultVertexFormats; //導入依賴的package包/類
public static void drawTexturedModalRect(int x, int y, int textureX, int textureY, int width, int height, int totw, int toth) {
    float f = 1.0f/totw;
    float f1 = 1.0f/toth;
    double zLevel = 50;
    Tessellator tessellator = Tessellator.getInstance();
    VertexBuffer vertexbuffer = tessellator.getBuffer();
    vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX);
    vertexbuffer.pos((x + 0), (y + height), zLevel).tex(((textureX + 0) *  f), ((textureY + height) * f1)).endVertex();
    vertexbuffer.pos((x + width), (y + height), zLevel).tex(((textureX + width) * f), ((textureY + height) * f1)).endVertex();
    vertexbuffer.pos((x + width), (y + 0), zLevel).tex(((textureX + width) * f), ((textureY + 0) * f1)).endVertex();
    vertexbuffer.pos((x + 0), (y + 0), zLevel).tex(((textureX + 0) * f), ((textureY + 0) * f1)).endVertex();
    tessellator.draw();
}
 
開發者ID:McJty,項目名稱:Lector,代碼行數:14,代碼來源:RenderHelper.java

示例15: drawBoundingBox

import net.minecraft.client.renderer.vertex.DefaultVertexFormats; //導入依賴的package包/類
public static void drawBoundingBox(double minX, double minY, double minZ, double maxX, double maxY, double maxZ, float red, float green, float blue, float alpha)
{
    Tessellator tessellator = Tessellator.getInstance();
    VertexBuffer vertexbuffer = tessellator.getBuffer();
    vertexbuffer.begin(3, DefaultVertexFormats.POSITION_COLOR);
    drawBoundingBox(vertexbuffer, minX, minY, minZ, maxX, maxY, maxZ, red, green, blue, alpha);
    tessellator.draw();
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:9,代碼來源:RenderGlobal.java


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