本文整理汇总了Java中org.lwjgl.opengl.GL11.glColor4d方法的典型用法代码示例。如果您正苦于以下问题:Java GL11.glColor4d方法的具体用法?Java GL11.glColor4d怎么用?Java GL11.glColor4d使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.lwjgl.opengl.GL11
的用法示例。
在下文中一共展示了GL11.glColor4d方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: searchBox
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void searchBox(BlockPos blockPos) {
double x = blockPos.getX() - Minecraft.getMinecraft().getRenderManager().renderPosX;
double y = blockPos.getY() - Minecraft.getMinecraft().getRenderManager().renderPosY;
double z = blockPos.getZ() - Minecraft.getMinecraft().getRenderManager().renderPosZ;
GL11.glBlendFunc(770, 771);
GL11.glEnable(GL_BLEND);
GL11.glLineWidth(1.0F);
float sinus = 1F - MathHelper
.abs(MathHelper.sin(Minecraft.getSystemTime() % 10000L / 10000.0F * (float) Math.PI * 4.0F) * 1F);
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glDisable(GL_DEPTH_TEST);
GL11.glDepthMask(false);
GL11.glColor4f(1F - sinus, sinus, 0F, 0.15F);
drawColorBox(new AxisAlignedBB(x, y, z, x + 1.0, y + 1.0, z + 1.0), 1F - sinus, sinus, 0F, 0.15F);
GL11.glColor4d(0, 0, 0, 0.5);
drawSelectionBoundingBox(new AxisAlignedBB(x, y, z, x + 1.0, y + 1.0, z + 1.0));
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glEnable(GL_DEPTH_TEST);
GL11.glDepthMask(true);
GL11.glDisable(GL_BLEND);
}
示例2: blockEsp
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
/**
* Renders an ESP box with the size of a normal block at the specified
* BlockPos.
*/
public static void blockEsp(BlockPos blockPos, Color c, double length, double length2) {
double x = blockPos.getX() - Minecraft.getMinecraft().getRenderManager().renderPosX;
double y = blockPos.getY() - Minecraft.getMinecraft().getRenderManager().renderPosY;
double z = blockPos.getZ() - Minecraft.getMinecraft().getRenderManager().renderPosZ;
GL11.glPushMatrix();
GL11.glBlendFunc(770, 771);
GL11.glEnable(GL_BLEND);
GL11.glLineWidth(2.0F);
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glDisable(GL_DEPTH_TEST);
GL11.glDepthMask(false);
GL11.glColor4d(c.getRed() / 255f, c.getGreen() / 255f, c.getBlue() / 255f, 0.25);
drawColorBox(new AxisAlignedBB(x, y, z, x + length2, y + 1.0, z + length), 0F, 0F, 0F, 0F);
GL11.glColor4d(0, 0, 0, 0.5);
drawSelectionBoundingBox(new AxisAlignedBB(x, y, z, x + length2, y + 1.0, z + length));
GL11.glLineWidth(2.0F);
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glEnable(GL_DEPTH_TEST);
GL11.glDepthMask(true);
GL11.glDisable(GL_BLEND);
GL11.glPopMatrix();
}
示例3: emptyBlockESPBox
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void emptyBlockESPBox(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(2.0F);
GL11.glDisable(3553);
GL11.glDisable(2929);
GL11.glDepthMask(false);
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);
}
示例4: drawLogoutESP
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void drawLogoutESP(double d, double d1, double d2, double r, double b, double g)
{
GL11.glPushMatrix();
GL11.glEnable(3042);
GL11.glBlendFunc(770, 771);
GL11.glLineWidth(1.5F);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glLineWidth(1.0F);
GL11.glEnable(GL11.GL_LINE_SMOOTH);
GL11.glDisable(2929);
GL11.glDepthMask(false);
GL11.glColor4d(r, g, b, 0.1825F);
drawBoundingBox(new AxisAlignedBB(d, d1, d2, d + 1.0, d1 + 2.0, d2 + 1.0));
GL11.glColor4d(r, g, b, 1.0F);
drawOutlinedBoundingBox(new AxisAlignedBB(d, d1, d2, d + 1.0, d1 + 2.0, d2 + 1.0));
GL11.glLineWidth(2.0F);
GL11.glDisable(GL11.GL_LINE_SMOOTH);
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glEnable(2929);
GL11.glDepthMask(true);
GL11.glDisable(3042);
GL11.glPopMatrix();
}
示例5: blockESPBox
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void blockESPBox(IBlockPos IBlockPos, Color c) {
RenderUtils.fixDarkLight();
GlStateManager.resetColor();
float red = c.getRed(), green = c.getGreen(), blue = c.getBlue();
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);
GL11.glDisable(3553);
GL11.glDisable(2929);
GL11.glDepthMask(false);
GL11.glColor4f(red, green, blue, 0.15F);
drawColorBox(new AxisAlignedBB(x, y, z, x + 1.0D, y + 1.0D, z + 1.0D), 0.0F, 1.0F, 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);
GlStateManager.resetColor();
}
示例6: emptyBlockESPBox
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void emptyBlockESPBox(BlockPos blockPos) {
double x = blockPos.getX() - Minecraft.getMinecraft().getRenderManager().renderPosX;
double y = blockPos.getY() - Minecraft.getMinecraft().getRenderManager().renderPosY;
double z = blockPos.getZ() - Minecraft.getMinecraft().getRenderManager().renderPosZ;
GL11.glBlendFunc(770, 771);
GL11.glEnable(GL_BLEND);
GL11.glLineWidth(2.0F);
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glDisable(GL_DEPTH_TEST);
GL11.glDepthMask(false);
GL11.glColor4d(0, 0, 0, 0.5F);
drawSelectionBoundingBox(new AxisAlignedBB(x, y, z, x + 1.0, y + 1.0, z + 1.0));
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glEnable(GL_DEPTH_TEST);
GL11.glDepthMask(true);
GL11.glDisable(GL_BLEND);
}
示例7: drawPlusAndMinus
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
private void drawPlusAndMinus() {
double scale = 0.05D;
GL11.glPushMatrix();
GL11.glTranslated(0.26D, 13.95D / 16D, 0);
GL11.glRotated(90, 1, 0, 0);
GL11.glScaled(scale, scale, scale);
GL11.glColor4d(0, 1, 0, 1);
Tessellator tessellator = Tessellator.getInstance();
BufferBuilder bufferBuilder = tessellator.getBuffer();
bufferBuilder.begin(GL11.GL_LINES, DefaultVertexFormats.POSITION);
bufferBuilder.pos(-1, 0, 0).endVertex();
bufferBuilder.pos(1, 0, 0).endVertex();
bufferBuilder.pos(0, -1, 0).endVertex();
bufferBuilder.pos(0, 1, 0).endVertex();
tessellator.draw();
GL11.glTranslated(-0.52D / scale, 0, 0);
GL11.glColor4d(1, 0, 0, 1);
bufferBuilder.begin(GL11.GL_LINES, DefaultVertexFormats.POSITION);
bufferBuilder.pos(-1, 0, 0).endVertex();
bufferBuilder.pos(1, 0, 0).endVertex();
tessellator.draw();
GL11.glColor4d(1, 1, 1, 1);
GL11.glPopMatrix();
}
示例8: render
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
@Override
public void render(int mouseX, int mouseY, float partialTick) {
GL11.glColor4d(1, 1, 1, 1);
if (!Mouse.isButtonDown(0)) dragging = false;
if (!wasClicking && Mouse.isButtonDown(0) && getBounds().contains(mouseX, mouseY)) {
dragging = true;
}
if (!enabled) dragging = false;
wasClicking = Mouse.isButtonDown(0);
if (dragging) currentScroll = (float) (mouseY - 7 - getBounds().y) / (getBounds().height - 17);
currentScroll = MathHelper.clamp(currentScroll, 0, 1);
Minecraft.getMinecraft().getTextureManager().bindTexture(scrollTexture);
Gui.drawModalRectWithCustomSizedTexture(x, y, 12, 0, getBounds().width, 1, 26, 15);
for (int i = 0; i < getBounds().height - 2; i++)
Gui.drawModalRectWithCustomSizedTexture(x, y + 1 + i, 12, 1, getBounds().width, 1, 26, 15);
Gui.drawModalRectWithCustomSizedTexture(x, y + getBounds().height - 1, 12, 14, getBounds().width, 1, 26, 15);
if (!enabled) GL11.glColor4d(0.6, 0.6, 0.6, 1);
Gui.drawModalRectWithCustomSizedTexture(x + 1, y + 1 + (int) ((getBounds().height - 17) * currentScroll), 0, 0, 12, 15, 26, 15);
GL11.glColor4d(1, 1, 1, 1);
}
示例9: blockEspBox
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void blockEspBox(IBlockPos IBlockPos, double red, double green, double blue) {
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(GL_BLEND);
GL11.glLineWidth(2.0F);
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glDisable(GL_DEPTH_TEST);
GL11.glDepthMask(false);
GL11.glColor4d(red, green, blue, 0.15F);
drawColorBox(new AxisAlignedBB(x, y, z, x + 1.0, y + 1.0, z + 1.0), 0F, 0F, 0F, 0F);
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glEnable(GL_DEPTH_TEST);
GL11.glDepthMask(true);
GL11.glDisable(GL_BLEND);
}
示例10: renderVortex
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
private void renderVortex(EntityVortex entity, double x, double y, double z, float var1, float partialTicks) {
int circlePoints = 200;
double radius = 0.5D;
GL11.glPushMatrix();
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glColor4d(0.8, 0.8, 0.8D, 0.7D);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glTranslatef((float) x, (float) y, (float) z);
GL11.glRotatef(entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * partialTicks, 0.0F, 0.0F, 1.0F);
GL11.glRotatef(entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) * partialTicks, 0.0F, 1.0F, 0.0F);
for (int i = 0; i < circlePoints; i++) {
float angleRadians = (float) i / (float) circlePoints * 2F * (float) Math.PI;
GL11.glPushMatrix();
GL11.glTranslated(radius * Math.sin(angleRadians), radius * Math.cos(angleRadians), 0);
renderGust();
GL11.glPopMatrix();
}
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glPopMatrix();
}
示例11: entityESPBox
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void entityESPBox(Entity entity, int mode) {
RenderUtils.fixDarkLight();
GlStateManager.resetColor();
GL11.glBlendFunc(770, 771);
GL11.glEnable(3042);
GL11.glLineWidth(2.0F);
GL11.glDisable(3553);
GL11.glDisable(2929);
GL11.glDepthMask(false);
if (mode == 0) {
GL11.glColor4d(1.0F - Minecraft.getMinecraft().player.getDistanceToEntity(entity) / 40.0F,
Minecraft.getMinecraft().player.getDistanceToEntity(entity) / 40.0F, 0.0D, 0.5D);
} else if (mode == 1) {
GL11.glColor4d(0.0D, 0.0D, 1.0D, 0.5D);
} else if (mode == 2) {
GL11.glColor4d(1.0D, 1.0D, 0.0D, 0.5D);
} else if (mode == 3) {
GL11.glColor4d(1.0D, 0.0D, 0.0D, 0.5D);
} else if (mode == 4) {
GL11.glColor4d(0.0D, 1.0D, 0.0D, 0.5D);
}
RenderManager renderManager = Minecraft.getMinecraft().getRenderManager();
drawSelectionBoundingBox(new AxisAlignedBB(
entity.boundingBox.minX - 0.05D - entity.posX + (entity.posX - renderManager.renderPosX),
entity.boundingBox.minY - entity.posY + (entity.posY - renderManager.renderPosY),
entity.boundingBox.minZ - 0.05D - entity.posZ + (entity.posZ - renderManager.renderPosZ),
entity.boundingBox.maxX + 0.05D - entity.posX + (entity.posX - renderManager.renderPosX),
entity.boundingBox.maxY + 0.1D - entity.posY + (entity.posY - renderManager.renderPosY),
entity.boundingBox.maxZ + 0.05D - entity.posZ + (entity.posZ - renderManager.renderPosZ)));
GL11.glEnable(3553);
GL11.glEnable(2929);
GL11.glDepthMask(true);
GL11.glDisable(3042);
}
示例12: renderAir
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
private void renderAir() {
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glColor4d(1, 1, 1, 1);
GL11.glLineWidth(2.0F);
int particles = 10;
for (int i = 0; i < particles; i++) {
renderAirParticle(te.renderAirProgress % (1F / particles) + (float) i / particles);
}
GL11.glEnable(GL11.GL_TEXTURE_2D);
}
示例13: onRenderHand
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
@Inject(method = "renderHand(FI)V", at = @At("HEAD"), cancellable = true)
public void onRenderHand(float partialTicks, int xOffset, CallbackInfo callbackInfo) {
if (isShadowPass != null) {
try {
isShadowPass.setBoolean(null, false);
} catch (IllegalAccessException ignored) {
}
}
GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
GL11.glPushMatrix();
EventManager.post(new RenderWorld(partialTicks));
GL11.glColor4d(1, 1, 1, 1);
if (mc.gameSettings.viewBobbing) {
mc.gameSettings.viewBobbing = false;
GL11.glPushMatrix();
setupCameraTransform(partialTicks, 2);
EventManager.post(new RenderWorldBobbing(partialTicks));
setupCameraTransform(partialTicks, 2);
GL11.glPopMatrix();
mc.gameSettings.viewBobbing = true;
} else {
EventManager.post(new RenderWorldBobbing(partialTicks));
}
GL11.glColor4d(1, 1, 1, 1);
GL11.glPopMatrix();
GL11.glPopAttrib();
if (EventManager.post(new RenderHand()).isCancelled()) {
callbackInfo.cancel();
}
}
示例14: render2D
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
private void render2D(float partialTicks) {
Minecraft minecraft = FMLClientHandler.instance().getClient();
EntityPlayer player = minecraft.player;
ItemStack helmetStack = player.getItemStackFromSlot(EntityEquipmentSlot.HEAD);
if (minecraft.inGameHasFocus && helmetStack.getItem() == Itemss.PNEUMATIC_HELMET) {
ScaledResolution sr = new ScaledResolution(minecraft);
GL11.glDepthMask(false);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glPushMatrix();
GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT);
GL11.glColor4d(0, 1, 0, 0.8D);
CommonHUDHandler comHudHandler = CommonHUDHandler.getHandlerForPlayer(player);
if (comHudHandler.ticksExisted <= comHudHandler.getStartupTime()) {
// blockTrackInfo = null;
gaveEmptyWarning = false;
gaveNearlyEmptyWarning = false;
RenderProgressBar.render(sr.getScaledWidth() / 2, 10, sr.getScaledWidth() - 10, 30, -90F, comHudHandler.ticksExisted * 100 / comHudHandler.getStartupTime());
} else {
if (comHudHandler.helmetPressure < 0.05F && !gaveEmptyWarning) {
addMessage(new ArmorMessage("The helmet is out of air!", new ArrayList<String>(), 100, 0x70FF0000));
gaveEmptyWarning = true;
}
if (comHudHandler.helmetPressure > 0.2F && comHudHandler.helmetPressure < 0.5F && !gaveNearlyEmptyWarning) {
addMessage(new ArmorMessage("The helmet almost out of air!", new ArrayList<String>(), 60, 0x70FF0000));
gaveNearlyEmptyWarning = true;
}
if (GuiKeybindCheckBox.trackedCheckboxes.get("pneumaticHelmet.upgrade.coreComponents").checked) {
for (int i = 0; i < UpgradeRenderHandlerList.instance().upgradeRenderers.size(); i++) {
IUpgradeRenderHandler upgradeRenderHandler = UpgradeRenderHandlerList.instance().upgradeRenderers.get(i);
if (comHudHandler.upgradeRenderersInserted[i] && GuiKeybindCheckBox.trackedCheckboxes.get("pneumaticHelmet.upgrade." + upgradeRenderHandler.getUpgradeName()).checked) {
IGuiAnimatedStat stat = upgradeRenderHandler.getAnimatedStat();
if (stat != null) {
stat.render(-1, -1, partialTicks);
}
upgradeRenderHandler.render2D(partialTicks, comHudHandler.helmetPressure > 0F);
}
}
}
}
// render every item in the list.
for (ArmorMessage message : messageList) {
message.renderMessage(minecraft.fontRenderer, partialTicks);
}
GL11.glPopMatrix();
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glDepthMask(true);
GL11.glEnable(GL11.GL_TEXTURE_2D);
if (comHudHandler.ticksExisted <= comHudHandler.getStartupTime())
minecraft.fontRenderer.drawString(CommonHUDHandler.getHandlerForPlayer().ticksExisted * 100 / comHudHandler.getStartupTime() + "%", sr.getScaledWidth() * 3 / 4 - 8, 16, 0x000000);
} else if (helmetStack.isEmpty()) {
messageList.clear();
}
}
示例15: glColor
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void glColor(int dec, double alpha) {
int[] c = getRGBFromDecimal(dec);
GL11.glColor4d(c[0] / 255D, c[1] / 255D, c[2] / 255D, alpha);
}