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


Java GlStateManager.enableTexture2D方法代碼示例

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


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

示例1: render

import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
@Override
public void render(int mouseX, int mouseY, float partialTick) {
    drawRect(x, y, x + CHECKBOX_WIDTH, y + CHECKBOX_HEIGHT, enabled ? 0xFFA0A0A0 : 0xFF999999);
    drawRect(x + 1, y + 1, x + CHECKBOX_WIDTH - 1, y + CHECKBOX_HEIGHT - 1, enabled ? 0xFF202020 : 0xFFAAAAAA);
    if (checked) {
        GlStateManager.disableTexture2D();
        if (enabled) {
            GlStateManager.color(1, 1, 1, 1);
        } else {
            GlStateManager.color(0.8f, 0.8f, 0.8f, 1);
        }
        BufferBuilder wr = Tessellator.getInstance().getBuffer();
        wr.begin(GL11.GL_LINE_STRIP, DefaultVertexFormats.POSITION);
        wr.pos(x + 2, y + 5, zLevel).endVertex();
        wr.pos(x + 5, y + 7, zLevel).endVertex();
        wr.pos(x + 8, y + 3, zLevel).endVertex();
        Tessellator.getInstance().draw();
        GlStateManager.enableTexture2D();
        GlStateManager.color(0.25f, 0.25f, 0.25f, 1);
    }
    fontRenderer.drawString(I18n.format(text), x + 1 + CHECKBOX_WIDTH, y + CHECKBOX_HEIGHT / 2 - fontRenderer.FONT_HEIGHT / 2, enabled ? color : 0xFF888888);
}
 
開發者ID:TeamPneumatic,項目名稱:pnc-repressurized,代碼行數:23,代碼來源:GuiCheckBox.java

示例2: drawRoundedRect

