当前位置: 首页>>代码示例>>Java>>正文


Java GlStateManager.tryBlendFuncSeparate方法代码示例

本文整理汇总了Java中net.minecraft.client.renderer.GlStateManager.tryBlendFuncSeparate方法的典型用法代码示例。如果您正苦于以下问题:Java GlStateManager.tryBlendFuncSeparate方法的具体用法?Java GlStateManager.tryBlendFuncSeparate怎么用?Java GlStateManager.tryBlendFuncSeparate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.client.renderer.GlStateManager的用法示例。


在下文中一共展示了GlStateManager.tryBlendFuncSeparate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: drawGradientHRect

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public static void drawGradientHRect(float x, float y, float x1, float y1, int topColor, int bottomColor) {
	GlStateManager.enableBlend();
    GlStateManager.disableTexture2D();
    GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
    GL11.glShadeModel((int)7425);
    GL11.glBegin((int)7);
    RenderUtils.glColor(topColor);
    GL11.glVertex2f((float)x, (float)y);
    GL11.glVertex2f((float)x, (float)y1);
    RenderUtils.glColor(bottomColor);
    GL11.glVertex2f((float)x1, (float)y1);
    GL11.glVertex2f((float)x1, (float)y);
    GL11.glEnd();
    GL11.glShadeModel((int)7424);
    GlStateManager.enableTexture2D();
    GlStateManager.disableBlend();
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:18,代码来源:RenderUtils.java

示例2: drawButton

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
@Override
public void drawButton(Minecraft mc, int mouseX, int mouseY, float partialTicks)
{
	if (this.visible)
	{
		int x = this.x + this.parentGui.getGuiLeft();
		FontRenderer fontrenderer = mc.fontRenderer;
		int k = this.getHoverState(this.hovered);
		mc.getTextureManager().bindTexture(GuiPlayerInventoryExtended.background);
		GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
		this.hovered = mouseX >= x && mouseY >= this.y && mouseX < x + this.width && mouseY < this.y + this.height;
		GlStateManager.enableBlend();
		GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
		GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
		GlStateManager.pushMatrix();
		GlStateManager.translate(0, 0, 200);
		HarshenClientUtils.drawTexture(x, this.y, 16.9f, (k  - 1) * 7f, 7f, 7f,  24, 24, 24, 24);
		if (k!=1)
			this.drawCenteredString(fontrenderer, I18n.translateToLocalFormatted(this.displayString), x + 5, this.y + this.height, 0xffffff);
		GlStateManager.popMatrix();

		this.mouseDragged(mc, mouseX, mouseY);
	}
}
 
开发者ID:kenijey,项目名称:harshencastle,代码行数:25,代码来源:GuiHarshenButton.java

示例3: drawLabel

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public void drawLabel(Minecraft mc, int mouseX, int mouseY)
{
    if (this.visible)
    {
        GlStateManager.enableBlend();
        GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
        this.drawLabelBackground(mc, mouseX, mouseY);
        int i = this.field_146174_h + this.field_146161_f / 2 + this.field_146163_s / 2;
        int j = i - this.field_146173_k.size() * 10 / 2;

        for (int k = 0; k < this.field_146173_k.size(); ++k)
        {
            if (this.centered)
            {
                this.drawCenteredString(this.fontRenderer, (String)this.field_146173_k.get(k), this.field_146162_g + this.field_146167_a / 2, j + k * 10, this.field_146168_n);
            }
            else
            {
                this.drawString(this.fontRenderer, (String)this.field_146173_k.get(k), this.field_146162_g, j + k * 10, this.field_146168_n);
            }
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:24,代码来源:GuiLabel.java

示例4: renderPage

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
protected void renderPage(ScaledResolution p_175258_1_, float p_175258_2_, int p_175258_3_, float p_175258_4_, SpectatorDetails p_175258_5_)
{
    GlStateManager.enableRescaleNormal();
    GlStateManager.enableBlend();
    GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
    GlStateManager.color(1.0F, 1.0F, 1.0F, p_175258_2_);
    this.mc.getTextureManager().bindTexture(WIDGETS);
    this.drawTexturedModalRect((float)(p_175258_3_ - 91), p_175258_4_, 0, 0, 182, 22);

    if (p_175258_5_.getSelectedSlot() >= 0)
    {
        this.drawTexturedModalRect((float)(p_175258_3_ - 91 - 1 + p_175258_5_.getSelectedSlot() * 20), p_175258_4_ - 1.0F, 0, 22, 24, 22);
    }

    RenderHelper.enableGUIStandardItemLighting();

    for (int i = 0; i < 9; ++i)
    {
        this.renderSlot(i, p_175258_1_.getScaledWidth() / 2 - 90 + i * 20 + 2, p_175258_4_ + 3.0F, p_175258_2_, p_175258_5_.getObject(i));
    }

    RenderHelper.disableStandardItemLighting();
    GlStateManager.disableRescaleNormal();
    GlStateManager.disableBlend();
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:26,代码来源:GuiSpectator.java

示例5: renderPumpkinOverlay

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
private void renderPumpkinOverlay(ScaledResolution p_180476_1_) {
	GlStateManager.disableDepth();
	GlStateManager.depthMask(false);
	GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
	GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
	GlStateManager.disableAlpha();
	this.mc.getTextureManager().bindTexture(pumpkinBlurTexPath);
	Tessellator tessellator = Tessellator.getInstance();
	WorldRenderer worldrenderer = tessellator.getWorldRenderer();
	worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
	worldrenderer.pos(0.0D, (double) p_180476_1_.getScaledHeight(), -90.0D).tex(0.0D, 1.0D).endVertex();
	worldrenderer.pos((double) p_180476_1_.getScaledWidth(), (double) p_180476_1_.getScaledHeight(), -90.0D)
			.tex(1.0D, 1.0D).endVertex();
	worldrenderer.pos((double) p_180476_1_.getScaledWidth(), 0.0D, -90.0D).tex(1.0D, 0.0D).endVertex();
	worldrenderer.pos(0.0D, 0.0D, -90.0D).tex(0.0D, 0.0D).endVertex();
	tessellator.draw();
	GlStateManager.depthMask(true);
	GlStateManager.enableDepth();
	GlStateManager.enableAlpha();
	GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:22,代码来源:GuiIngame.java

示例6: rotateAndBlurSkybox

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
/**
 * Rotate and blurs the skybox view in the main menu
 */
private void rotateAndBlurSkybox(float p_73968_1_)
{
    this.mc.getTextureManager().bindTexture(this.backgroundTexture);
    GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR);
    GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR);
    GL11.glCopyTexSubImage2D(GL11.GL_TEXTURE_2D, 0, 0, 0, 0, 0, 256, 256);
    GlStateManager.enableBlend();
    GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
    GlStateManager.colorMask(true, true, true, false);
    Tessellator tessellator = Tessellator.getInstance();
    WorldRenderer worldrenderer = tessellator.getWorldRenderer();
    worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
    GlStateManager.disableAlpha();
    int i = 3;

    for (int j = 0; j < i; ++j)
    {
        float f = 1.0F / (float)(j + 1);
        int k = this.width;
        int l = this.height;
        float f1 = (float)(j - i / 2) / 256.0F;
        worldrenderer.pos((double)k, (double)l, (double)this.zLevel).tex((double)(0.0F + f1), 1.0D).color(1.0F, 1.0F, 1.0F, f).endVertex();
        worldrenderer.pos((double)k, 0.0D, (double)this.zLevel).tex((double)(1.0F + f1), 1.0D).color(1.0F, 1.0F, 1.0F, f).endVertex();
        worldrenderer.pos(0.0D, 0.0D, (double)this.zLevel).tex((double)(1.0F + f1), 0.0D).color(1.0F, 1.0F, 1.0F, f).endVertex();
        worldrenderer.pos(0.0D, (double)l, (double)this.zLevel).tex((double)(0.0F + f1), 0.0D).color(1.0F, 1.0F, 1.0F, f).endVertex();
    }

    tessellator.draw();
    GlStateManager.enableAlpha();
    GlStateManager.colorMask(true, true, true, true);
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:35,代码来源:GuiMainMenu.java

示例7: func_180474_b

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
private void func_180474_b(float p_180474_1_, ScaledResolution p_180474_2_) {
	if (p_180474_1_ < 1.0F) {
		p_180474_1_ = p_180474_1_ * p_180474_1_;
		p_180474_1_ = p_180474_1_ * p_180474_1_;
		p_180474_1_ = p_180474_1_ * 0.8F + 0.2F;
	}

	GlStateManager.disableAlpha();
	GlStateManager.disableDepth();
	GlStateManager.depthMask(false);
	GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
	GlStateManager.color(1.0F, 1.0F, 1.0F, p_180474_1_);
	this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture);
	TextureAtlasSprite textureatlassprite = this.mc.getBlockRendererDispatcher().getBlockModelShapes()
			.getTexture(Blocks.portal.getDefaultState());
	float f = textureatlassprite.getMinU();
	float f1 = textureatlassprite.getMinV();
	float f2 = textureatlassprite.getMaxU();
	float f3 = textureatlassprite.getMaxV();
	Tessellator tessellator = Tessellator.getInstance();
	WorldRenderer worldrenderer = tessellator.getWorldRenderer();
	worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
	worldrenderer.pos(0.0D, (double) p_180474_2_.getScaledHeight(), -90.0D).tex((double) f, (double) f3)
			.endVertex();
	worldrenderer.pos((double) p_180474_2_.getScaledWidth(), (double) p_180474_2_.getScaledHeight(), -90.0D)
			.tex((double) f2, (double) f3).endVertex();
	worldrenderer.pos((double) p_180474_2_.getScaledWidth(), 0.0D, -90.0D).tex((double) f2, (double) f1)
			.endVertex();
	worldrenderer.pos(0.0D, 0.0D, -90.0D).tex((double) f, (double) f1).endVertex();
	tessellator.draw();
	GlStateManager.depthMask(true);
	GlStateManager.enableDepth();
	GlStateManager.enableAlpha();
	GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:36,代码来源:GuiIngame.java

示例8: renderTooltip

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
protected void renderTooltip(ScaledResolution sr, float partialTicks)
{
    if (this.mc.getRenderViewEntity() instanceof EntityPlayer)
    {
        GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
        this.mc.getTextureManager().bindTexture(widgetsTexPath);
        EntityPlayer entityplayer = (EntityPlayer)this.mc.getRenderViewEntity();
        int i = sr.getScaledWidth() / 2;
        float f = this.zLevel;
        this.zLevel = -90.0F;
        this.drawTexturedModalRect(i - 91, sr.getScaledHeight() - 22, 0, 0, 182, 22);
        this.drawTexturedModalRect(i - 91 - 1 + entityplayer.inventory.currentItem * 20, sr.getScaledHeight() - 22 - 1, 0, 22, 24, 22);
        this.zLevel = f;
        GlStateManager.enableRescaleNormal();
        GlStateManager.enableBlend();
        GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
        RenderHelper.enableGUIStandardItemLighting();

        for (int j = 0; j < 9; ++j)
        {
            int k = sr.getScaledWidth() / 2 - 90 + j * 20 + 2;
            int l = sr.getScaledHeight() - 16 - 3;
            this.renderHotbarItem(j, k, l, partialTicks, entityplayer);
        }

        RenderHelper.disableStandardItemLighting();
        GlStateManager.disableRescaleNormal();
        GlStateManager.disableBlend();
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:31,代码来源:GuiIngame.java

示例9: drawGradientRect

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
/**
 * Draws a rectangle with a vertical gradient between the specified colors (ARGB format). Args : x1, y1, x2, y2,
 * topColor, bottomColor
 */
protected void drawGradientRect(int left, int top, int right, int bottom, int startColor, int endColor)
{
    float f = (float)(startColor >> 24 & 255) / 255.0F;
    float f1 = (float)(startColor >> 16 & 255) / 255.0F;
    float f2 = (float)(startColor >> 8 & 255) / 255.0F;
    float f3 = (float)(startColor & 255) / 255.0F;
    float f4 = (float)(endColor >> 24 & 255) / 255.0F;
    float f5 = (float)(endColor >> 16 & 255) / 255.0F;
    float f6 = (float)(endColor >> 8 & 255) / 255.0F;
    float f7 = (float)(endColor & 255) / 255.0F;
    GlStateManager.disableTexture2D();
    GlStateManager.enableBlend();
    GlStateManager.disableAlpha();
    GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
    GlStateManager.shadeModel(7425);
    Tessellator tessellator = Tessellator.getInstance();
    VertexBuffer vertexbuffer = tessellator.getBuffer();
    vertexbuffer.begin(7, DefaultVertexFormats.POSITION_COLOR);
    vertexbuffer.pos((double)right, (double)top, (double)this.zLevel).color(f1, f2, f3, f).endVertex();
    vertexbuffer.pos((double)left, (double)top, (double)this.zLevel).color(f1, f2, f3, f).endVertex();
    vertexbuffer.pos((double)left, (double)bottom, (double)this.zLevel).color(f5, f6, f7, f4).endVertex();
    vertexbuffer.pos((double)right, (double)bottom, (double)this.zLevel).color(f5, f6, f7, f4).endVertex();
    tessellator.draw();
    GlStateManager.shadeModel(7424);
    GlStateManager.disableBlend();
    GlStateManager.enableAlpha();
    GlStateManager.enableTexture2D();
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:33,代码来源:Gui.java

示例10: drawLine

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public static void drawLine(Vec3d startPos, Vec3d endPos, int color, boolean smooth, float width) {
    Tessellator tessellator = Tessellator.getInstance();
    BufferBuilder BufferBuilder = tessellator.getBuffer();

    Vec3d endVecPos = endPos.subtract(startPos);

    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;

    if(smooth)
        GL11.glEnable(GL11.GL_LINE_SMOOTH);

    GL11.glLineWidth(width);

    GlStateManager.pushMatrix();
    GlStateManager.translate(startPos.x, startPos.y, startPos.z);
    GlStateManager.disableTexture2D();
    GlStateManager.enableBlend();
    GlStateManager.disableAlpha();
    GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
    GlStateManager.shadeModel(GL11.GL_SMOOTH);

    BufferBuilder.begin(GL11.GL_LINES, DefaultVertexFormats.POSITION_COLOR);
    BufferBuilder.pos(0, 0, 0).color(r, g, b, a).endVertex();
    BufferBuilder.pos(endVecPos.x, endVecPos.y, endVecPos.z).color(r, g, b, a).endVertex();
    tessellator.draw();

    if(smooth)
        GL11.glDisable(GL11.GL_LINE_SMOOTH);

    GlStateManager.shadeModel(GL11.GL_FLAT);
    GlStateManager.disableBlend();
    GlStateManager.enableAlpha();
    GlStateManager.enableTexture2D();
    GlStateManager.enableDepth();
    GlStateManager.enableCull();
    GlStateManager.popMatrix();
}
 
开发者ID:fr1kin,项目名称:ForgeHax,代码行数:41,代码来源:RenderUtils.java

示例11: drawGradientRect

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public static void drawGradientRect(int zLevel, int left, int top, int right, int bottom, int startColor, int endColor)
{
    float startAlpha = (float)(startColor >> 24 & 255) / 255.0F;
    float startRed = (float)(startColor >> 16 & 255) / 255.0F;
    float startGreen = (float)(startColor >> 8 & 255) / 255.0F;
    float startBlue = (float)(startColor & 255) / 255.0F;
    float endAlpha = (float)(endColor >> 24 & 255) / 255.0F;
    float endRed = (float)(endColor >> 16 & 255) / 255.0F;
    float endGreen = (float)(endColor >> 8 & 255) / 255.0F;
    float endBlue = (float)(endColor & 255) / 255.0F;

    GlStateManager.disableTexture2D();
    GlStateManager.enableBlend();
    GlStateManager.disableAlpha();
    GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
    GlStateManager.shadeModel(7425);

    Tessellator tessellator = Tessellator.getInstance();
    VertexBuffer vertexbuffer = tessellator.getBuffer();
    vertexbuffer.begin(7, DefaultVertexFormats.POSITION_COLOR);
    vertexbuffer.pos(right, top, zLevel).color(startRed, startGreen, startBlue, startAlpha).endVertex();
    vertexbuffer.pos(left, top, zLevel).color(startRed, startGreen, startBlue, startAlpha).endVertex();
    vertexbuffer.pos(left, bottom, zLevel).color(endRed, endGreen, endBlue, endAlpha).endVertex();
    vertexbuffer.pos(right, bottom, zLevel).color(endRed, endGreen, endBlue, endAlpha).endVertex();
    tessellator.draw();

    GlStateManager.shadeModel(7424);
    GlStateManager.disableBlend();
    GlStateManager.enableAlpha();
    GlStateManager.enableTexture2D();
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:32,代码来源:GuiUtils.java

示例12: drawSlot

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
@Override
protected void drawSlot(int id, int x, int y, int var4, int var5, int var6,
	float partialTicks)
{
	Block block = blocks.get(id);
	ItemStack itemStack = new ItemStack(Item.getItemFromBlock(block));
	
	GlStateManager.enableRescaleNormal();
	GlStateManager.enableBlend();
	RenderHelper.enableGUIStandardItemLighting();
	GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
	
	if(itemStack.getItem() != null)
		try
		{
			mc.getRenderItem().renderItemAndEffectIntoGUI(itemStack, x + 4,
				y + 4);
		}catch(Exception e)
		{
			e.printStackTrace();
		}
	else
		mc.fontRendererObj.drawString("?", x + 10, y + 9, 10526880);
	mc.getRenderItem().renderItemOverlays(mc.fontRendererObj, itemStack,
		x + 4, y + 4);
	
	RenderHelper.disableStandardItemLighting();
	GlStateManager.disableRescaleNormal();
	GlStateManager.disableBlend();
	glDisable(GL_LIGHTING);
	
	mc.fontRendererObj
		.drawString(
			"Name: " + (itemStack.getItem() == null
				? block.getLocalizedName() : itemStack.getDisplayName()),
			x + 31, y + 3, 10526880);
	
	mc.fontRendererObj.drawString("ID: " + Block.getIdFromBlock(block),
		x + 31, y + 15, 10526880);
}
 
开发者ID:Wurst-Imperium,项目名称:Wurst-MC-1.12,代码行数:41,代码来源:GuiXRayBlocksList.java

示例13: func_148109_a

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public void func_148109_a()
{
    if (!this.equals(field_148118_a))
    {
        if (field_148118_a == null || this.field_148119_h != field_148118_a.func_148111_b())
        {
            field_148118_a = this;

            if (this.field_148119_h)
            {
                GlStateManager.disableBlend();
                return;
            }

            GlStateManager.enableBlend();
        }

        GL14.glBlendEquation(this.field_148112_f);

        if (this.field_148113_g)
        {
            GlStateManager.tryBlendFuncSeparate(this.field_148116_b, this.field_148114_d, this.field_148117_c, this.field_148115_e);
        }
        else
        {
            GlStateManager.blendFunc(this.field_148116_b, this.field_148114_d);
        }
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:30,代码来源:JsonBlendingMode.java

示例14: drawRect

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
/**
 * Draws a solid color rectangle with the specified coordinates and color (ARGB format). Args: x1, y1, x2, y2, color
 */
public static void drawRect(int left, int top, int right, int bottom, int color)
{
    if (left < right)
    {
        int i = left;
        left = right;
        right = i;
    }

    if (top < bottom)
    {
        int j = top;
        top = bottom;
        bottom = j;
    }

    float f3 = (float)(color >> 24 & 255) / 255.0F;
    float f = (float)(color >> 16 & 255) / 255.0F;
    float f1 = (float)(color >> 8 & 255) / 255.0F;
    float f2 = (float)(color & 255) / 255.0F;
    Tessellator tessellator = Tessellator.getInstance();
    WorldRenderer worldrenderer = tessellator.getWorldRenderer();
    GlStateManager.enableBlend();
    GlStateManager.disableTexture2D();
    GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
    GlStateManager.color(f, f1, f2, f3);
    worldrenderer.begin(7, DefaultVertexFormats.POSITION);
    worldrenderer.pos((double)left, (double)bottom, 0.0D).endVertex();
    worldrenderer.pos((double)right, (double)bottom, 0.0D).endVertex();
    worldrenderer.pos((double)right, (double)top, 0.0D).endVertex();
    worldrenderer.pos((double)left, (double)top, 0.0D).endVertex();
    tessellator.draw();
    GlStateManager.enableTexture2D();
    GlStateManager.disableBlend();
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:39,代码来源:Gui.java

示例15: 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:Notoh,项目名称:DecompiledMinecraft,代码行数:73,代码来源:GuiSimpleScrolledSelectionListProxy.java


注:本文中的net.minecraft.client.renderer.GlStateManager.tryBlendFuncSeparate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。