当前位置: 首页>>代码示例>>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;未经允许,请勿转载。