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


Java GlStateManager类代码示例

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


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

示例1: doRenderLayer

import net.minecraft.client.renderer.GlStateManager; //导入依赖的package包/类
public void doRenderLayer(EntityEnderman 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)
{
    this.endermanRenderer.bindTexture(field_177203_a);
    GlStateManager.enableBlend();
    GlStateManager.disableAlpha();
    GlStateManager.blendFunc(1, 1);
    GlStateManager.disableLighting();
    GlStateManager.depthMask(!entitylivingbaseIn.isInvisible());
    int i = 61680;
    int j = i % 65536;
    int k = i / 65536;
    OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j / 1.0F, (float)k / 1.0F);
    GlStateManager.enableLighting();
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    this.endermanRenderer.getMainModel().render(entitylivingbaseIn, p_177141_2_, p_177141_3_, p_177141_5_, p_177141_6_, p_177141_7_, scale);
    this.endermanRenderer.func_177105_a(entitylivingbaseIn, partialTicks);
    GlStateManager.depthMask(true);
    GlStateManager.disableBlend();
    GlStateManager.enableAlpha();
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:21,代码来源:LayerEndermanEyes.java

示例2: applyTransformSide

import net.minecraft.client.renderer.GlStateManager; //导入依赖的package包/类
public static void applyTransformSide(ItemTransformVec3f vec, boolean leftHand)
{
    if (vec != ItemTransformVec3f.DEFAULT)
    {
        int i = leftHand ? -1 : 1;
        GlStateManager.translate((float)i * (offsetTranslateX + vec.translation.x), offsetTranslateY + vec.translation.y, offsetTranslateZ + vec.translation.z);
        float f = offsetRotationX + vec.rotation.x;
        float f1 = offsetRotationY + vec.rotation.y;
        float f2 = offsetRotationZ + vec.rotation.z;

        if (leftHand)
        {
            f1 = -f1;
            f2 = -f2;
        }

        GlStateManager.rotate(makeQuaternion(f, f1, f2));
        GlStateManager.scale(offsetScaleX + vec.scale.x, offsetScaleY + vec.scale.y, offsetScaleZ + vec.scale.z);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:21,代码来源:ItemCameraTransforms.java

示例3: doRender

import net.minecraft.client.renderer.GlStateManager; //导入依赖的package包/类
/**
 * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
 * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
 * (Render<T extends Entity>) and this method has signature public void doRender(T entity, double d, double d1,
 * double d2, float f, float f1). But JAD is pre 1.5 so doe
 */
public void doRender(EntityPainting entity, double x, double y, double z, float entityYaw, float partialTicks)
{
    GlStateManager.pushMatrix();
    GlStateManager.translate(x, y, z);
    GlStateManager.rotate(180.0F - entityYaw, 0.0F, 1.0F, 0.0F);
    GlStateManager.enableRescaleNormal();
    this.bindEntityTexture(entity);
    EntityPainting.EnumArt entitypainting$enumart = entity.art;
    float f = 0.0625F;
    GlStateManager.scale(f, f, f);
    this.renderPainting(entity, entitypainting$enumart.sizeX, entitypainting$enumart.sizeY, entitypainting$enumart.offsetX, entitypainting$enumart.offsetY);
    GlStateManager.disableRescaleNormal();
    GlStateManager.popMatrix();
    super.doRender(entity, x, y, z, entityYaw, partialTicks);
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:22,代码来源:RenderPainting.java

示例4: doRender

import net.minecraft.client.renderer.GlStateManager; //导入依赖的package包/类
/**
 * Renders the desired {@code T} type Entity.
 */
public void doRender(EntityBoat entity, double x, double y, double z, float entityYaw, float partialTicks)
{
    GlStateManager.pushMatrix();
    this.setupTranslation(x, y, z);
    this.setupRotation(entity, entityYaw, partialTicks);
    this.bindEntityTexture(entity);

    if (this.renderOutlines)
    {
        GlStateManager.enableColorMaterial();
        GlStateManager.enableOutlineMode(this.getTeamColor(entity));
    }

    this.modelBoat.render(entity, partialTicks, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);

    if (this.renderOutlines)
    {
        GlStateManager.disableOutlineMode();
        GlStateManager.disableColorMaterial();
    }

    GlStateManager.popMatrix();
    super.doRender(entity, x, y, z, entityYaw, partialTicks);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:28,代码来源:RenderBoat.java

示例5: doRender

import net.minecraft.client.renderer.GlStateManager; //导入依赖的package包/类
/**
 * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
 * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
 * (Render<T extends Entity>) and this method has signature public void doRender(T entity, double d, double d1,
 * double d2, float f, float f1). But JAD is pre 1.5 so doe
 */
public void doRender(EntityWitherSkull entity, double x, double y, double z, float entityYaw, float partialTicks)
{
    GlStateManager.pushMatrix();
    GlStateManager.disableCull();
    float f = this.func_82400_a(entity.prevRotationYaw, entity.rotationYaw, partialTicks);
    float f1 = entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * partialTicks;
    GlStateManager.translate((float)x, (float)y, (float)z);
    float f2 = 0.0625F;
    GlStateManager.enableRescaleNormal();
    GlStateManager.scale(-1.0F, -1.0F, 1.0F);
    GlStateManager.enableAlpha();
    this.bindEntityTexture(entity);
    this.skeletonHeadModel.render(entity, 0.0F, 0.0F, 0.0F, f, f1, f2);
    GlStateManager.popMatrix();
    super.doRender(entity, x, y, z, entityYaw, partialTicks);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:23,代码来源:RenderWitherSkull.java

示例6: func_175266_a

import net.minecraft.client.renderer.GlStateManager; //导入依赖的package包/类
private void func_175266_a(int p_175266_1_, int p_175266_2_, float p_175266_3_, float p_175266_4_, ISpectatorMenuObject p_175266_5_)
{
    this.field_175268_g.getTextureManager().bindTexture(field_175269_a);

    if (p_175266_5_ != SpectatorMenu.field_178657_a)
    {
        int i = (int)(p_175266_4_ * 255.0F);
        GlStateManager.pushMatrix();
        GlStateManager.translate((float)p_175266_2_, p_175266_3_, 0.0F);
        float f = p_175266_5_.func_178662_A_() ? 1.0F : 0.25F;
        GlStateManager.color(f, f, f, p_175266_4_);
        p_175266_5_.func_178663_a(f, i);
        GlStateManager.popMatrix();
        String s = String.valueOf((Object)GameSettings.getKeyDisplayString(this.field_175268_g.gameSettings.keyBindsHotbar[p_175266_1_].getKeyCode()));

        if (i > 3 && p_175266_5_.func_178662_A_())
        {
            this.field_175268_g.fontRendererObj.drawStringWithShadow(s, (float)(p_175266_2_ + 19 - 2 - this.field_175268_g.fontRendererObj.getStringWidth(s)), p_175266_3_ + 6.0F + 3.0F, 16777215 + (i << 24));
        }
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:22,代码来源:GuiSpectator.java

示例7: applyRotations

import net.minecraft.client.renderer.GlStateManager; //导入依赖的package包/类
@Override
protected void applyRotations(EntityEyeOfSchrodinger schrodinger, float p_77043_2_, float rotationYaw, float partialTicks) {
	GlStateManager.rotate(180F - rotationYaw, 0F, 1F, 0F);
	GlStateManager.rotate(-schrodinger.rotationPitch, 1F, 0F, 0.0F);

	if(schrodinger.deathTime > 0) {
		float f = ((float) schrodinger.deathTime + partialTicks - 1.0F) / 20.0F * 1.6F;
		f = MathHelper.sqrt(f);

		if(f > 1.0F) {
			f = 1.0F;
		}

		GlStateManager.rotate(f * this.getDeathMaxRotation(schrodinger), 0.0F, 0.0F, 1.0F);
	}
}
 
开发者ID:ArekkuusuJerii,项目名称:Solar,代码行数:17,代码来源:EyeOfSchrodingerRenderer.java

示例8: renderParchmentFirstPerson

import net.minecraft.client.renderer.GlStateManager; //导入依赖的package包/类
public static void renderParchmentFirstPerson(float pitch, float p_187463_2_, float p_187463_3_,
		ItemStack parchment)
{
	GlStateManager.pushMatrix();
	GlStateManager.pushAttrib();

	float f = MathHelper.sqrt(p_187463_3_);
	float f1 = -0.2F * MathHelper.sin(p_187463_3_ * (float) Math.PI);
	float f2 = -0.4F * MathHelper.sin(f * (float) Math.PI);
	GlStateManager.translate(0.0F, -f1 / 2.0F, f2);
	float f3 = Minecraft.getMinecraft().getItemRenderer().getMapAngleFromPitch(pitch);
	GlStateManager.translate(0.0F, 0.04F + p_187463_2_ * -1.2F + f3 * -0.5F, -0.72F);
	GlStateManager.rotate(f3 * -85.0F, 1.0F, 0.0F, 0.0F);
	Minecraft.getMinecraft().getItemRenderer().renderArms();
	float f4 = MathHelper.sin(f * (float) Math.PI);
	GlStateManager.rotate(f4 * 20.0F, 1.0F, 0.0F, 0.0F);
	GlStateManager.scale(2.0F, 2.0F, 2.0F);
	renderParchmentFirstPerson(parchment);

	GlStateManager.popAttrib();
	GlStateManager.popMatrix();
}
 
开发者ID:raphydaphy,项目名称:ArcaneMagic,代码行数:23,代码来源:GLHelper.java

示例9: drawBackground

import net.minecraft.client.renderer.GlStateManager; //导入依赖的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:Notoh,项目名称:DecompiledMinecraft,代码行数:20,代码来源:GuiScreen.java

示例10: doRenderLayer

import net.minecraft.client.renderer.GlStateManager; //导入依赖的package包/类
public void doRenderLayer(EntityEnderman entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
    this.endermanRenderer.bindTexture(RES_ENDERMAN_EYES);
    GlStateManager.enableBlend();
    GlStateManager.disableAlpha();
    GlStateManager.blendFunc(GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ONE);
    GlStateManager.disableLighting();
    GlStateManager.depthMask(!entitylivingbaseIn.isInvisible());
    int i = 61680;
    int j = 61680;
    int k = 0;
    OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 61680.0F, 0.0F);
    GlStateManager.enableLighting();
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    this.endermanRenderer.getMainModel().render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
    this.endermanRenderer.setLightmap(entitylivingbaseIn, partialTicks);
    GlStateManager.depthMask(true);
    GlStateManager.disableBlend();
    GlStateManager.enableAlpha();
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:21,代码来源:LayerEndermanEyes.java

示例11: preRenderCallback

import net.minecraft.client.renderer.GlStateManager; //导入依赖的package包/类
/**
 * Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args:
 * entityLiving, partialTickTime
 */
protected void preRenderCallback(EntityVillager entitylivingbaseIn, float partialTickTime)
{
    float f = 0.9375F;

    if (entitylivingbaseIn.getGrowingAge() < 0)
    {
        f = (float)((double)f * 0.5D);
        this.shadowSize = 0.25F;
    }
    else
    {
        this.shadowSize = 0.5F;
    }

    GlStateManager.scale(f, f, f);
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:21,代码来源:RenderVillager.java

示例12: render

import net.minecraft.client.renderer.GlStateManager; //导入依赖的package包/类
@Override
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
	if (stack.getMetadata() > 0) {
		Minecraft.getMinecraft().getTextureManager().bindTexture(LAYERS[Math.min(LAYERS.length - 1, 1 + stack.getMetadata())]);
		super.render(entityIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
		return;
	}

	for (int i = 0; i < 2; i++) {
		int color = PonySocks.sock.getColor(stack, i > 0);
		GlStateManager.color(
				(float) ((color >> 16) & 0xFF) / 255.0f,
				(float) ((color >> 8) & 0xFF) / 255.0f,
				(float) (color & 0xFF) / 255.0f,
				1.0f
		);
		Minecraft.getMinecraft().getTextureManager().bindTexture(LAYERS[i]);
		super.render(entityIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
	}
}
 
开发者ID:asiekierka,项目名称:PonySocks2,代码行数:21,代码来源:ModelArmorSockBiped.java

示例13: searchBox

import net.minecraft.client.renderer.GlStateManager; //导入依赖的package包/类
public static void searchBox(IBlockPos IBlockPos) {
	RenderUtils.fixDarkLight();
	GlStateManager.resetColor();
	double x = IBlockPos.getX() - Minecraft.getMinecraft().getRenderManager().renderPosX;
	double y = IBlockPos.getY() - Minecraft.getMinecraft().getRenderManager().renderPosY;
	double z = IBlockPos.getZ() - Minecraft.getMinecraft().getRenderManager().renderPosZ;
	GL11.glBlendFunc(770, 771);
	GL11.glEnable(3042);
	GL11.glLineWidth(1.0F);
	float sinus = 1.0F - MathHelper
			.abs(MathHelper.sin(Minecraft.getSystemTime() % 10000L / 10000.0F * 3.1415927F * 4.0F) * 1.0F);
	GL11.glDisable(3553);
	GL11.glDisable(2929);
	GL11.glDepthMask(false);
	GL11.glColor4f(1.0F - sinus, sinus, 0.0F, 0.15F);
	drawColorBox(new AxisAlignedBB(x, y, z, x + 1.0D, y + 1.0D, z + 1.0D), 1.0F - sinus, sinus, 0.0F, 0.15F);
	GL11.glColor4d(0.0D, 0.0D, 0.0D, 0.5D);
	drawSelectionBoundingBox(new AxisAlignedBB(x, y, z, x + 1.0D, y + 1.0D, z + 1.0D));
	GL11.glEnable(3553);
	GL11.glEnable(2929);
	GL11.glDepthMask(true);
	GL11.glDisable(3042);
}
 
开发者ID:Moudoux,项目名称:EMC,代码行数:24,代码来源:RenderUtils.java

示例14: mouseDragged

import net.minecraft.client.renderer.GlStateManager; //导入依赖的package包/类
protected void mouseDragged(Minecraft mc, int mouseX, int mouseY)
{
    if (this.visible)
    {
        if (this.field_146155_p)
        {
            this.field_146156_o = (float)(mouseX - (this.xPosition + 4)) / (float)(this.width - 8);
            this.field_146156_o = MathHelper.clamp_float(this.field_146156_o, 0.0F, 1.0F);
            mc.gameSettings.setSoundLevel(this.field_146153_r, this.field_146156_o);
            mc.gameSettings.saveOptions();
            this.displayString = this.field_146152_s + ": " + GuiScreenOptionsSounds.this.getSoundVolume(this.field_146153_r);
        }

        GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
        this.drawTexturedModalRect(this.xPosition + (int)(this.field_146156_o * (float)(this.width - 8)), this.yPosition, 0, 66, 4, 20);
        this.drawTexturedModalRect(this.xPosition + (int)(this.field_146156_o * (float)(this.width - 8)) + 4, this.yPosition, 196, 66, 4, 20);
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:19,代码来源:GuiScreenOptionsSounds.java

示例15: renderParticle

import net.minecraft.client.renderer.GlStateManager; //导入依赖的package包/类
/**
 * Renders the particle
 */
public void renderParticle(WorldRenderer worldRendererIn, Entity entityIn, float partialTicks, float p_180434_4_, float p_180434_5_, float p_180434_6_, float p_180434_7_, float p_180434_8_)
{
    float f = ((float)this.age + partialTicks) / (float)this.maxAge;
    f = f * f;
    double d0 = this.field_174840_a.posX;
    double d1 = this.field_174840_a.posY;
    double d2 = this.field_174840_a.posZ;
    double d3 = this.field_174843_ax.lastTickPosX + (this.field_174843_ax.posX - this.field_174843_ax.lastTickPosX) * (double)partialTicks;
    double d4 = this.field_174843_ax.lastTickPosY + (this.field_174843_ax.posY - this.field_174843_ax.lastTickPosY) * (double)partialTicks + (double)this.field_174841_aA;
    double d5 = this.field_174843_ax.lastTickPosZ + (this.field_174843_ax.posZ - this.field_174843_ax.lastTickPosZ) * (double)partialTicks;
    double d6 = d0 + (d3 - d0) * (double)f;
    double d7 = d1 + (d4 - d1) * (double)f;
    double d8 = d2 + (d5 - d2) * (double)f;
    int i = this.getBrightnessForRender(partialTicks);
    int j = i % 65536;
    int k = i / 65536;
    OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j / 1.0F, (float)k / 1.0F);
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    d6 = d6 - interpPosX;
    d7 = d7 - interpPosY;
    d8 = d8 - interpPosZ;
    this.field_174842_aB.renderEntityWithPosYaw(this.field_174840_a, (double)((float)d6), (double)((float)d7), (double)((float)d8), this.field_174840_a.rotationYaw, partialTicks);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:27,代码来源:EntityPickupFX.java


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