import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
public static void drawRoundedRect(float x, float y, float x1, float y1, int borderC, int insideC) {
	GlStateManager.enableBlend();
    GlStateManager.disableTexture2D();
    GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
    GL11.glScalef((float)0.5f, (float)0.5f, (float)0.5f);
    RenderUtils.drawVLine(x *= 2.0f, (y *= 2.0f) + 1.0f, (y1 *= 2.0f) - 2.0f, borderC);
    RenderUtils.drawVLine((x1 *= 2.0f) - 1.0f, y + 1.0f, y1 - 2.0f, borderC);
    RenderUtils.drawHLine(x + 2.0f, x1 - 3.0f, y, borderC);
    RenderUtils.drawHLine(x + 2.0f, x1 - 3.0f, y1 - 1.0f, borderC);
    RenderUtils.drawHLine(x + 1.0f, x + 1.0f, y + 1.0f, borderC);
    RenderUtils.drawHLine(x1 - 2.0f, x1 - 2.0f, y + 1.0f, borderC);
    RenderUtils.drawHLine(x1 - 2.0f, x1 - 2.0f, y1 - 2.0f, borderC);
    RenderUtils.drawHLine(x + 1.0f, x + 1.0f, y1 - 2.0f, borderC);
    RenderUtils.drawRect(x + 1.0f, y + 1.0f, x1 - 1.0f, y1 - 1.0f, insideC);
    GL11.glScalef((float)2.0f, (float)2.0f, (float)2.0f);
    GlStateManager.enableTexture2D();
    GlStateManager.disableBlend();
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:19,代碼來源:RenderUtils.java

示例3: drawGradientBorderedRect

import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
public static void drawGradientBorderedRect(double x, double y, double x2, double y2, float l1, int col1, int col2, int col3) {
	GlStateManager.enableBlend();
    GlStateManager.disableTexture2D();
    GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
    GL11.glPushMatrix();
    RenderUtils.glColor(col1);
    GL11.glLineWidth((float)1.0f);
    GL11.glBegin((int)1);
    GL11.glVertex2d((double)x, (double)y);
    GL11.glVertex2d((double)x, (double)y2);
    GL11.glVertex2d((double)x2, (double)y2);
    GL11.glVertex2d((double)x2, (double)y);
    GL11.glVertex2d((double)x, (double)y);
    GL11.glVertex2d((double)x2, (double)y);
    GL11.glVertex2d((double)x, (double)y2);
    GL11.glVertex2d((double)x2, (double)y2);
    GL11.glEnd();
    GL11.glPopMatrix();
    RenderUtils.drawGradientRect(x, y, x2, y2, col2, col3);
    GlStateManager.enableTexture2D();
    GlStateManager.disableBlend();
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:23,代碼來源:RenderUtils.java

示例4: func_180560_a

import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
protected void func_180560_a(EntityMinecartTNT minecart, float partialTicks, IBlockState state)
{
    int i = minecart.getFuseTicks();

    if (i > -1 && (float)i - partialTicks + 1.0F < 10.0F)
    {
        float f = 1.0F - ((float)i - partialTicks + 1.0F) / 10.0F;
        f = MathHelper.clamp_float(f, 0.0F, 1.0F);
        f = f * f;
        f = f * f;
        float f1 = 1.0F + f * 0.3F;
        GlStateManager.scale(f1, f1, f1);
    }

    super.func_180560_a(minecart, partialTicks, state);

    if (i > -1 && i / 5 % 2 == 0)
    {
        BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
        GlStateManager.disableTexture2D();
        GlStateManager.disableLighting();
        GlStateManager.enableBlend();
        GlStateManager.blendFunc(770, 772);
        GlStateManager.color(1.0F, 1.0F, 1.0F, (1.0F - ((float)i - partialTicks + 1.0F) / 100.0F) * 0.8F);
        GlStateManager.pushMatrix();
        blockrendererdispatcher.renderBlockBrightness(Blocks.tnt.getDefaultState(), 1.0F);
        GlStateManager.popMatrix();
        GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
        GlStateManager.disableBlend();
        GlStateManager.enableLighting();
        GlStateManager.enableTexture2D();
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:34,代碼來源:RenderTntMinecart.java

示例5: render

import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
@Override
public void render(TileEntityElevatorCaller te, double x, double y, double z, float partialTicks, int destroyStage, float alpha) {
    Tessellator tess = Tessellator.getInstance();
    GlStateManager.pushMatrix();
    GlStateManager.translate(x + 0.5, y + 1.5, z + 0.5);
    GlStateManager.scale(1.0F, -1F, -1F);
    PneumaticCraftUtils.rotateMatrixByMetadata(te.getBlockMetadata());
    GlStateManager.translate(-1, 0, -1);

    FontRenderer fontRenderer = Minecraft.getMinecraft().getRenderManager().getFontRenderer();
    for (TileEntityElevatorCaller.ElevatorButton button : te.getFloors()) {
        GlStateManager.disableTexture2D();
        GlStateManager.disableLighting();
        GlStateManager.enableBlend();
        GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
        GlStateManager.color(button.red, button.green, button.blue, 1F);
        BufferBuilder bufferBuilder = tess.getBuffer();
        bufferBuilder.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION);
        bufferBuilder.pos(button.posX + 0.5D, button.posY + 0.5D, 0.499D).endVertex();
        bufferBuilder.pos(button.posX + 0.5D, button.posY + button.height + 0.5D, 0.499D).endVertex();
        bufferBuilder.pos(button.posX + button.width + 0.5D, button.posY + button.height + 0.5D, 0.499D).endVertex();
        bufferBuilder.pos(button.posX + button.width + 0.5D, button.posY + 0.5D, 0.499D).endVertex();
        tess.draw();
        GlStateManager.enableTexture2D();
        GlStateManager.disableBlend();
        GlStateManager.enableLighting();

        GlStateManager.pushMatrix();
        GlStateManager.translate(button.posX + 0.5D, button.posY + 0.5D, 0.498);
        GlStateManager.translate(button.width / 2, button.height / 2, 0);
        float textScale = Math.min((float)button.width / 10F, (float)button.height / 10F);
        GlStateManager.scale(textScale, textScale, textScale);
        fontRenderer.drawString(button.buttonText, -fontRenderer.getStringWidth(button.buttonText) / 2, -fontRenderer.FONT_HEIGHT / 2, 0xFF000000);
        GlStateManager.popMatrix();
    }
    GlStateManager.popMatrix();
}
 
開發者ID:TeamPneumatic,項目名稱:pnc-repressurized,代碼行數:38,代碼來源:RenderElevatorCaller.java

示例6: unsetScoreTeamColor

import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
protected void unsetScoreTeamColor()
{
    GlStateManager.enableLighting();
    GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit);
    GlStateManager.enableTexture2D();
    GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit);
    GlStateManager.enableTexture2D();
    GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit);
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:10,代碼來源:RendererLivingEntity.java

示例7: drawCursorVertical

import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
/**
 * draws the vertical line cursor in the textbox
 */
private void drawCursorVertical(int p_146188_1_, int p_146188_2_, int p_146188_3_, int p_146188_4_) {
    if (p_146188_1_ < p_146188_3_) {
        int i = p_146188_1_;
        p_146188_1_ = p_146188_3_;
        p_146188_3_ = i;
    }

    if (p_146188_2_ < p_146188_4_) {
        int j = p_146188_2_;
        p_146188_2_ = p_146188_4_;
        p_146188_4_ = j;
    }

    if (p_146188_3_ > this.xPosition + this.width) {
        p_146188_3_ = this.xPosition + this.width;
    }

    if (p_146188_1_ > this.xPosition + this.width) {
        p_146188_1_ = this.xPosition + this.width;
    }

    Tessellator tessellator = Tessellator.getInstance();
    WorldRenderer worldrenderer = tessellator.getWorldRenderer();
    GlStateManager.color(0.0F, 0.0F, 255.0F, 255.0F);
    GlStateManager.disableTexture2D();
    GlStateManager.enableColorLogic();
    GlStateManager.colorLogicOp(5387);
    worldrenderer.begin(7, DefaultVertexFormats.POSITION);
    worldrenderer.pos((double) p_146188_1_, (double) p_146188_4_, 0.0D).endVertex();
    worldrenderer.pos((double) p_146188_3_, (double) p_146188_4_, 0.0D).endVertex();
    worldrenderer.pos((double) p_146188_3_, (double) p_146188_2_, 0.0D).endVertex();
    worldrenderer.pos((double) p_146188_1_, (double) p_146188_2_, 0.0D).endVertex();
    tessellator.draw();
    GlStateManager.disableColorLogic();
    GlStateManager.enableTexture2D();
}
 
開發者ID:boomboompower,項目名稱:TextDisplayer,代碼行數:40,代碼來源:ModernTextBox.java

示例8: updateAchievementWindow

import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
public void updateAchievementWindow()
{
    if (this.theAchievement != null && this.notificationTime != 0L && Minecraft.getMinecraft().player != null)
    {
        double d0 = (double)(Minecraft.getSystemTime() - this.notificationTime) / 3000.0D;

        if (this.permanentNotification)
        {
            if (d0 > 0.5D)
            {
                d0 = 0.5D;
            }
        }
        else if (d0 < 0.0D || d0 > 1.0D)
        {
            this.notificationTime = 0L;
            return;
        }

        this.updateAchievementWindowScale();
        GlStateManager.disableDepth();
        GlStateManager.depthMask(false);
        double d1 = d0 * 2.0D;

        if (d1 > 1.0D)
        {
            d1 = 2.0D - d1;
        }

        d1 = d1 * 4.0D;
        d1 = 1.0D - d1;

        if (d1 < 0.0D)
        {
            d1 = 0.0D;
        }

        d1 = d1 * d1;
        d1 = d1 * d1;
        int i = this.width - 160;
        int j = 0 - (int)(d1 * 36.0D);
        GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
        GlStateManager.enableTexture2D();
        this.mc.getTextureManager().bindTexture(ACHIEVEMENT_BG);
        GlStateManager.disableLighting();
        this.drawTexturedModalRect(i, j, 96, 202, 160, 32);

        if (this.permanentNotification)
        {
            this.mc.fontRendererObj.drawSplitString(this.achievementDescription, i + 30, j + 7, 120, -1);
        }
        else
        {
            this.mc.fontRendererObj.drawString(this.achievementTitle, i + 30, j + 7, -256);
            this.mc.fontRendererObj.drawString(this.achievementDescription, i + 30, j + 18, -1);
        }

        RenderHelper.enableGUIStandardItemLighting();
        GlStateManager.disableLighting();
        GlStateManager.enableRescaleNormal();
        GlStateManager.enableColorMaterial();
        GlStateManager.enableLighting();
        this.renderItem.renderItemAndEffectIntoGUI(this.theAchievement.theItemStack, i + 8, j + 8);
        GlStateManager.disableLighting();
        GlStateManager.depthMask(true);
        GlStateManager.enableDepth();
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:69,代碼來源:GuiAchievement.java

示例9: drawCursorVertical

import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
/**
 * draws the vertical line cursor in the textbox
 */
private void drawCursorVertical(int p_146188_1_, int p_146188_2_, int p_146188_3_, int p_146188_4_)
{
    if (p_146188_1_ < p_146188_3_)
    {
        int i = p_146188_1_;
        p_146188_1_ = p_146188_3_;
        p_146188_3_ = i;
    }

    if (p_146188_2_ < p_146188_4_)
    {
        int j = p_146188_2_;
        p_146188_2_ = p_146188_4_;
        p_146188_4_ = j;
    }

    if (p_146188_3_ > this.xPosition + this.width)
    {
        p_146188_3_ = this.xPosition + this.width;
    }

    if (p_146188_1_ > this.xPosition + this.width)
    {
        p_146188_1_ = this.xPosition + this.width;
    }

    Tessellator tessellator = Tessellator.getInstance();
    WorldRenderer worldrenderer = tessellator.getWorldRenderer();
    GlStateManager.color(0.0F, 0.0F, 255.0F, 255.0F);
    GlStateManager.disableTexture2D();
    GlStateManager.enableColorLogic();
    GlStateManager.colorLogicOp(5387);
    worldrenderer.begin(7, DefaultVertexFormats.POSITION);
    worldrenderer.pos((double)p_146188_1_, (double)p_146188_4_, 0.0D).endVertex();
    worldrenderer.pos((double)p_146188_3_, (double)p_146188_4_, 0.0D).endVertex();
    worldrenderer.pos((double)p_146188_3_, (double)p_146188_2_, 0.0D).endVertex();
    worldrenderer.pos((double)p_146188_1_, (double)p_146188_2_, 0.0D).endVertex();
    tessellator.draw();
    GlStateManager.disableColorLogic();
    GlStateManager.enableTexture2D();
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:45,代碼來源:GuiTextField.java

示例10: drawScreen

import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
public void drawScreen(int mouseXIn, int mouseYIn, float p_148128_3_)
{
    if (this.field_178041_q)
    {
        this.mouseX = mouseXIn;
        this.mouseY = mouseYIn;
        this.drawBackground();
        int i = this.getScrollBarX();
        int j = i + 6;
        this.bindAmountScrolled();
        GlStateManager.disableLighting();
        GlStateManager.disableFog();
        Tessellator tessellator = Tessellator.getInstance();
        WorldRenderer worldrenderer = tessellator.getWorldRenderer();
        int k = this.left + this.width / 2 - this.getListWidth() / 2 + 2;
        int l = this.top + 4 - (int)this.amountScrolled;

        if (this.hasListHeader)
        {
            this.drawListHeader(k, l, tessellator);
        }

        this.drawSelectionBox(k, l, mouseXIn, mouseYIn);
        GlStateManager.disableDepth();
        int i1 = 4;
        this.overlayBackground(0, this.top, 255, 255);
        this.overlayBackground(this.bottom, this.height, 255, 255);
        GlStateManager.enableBlend();
        GlStateManager.tryBlendFuncSeparate(770, 771, 0, 1);
        GlStateManager.disableAlpha();
        GlStateManager.shadeModel(7425);
        GlStateManager.disableTexture2D();
        int j1 = this.func_148135_f();

        if (j1 > 0)
        {
            int k1 = (this.bottom - this.top) * (this.bottom - this.top) / this.getContentHeight();
            k1 = MathHelper.clamp_int(k1, 32, this.bottom - this.top - 8);
            int l1 = (int)this.amountScrolled * (this.bottom - this.top - k1) / j1 + this.top;

            if (l1 < this.top)
            {
                l1 = this.top;
            }

            worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
            worldrenderer.pos((double)i, (double)this.bottom, 0.0D).tex(0.0D, 1.0D).color(0, 0, 0, 255).endVertex();
            worldrenderer.pos((double)j, (double)this.bottom, 0.0D).tex(1.0D, 1.0D).color(0, 0, 0, 255).endVertex();
            worldrenderer.pos((double)j, (double)this.top, 0.0D).tex(1.0D, 0.0D).color(0, 0, 0, 255).endVertex();
            worldrenderer.pos((double)i, (double)this.top, 0.0D).tex(0.0D, 0.0D).color(0, 0, 0, 255).endVertex();
            tessellator.draw();
            worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
            worldrenderer.pos((double)i, (double)(l1 + k1), 0.0D).tex(0.0D, 1.0D).color(128, 128, 128, 255).endVertex();
            worldrenderer.pos((double)j, (double)(l1 + k1), 0.0D).tex(1.0D, 1.0D).color(128, 128, 128, 255).endVertex();
            worldrenderer.pos((double)j, (double)l1, 0.0D).tex(1.0D, 0.0D).color(128, 128, 128, 255).endVertex();
            worldrenderer.pos((double)i, (double)l1, 0.0D).tex(0.0D, 0.0D).color(128, 128, 128, 255).endVertex();
            tessellator.draw();
            worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
            worldrenderer.pos((double)i, (double)(l1 + k1 - 1), 0.0D).tex(0.0D, 1.0D).color(192, 192, 192, 255).endVertex();
            worldrenderer.pos((double)(j - 1), (double)(l1 + k1 - 1), 0.0D).tex(1.0D, 1.0D).color(192, 192, 192, 255).endVertex();
            worldrenderer.pos((double)(j - 1), (double)l1, 0.0D).tex(1.0D, 0.0D).color(192, 192, 192, 255).endVertex();
            worldrenderer.pos((double)i, (double)l1, 0.0D).tex(0.0D, 0.0D).color(192, 192, 192, 255).endVertex();
            tessellator.draw();
        }

        this.func_148142_b(mouseXIn, mouseYIn);
        GlStateManager.enableTexture2D();
        GlStateManager.shadeModel(7424);
        GlStateManager.enableAlpha();
        GlStateManager.disableBlend();
    }
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:73,代碼來源:GuiSimpleScrolledSelectionListProxy.java

示例11: renderItemOverlayIntoGUI

import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
/**
 * Renders the stack size and/or damage bar for the given ItemStack.
 */
public void renderItemOverlayIntoGUI(FontRenderer fr, ItemStack stack, int xPosition, int yPosition, String text)
{
    if (stack != null)
    {
        if (stack.stackSize != 1 || text != null)
        {
            String s = text == null ? String.valueOf(stack.stackSize) : text;

            if (text == null && stack.stackSize < 1)
            {
                s = EnumChatFormatting.RED + String.valueOf(stack.stackSize);
            }

            GlStateManager.disableLighting();
            GlStateManager.disableDepth();
            GlStateManager.disableBlend();
            fr.drawStringWithShadow(s, (float)(xPosition + 19 - 2 - fr.getStringWidth(s)), (float)(yPosition + 6 + 3), 16777215);
            GlStateManager.enableLighting();
            GlStateManager.enableDepth();
        }

        boolean flag = stack.isItemDamaged();

        if (Reflector.ForgeItem_showDurabilityBar.exists())
        {
            flag = Reflector.callBoolean(stack.getItem(), Reflector.ForgeItem_showDurabilityBar, new Object[] {stack});
        }

        if (flag)
        {
            int i = (int)Math.round(13.0D - (double)stack.getItemDamage() * 13.0D / (double)stack.getMaxDamage());
            int j = (int)Math.round(255.0D - (double)stack.getItemDamage() * 255.0D / (double)stack.getMaxDamage());

            if (Reflector.ForgeItem_getDurabilityForDisplay.exists())
            {
                double d0 = Reflector.callDouble(stack.getItem(), Reflector.ForgeItem_getDurabilityForDisplay, new Object[] {stack});
                i = (int)Math.round(13.0D - d0 * 13.0D);
                j = (int)Math.round(255.0D - d0 * 255.0D);
            }

            GlStateManager.disableLighting();
            GlStateManager.disableDepth();
            GlStateManager.disableTexture2D();
            GlStateManager.disableAlpha();
            GlStateManager.disableBlend();
            Tessellator tessellator = Tessellator.getInstance();
            WorldRenderer worldrenderer = tessellator.getWorldRenderer();
            this.func_181565_a(worldrenderer, xPosition + 2, yPosition + 13, 13, 2, 0, 0, 0, 255);
            this.func_181565_a(worldrenderer, xPosition + 2, yPosition + 13, 12, 1, (255 - j) / 4, 64, 0, 255);
            this.func_181565_a(worldrenderer, xPosition + 2, yPosition + 13, i, 1, 255 - j, j, 0, 255);

            if (!Reflector.ForgeHooksClient.exists())
            {
                GlStateManager.enableBlend();
            }

            GlStateManager.enableAlpha();
            GlStateManager.enableTexture2D();
            GlStateManager.enableLighting();
            GlStateManager.enableDepth();
        }
    }
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:67,代碼來源:RenderItem.java

示例12: showLagometer

import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
public static void showLagometer(ScaledResolution p_showLagometer_0_)
{
    if (gameSettings != null)
    {
        if (gameSettings.ofLagometer || gameSettings.showLagometer)
        {
            long i = System.nanoTime();
            GlStateManager.clear(256);
            GlStateManager.matrixMode(5889);
            GlStateManager.pushMatrix();
            GlStateManager.enableColorMaterial();
            GlStateManager.loadIdentity();
            GlStateManager.ortho(0.0D, (double)mc.displayWidth, (double)mc.displayHeight, 0.0D, 1000.0D, 3000.0D);
            GlStateManager.matrixMode(5888);
            GlStateManager.pushMatrix();
            GlStateManager.loadIdentity();
            GlStateManager.translate(0.0F, 0.0F, -2000.0F);
            GL11.glLineWidth(1.0F);
            GlStateManager.disableTexture2D();
            Tessellator tessellator = Tessellator.getInstance();
            VertexBuffer vertexbuffer = tessellator.getBuffer();
            vertexbuffer.begin(1, DefaultVertexFormats.POSITION_COLOR);

            for (int j = 0; j < timesFrame.length; ++j)
            {
                int k = (j - numRecordedFrameTimes & timesFrame.length - 1) * 100 / timesFrame.length;
                k = k + 155;
                float f = (float)mc.displayHeight;
                long l = 0L;

                if (gcs[j])
                {
                    renderTime(j, timesFrame[j], k, k / 2, 0, f, vertexbuffer);
                }
                else
                {
                    renderTime(j, timesFrame[j], k, k, k, f, vertexbuffer);
                    f = f - (float)renderTime(j, timesServer[j], k / 2, k / 2, k / 2, f, vertexbuffer);
                    f = f - (float)renderTime(j, timesTerrain[j], 0, k, 0, f, vertexbuffer);
                    f = f - (float)renderTime(j, timesVisibility[j], k, k, 0, f, vertexbuffer);
                    f = f - (float)renderTime(j, timesChunkUpdate[j], k, 0, 0, f, vertexbuffer);
                    f = f - (float)renderTime(j, timesChunkUpload[j], k, 0, k, f, vertexbuffer);
                    f = f - (float)renderTime(j, timesScheduledExecutables[j], 0, 0, k, f, vertexbuffer);
                    float f2 = f - (float)renderTime(j, timesTick[j], 0, k, k, f, vertexbuffer);
                }
            }

            renderTimeDivider(0, timesFrame.length, 33333333L, 196, 196, 196, (float)mc.displayHeight, vertexbuffer);
            renderTimeDivider(0, timesFrame.length, 16666666L, 196, 196, 196, (float)mc.displayHeight, vertexbuffer);
            tessellator.draw();
            GlStateManager.enableTexture2D();
            int j2 = mc.displayHeight - 80;
            int k2 = mc.displayHeight - 160;
            mc.fontRendererObj.drawString("30", 2, k2 + 1, -8947849);
            mc.fontRendererObj.drawString("30", 1, k2, -3881788);
            mc.fontRendererObj.drawString("60", 2, j2 + 1, -8947849);
            mc.fontRendererObj.drawString("60", 1, j2, -3881788);
            GlStateManager.matrixMode(5889);
            GlStateManager.popMatrix();
            GlStateManager.matrixMode(5888);
            GlStateManager.popMatrix();
            GlStateManager.enableTexture2D();
            float f1 = 1.0F - (float)((double)(System.currentTimeMillis() - memTimeStartMs) / 1000.0D);
            f1 = Config.limit(f1, 0.0F, 1.0F);
            int l2 = (int)(170.0F + f1 * 85.0F);
            int i1 = (int)(100.0F + f1 * 55.0F);
            int j1 = (int)(10.0F + f1 * 10.0F);
            int k1 = l2 << 16 | i1 << 8 | j1;
            int l1 = 512 / p_showLagometer_0_.getScaleFactor() + 2;
            int i2 = mc.displayHeight / p_showLagometer_0_.getScaleFactor() - 8;
            GuiIngame guiingame = mc.ingameGUI;
            GuiIngame.drawRect(l1 - 1, i2 - 1, l1 + 50, i2 + 10, -1605349296);
            mc.fontRendererObj.drawString(" " + memMbSec + " MB/s", l1, i2, k1);
            renderTimeNano = System.nanoTime() - i;
        }
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:78,代碼來源:Lagometer.java

示例13: doRenderLayer

import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
public void doRenderLayer(EntityDragon entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale)
{
    if (entitylivingbaseIn.deathTicks > 0)
    {
        Tessellator tessellator = Tessellator.getInstance();
        WorldRenderer worldrenderer = tessellator.getWorldRenderer();
        RenderHelper.disableStandardItemLighting();
        float f = ((float)entitylivingbaseIn.deathTicks + partialTicks) / 200.0F;
        float f1 = 0.0F;

        if (f > 0.8F)
        {
            f1 = (f - 0.8F) / 0.2F;
        }

        Random random = new Random(432L);
        GlStateManager.disableTexture2D();
        GlStateManager.shadeModel(7425);
        GlStateManager.enableBlend();
        GlStateManager.blendFunc(770, 1);
        GlStateManager.disableAlpha();
        GlStateManager.enableCull();
        GlStateManager.depthMask(false);
        GlStateManager.pushMatrix();
        GlStateManager.translate(0.0F, -1.0F, -2.0F);

        for (int i = 0; (float)i < (f + f * f) / 2.0F * 60.0F; ++i)
        {
            GlStateManager.rotate(random.nextFloat() * 360.0F, 1.0F, 0.0F, 0.0F);
            GlStateManager.rotate(random.nextFloat() * 360.0F, 0.0F, 1.0F, 0.0F);
            GlStateManager.rotate(random.nextFloat() * 360.0F, 0.0F, 0.0F, 1.0F);
            GlStateManager.rotate(random.nextFloat() * 360.0F, 1.0F, 0.0F, 0.0F);
            GlStateManager.rotate(random.nextFloat() * 360.0F, 0.0F, 1.0F, 0.0F);
            GlStateManager.rotate(random.nextFloat() * 360.0F + f * 90.0F, 0.0F, 0.0F, 1.0F);
            float f2 = random.nextFloat() * 20.0F + 5.0F + f1 * 10.0F;
            float f3 = random.nextFloat() * 2.0F + 1.0F + f1 * 2.0F;
            worldrenderer.begin(6, DefaultVertexFormats.POSITION_COLOR);
            worldrenderer.pos(0.0D, 0.0D, 0.0D).color(255, 255, 255, (int)(255.0F * (1.0F - f1))).endVertex();
            worldrenderer.pos(-0.866D * (double)f3, (double)f2, (double)(-0.5F * f3)).color(255, 0, 255, 0).endVertex();
            worldrenderer.pos(0.866D * (double)f3, (double)f2, (double)(-0.5F * f3)).color(255, 0, 255, 0).endVertex();
            worldrenderer.pos(0.0D, (double)f2, (double)(1.0F * f3)).color(255, 0, 255, 0).endVertex();
            worldrenderer.pos(-0.866D * (double)f3, (double)f2, (double)(-0.5F * f3)).color(255, 0, 255, 0).endVertex();
            tessellator.draw();
        }

        GlStateManager.popMatrix();
        GlStateManager.depthMask(true);
        GlStateManager.disableCull();
        GlStateManager.disableBlend();
        GlStateManager.shadeModel(7424);
        GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
        GlStateManager.enableTexture2D();
        GlStateManager.enableAlpha();
        RenderHelper.enableStandardItemLighting();
    }
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:57,代碼來源:LayerEnderDragonDeath.java

示例14: drawBoundingBox

import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
public static void drawBoundingBox(AxisAlignedBB par1AxisAlignedBB)
{
	Tessellator tessellator = Tessellator.getInstance();
       net.minecraft.client.renderer.VertexBuffer vertexbuffer = tessellator.getBuffer();

       GlStateManager.color(0.0F, 0.0F, 255.0F, 255.0F);
       GlStateManager.disableTexture2D();
       GlStateManager.enableColorLogic();
       GlStateManager.colorLogicOp(GlStateManager.LogicOp.OR_REVERSE);
       vertexbuffer.begin(3, DefaultVertexFormats.POSITION);
	vertexbuffer.pos(par1AxisAlignedBB.minX, par1AxisAlignedBB.minY, par1AxisAlignedBB.minZ);
	vertexbuffer.pos(par1AxisAlignedBB.minX, par1AxisAlignedBB.maxY, par1AxisAlignedBB.minZ);
	vertexbuffer.pos(par1AxisAlignedBB.maxX, par1AxisAlignedBB.minY, par1AxisAlignedBB.minZ);
	vertexbuffer.pos(par1AxisAlignedBB.maxX, par1AxisAlignedBB.maxY, par1AxisAlignedBB.minZ);
	vertexbuffer.pos(par1AxisAlignedBB.maxX, par1AxisAlignedBB.minY, par1AxisAlignedBB.maxZ);
	vertexbuffer.pos(par1AxisAlignedBB.maxX, par1AxisAlignedBB.maxY, par1AxisAlignedBB.maxZ);
	vertexbuffer.pos(par1AxisAlignedBB.minX, par1AxisAlignedBB.minY, par1AxisAlignedBB.maxZ);
	vertexbuffer.pos(par1AxisAlignedBB.minX, par1AxisAlignedBB.maxY, par1AxisAlignedBB.maxZ);
	tessellator.draw();
	vertexbuffer.pos(par1AxisAlignedBB.maxX, par1AxisAlignedBB.maxY, par1AxisAlignedBB.minZ);
	vertexbuffer.pos(par1AxisAlignedBB.maxX, par1AxisAlignedBB.minY, par1AxisAlignedBB.minZ);
	vertexbuffer.pos(par1AxisAlignedBB.minX, par1AxisAlignedBB.maxY, par1AxisAlignedBB.minZ);
	vertexbuffer.pos(par1AxisAlignedBB.minX, par1AxisAlignedBB.minY, par1AxisAlignedBB.minZ);
	vertexbuffer.pos(par1AxisAlignedBB.minX, par1AxisAlignedBB.maxY, par1AxisAlignedBB.maxZ);
	vertexbuffer.pos(par1AxisAlignedBB.minX, par1AxisAlignedBB.minY, par1AxisAlignedBB.maxZ);
	vertexbuffer.pos(par1AxisAlignedBB.maxX, par1AxisAlignedBB.maxY, par1AxisAlignedBB.maxZ);
	vertexbuffer.pos(par1AxisAlignedBB.maxX, par1AxisAlignedBB.minY, par1AxisAlignedBB.maxZ);
	tessellator.draw();
	vertexbuffer.pos(par1AxisAlignedBB.minX, par1AxisAlignedBB.maxY, par1AxisAlignedBB.minZ);
	vertexbuffer.pos(par1AxisAlignedBB.maxX, par1AxisAlignedBB.maxY, par1AxisAlignedBB.minZ);
	vertexbuffer.pos(par1AxisAlignedBB.maxX, par1AxisAlignedBB.maxY, par1AxisAlignedBB.maxZ);
	vertexbuffer.pos(par1AxisAlignedBB.minX, par1AxisAlignedBB.maxY, par1AxisAlignedBB.maxZ);
	vertexbuffer.pos(par1AxisAlignedBB.minX, par1AxisAlignedBB.maxY, par1AxisAlignedBB.minZ);
	vertexbuffer.pos(par1AxisAlignedBB.minX, par1AxisAlignedBB.maxY, par1AxisAlignedBB.maxZ);
	vertexbuffer.pos(par1AxisAlignedBB.maxX, par1AxisAlignedBB.maxY, par1AxisAlignedBB.maxZ);
	vertexbuffer.pos(par1AxisAlignedBB.maxX, par1AxisAlignedBB.maxY, par1AxisAlignedBB.minZ);
	tessellator.draw();
	vertexbuffer.pos(par1AxisAlignedBB.minX, par1AxisAlignedBB.minY, par1AxisAlignedBB.minZ);
	vertexbuffer.pos(par1AxisAlignedBB.maxX, par1AxisAlignedBB.minY, par1AxisAlignedBB.minZ);
	vertexbuffer.pos(par1AxisAlignedBB.maxX, par1AxisAlignedBB.minY, par1AxisAlignedBB.maxZ);
	vertexbuffer.pos(par1AxisAlignedBB.minX, par1AxisAlignedBB.minY, par1AxisAlignedBB.maxZ);
	vertexbuffer.pos(par1AxisAlignedBB.minX, par1AxisAlignedBB.minY, par1AxisAlignedBB.minZ);
	vertexbuffer.pos(par1AxisAlignedBB.minX, par1AxisAlignedBB.minY, par1AxisAlignedBB.maxZ);
	vertexbuffer.pos(par1AxisAlignedBB.maxX, par1AxisAlignedBB.minY, par1AxisAlignedBB.maxZ);
	vertexbuffer.pos(par1AxisAlignedBB.maxX, par1AxisAlignedBB.minY, par1AxisAlignedBB.minZ);
	tessellator.draw();
	vertexbuffer.pos(par1AxisAlignedBB.minX, par1AxisAlignedBB.minY, par1AxisAlignedBB.minZ);
	vertexbuffer.pos(par1AxisAlignedBB.minX, par1AxisAlignedBB.maxY, par1AxisAlignedBB.minZ);
	vertexbuffer.pos(par1AxisAlignedBB.minX, par1AxisAlignedBB.minY, par1AxisAlignedBB.maxZ);
	vertexbuffer.pos(par1AxisAlignedBB.minX, par1AxisAlignedBB.maxY, par1AxisAlignedBB.maxZ);
	vertexbuffer.pos(par1AxisAlignedBB.maxX, par1AxisAlignedBB.minY, par1AxisAlignedBB.maxZ);
	vertexbuffer.pos(par1AxisAlignedBB.maxX, par1AxisAlignedBB.maxY, par1AxisAlignedBB.maxZ);
	vertexbuffer.pos(par1AxisAlignedBB.maxX, par1AxisAlignedBB.minY, par1AxisAlignedBB.minZ);
	vertexbuffer.pos(par1AxisAlignedBB.maxX, par1AxisAlignedBB.maxY, par1AxisAlignedBB.minZ);
	tessellator.draw();
	vertexbuffer.pos(par1AxisAlignedBB.minX, par1AxisAlignedBB.maxY, par1AxisAlignedBB.maxZ);
	vertexbuffer.pos(par1AxisAlignedBB.minX, par1AxisAlignedBB.minY, par1AxisAlignedBB.maxZ);
	vertexbuffer.pos(par1AxisAlignedBB.minX, par1AxisAlignedBB.maxY, par1AxisAlignedBB.minZ);
	vertexbuffer.pos(par1AxisAlignedBB.minX, par1AxisAlignedBB.minY, par1AxisAlignedBB.minZ);
	vertexbuffer.pos(par1AxisAlignedBB.maxX, par1AxisAlignedBB.maxY, par1AxisAlignedBB.minZ);
	vertexbuffer.pos(par1AxisAlignedBB.maxX, par1AxisAlignedBB.minY, par1AxisAlignedBB.minZ);
	vertexbuffer.pos(par1AxisAlignedBB.maxX, par1AxisAlignedBB.maxY, par1AxisAlignedBB.maxZ);
	vertexbuffer.pos(par1AxisAlignedBB.maxX, par1AxisAlignedBB.minY, par1AxisAlignedBB.maxZ);
	tessellator.draw();
       GlStateManager.disableColorLogic();
       GlStateManager.enableTexture2D();
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:68,代碼來源:RenderUtils.java

示例15: renderFancyBeams2D

import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
public static void renderFancyBeams2D(double x, double y, Color color, long seed, long continuousTick, float scale,
		int countFancy, int countNormal)
{
	int dstJump = 16;
	Random rand = new Random(seed);
	GlStateManager.pushMatrix();
	GlStateManager.pushAttrib();
	GlStateManager.translate(x, y, 0);
	int fancy_count = !FMLClientHandler.instance().getClient().gameSettings.fancyGraphics ? countNormal
			: countFancy;

	Tessellator tes = Tessellator.getInstance();
	BufferBuilder vb = tes.getBuffer();

	RenderHelper.disableStandardItemLighting();
	float rotateSpeed = continuousTick / 1000.0F;
	float beamSize = 0.9F;

	GlStateManager.disableTexture2D();
	GlStateManager.shadeModel(GL11.GL_SMOOTH);
	GlStateManager.enableBlend();
	GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
	GlStateManager.depthMask(false);
	GlStateManager.pushMatrix();
	for (int i = 0; i < fancy_count; i++)
	{
		GlStateManager.rotate(rand.nextFloat() * 360.0F, 1.0F, 0.0F, 0.0F);
		GlStateManager.rotate(rand.nextFloat() * 360.0F, 0.0F, 1.0F, 0.0F);

		// Animate the beams spinning
		GlStateManager.rotate(rand.nextFloat() * 360.0F + rotateSpeed * 360.0F, 0.0F, 0.0F, 1.0F);

		vb.begin(GL11.GL_TRIANGLE_FAN, DefaultVertexFormats.POSITION_COLOR);
		// length and width of the individual beams
		float length = (rand.nextFloat() * 20.0F + 5.0F + beamSize * 10.0F)
				/ (30.0F / (Math.min(dstJump, 10 * scale) / 10.0F));
		length *= 90;
		float width = 3;

		vb.pos(0, 0, 0)
				.color(color.getRed(), color.getGreen(), color.getBlue(), (int) (255.0F * (1.0F - beamSize)) * 10)
				.endVertex();
		vb.pos(-0.7D * width, length, -0.5F * width).color(color.getRed(), color.getGreen(), color.getBlue(), 0)
				.endVertex();
		vb.pos(0.7D * width, length, -0.5F * width).color(color.getRed(), color.getGreen(), color.getBlue(), 0)
				.endVertex();
		vb.pos(0.0D, length, 1.0F * width).color(color.getRed(), color.getGreen(), color.getBlue(), 0).endVertex();
		vb.pos(-0.7D * width, length, -0.5F * width).color(color.getRed(), color.getGreen(), color.getBlue(), 0)
				.endVertex();
		tes.draw();
	}
	GlStateManager.popMatrix();
	GlStateManager.depthMask(true);
	GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
	GlStateManager.disableBlend();
	GlStateManager.shadeModel(GL11.GL_FLAT);
	GlStateManager.color(1, 1, 1, 1);
	GlStateManager.enableTexture2D();
	GlStateManager.enableAlpha();
	RenderHelper.enableStandardItemLighting();

	GlStateManager.popAttrib();
	GlStateManager.popMatrix();
}
 
開發者ID:raphydaphy,項目名稱:ArcaneMagic,代碼行數:65,代碼來源:GLHelper.java


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