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


Java GL11.glLineWidth方法代码示例

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


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

示例1: drawLine

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void drawLine(double x, double y, double z, double x2, double y2, double z2, float red, float green, float blue, float lineWidth, float fadeSpeed) {
    int count = FMLClientHandler.instance().getClient().player.ticksExisted;
    float alpha = 0.3F + MathHelper.sin((float) (count + x)) * 0.3F + 0.3F;
    
    Tessellator tess = Tessellator.getInstance();
    VertexBuffer buff = tess.getBuffer();
    GL11.glPushMatrix();
    GL11.glLineWidth(lineWidth);
    GL11.glDisable(3553);
    GL11.glBlendFunc(770, 1);
    buff.begin(3, DefaultVertexFormats.POSITION_COLOR);
    buff.pos(x, y, z).color(red, green, blue, alpha).endVertex();
    buff.pos(x2, y2, z2).color(red, green, blue, alpha).endVertex();
    tess.draw();
    GL11.glBlendFunc(770, 771);
    GL11.glDisable(32826);
    GL11.glDisable(3042);
    GL11.glEnable(3553);
    GL11.glPopMatrix();
}
 
开发者ID:jaredlll08,项目名称:Machines-and-Stuff,代码行数:21,代码来源:RenderUtils.java

示例2: drawBorderedRectReliant

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void drawBorderedRectReliant(float x, float y, float x1, float y1, float lineWidth, int inside, int border) {
	GlStateManager.enableBlend();
    GlStateManager.disableTexture2D();
    GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
    RenderUtils.drawRect(x, y, x1, y1, inside);
    RenderUtils.glColor(border);
    GL11.glEnable((int)3042);
    GL11.glDisable((int)3553);
    GL11.glBlendFunc((int)770, (int)771);
    GL11.glLineWidth((float)lineWidth);
    GL11.glBegin((int)3);
    GL11.glVertex2f((float)x, (float)y);
    GL11.glVertex2f((float)x, (float)y1);
    GL11.glVertex2f((float)x1, (float)y1);
    GL11.glVertex2f((float)x1, (float)y);
    GL11.glVertex2f((float)x, (float)y);
    GL11.glEnd();
    GL11.glEnable((int)3553);
    GL11.glDisable((int)3042);
    GlStateManager.enableTexture2D();
    GlStateManager.disableBlend();
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:23,代码来源:RenderUtils.java

示例3: box

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
/**
 * Renders a box with any size and any color.
 *
 * @param x
 * @param y
 * @param z
 * @param x2
 * @param y2
 * @param z2
 * @param color
 */
public static void box(double x, double y, double z, double x2, double y2, double z2, float red, float green,
		float blue, float alpha) {
	x = x - Minecraft.getMinecraft().getRenderManager().renderPosX;
	y = y - Minecraft.getMinecraft().getRenderManager().renderPosY;
	z = z - Minecraft.getMinecraft().getRenderManager().renderPosZ;
	x2 = x2 - Minecraft.getMinecraft().getRenderManager().renderPosX;
	y2 = y2 - Minecraft.getMinecraft().getRenderManager().renderPosY;
	z2 = z2 - 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.glDepthMask(false);
	GL11.glColor4f(red, green, blue, alpha);
	drawColorBox(new AxisAlignedBB(x, y, z, x2, y2, z2), red, green, blue, alpha);
	GL11.glColor4d(0, 0, 0, 0.5F);
	drawSelectionBoundingBox(new AxisAlignedBB(x, y, z, x2, y2, z2));
	GL11.glEnable(GL11.GL_TEXTURE_2D);
	GL11.glEnable(GL_DEPTH_TEST);
	GL11.glDepthMask(true);
	GL11.glDisable(GL_BLEND);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:36,代码来源:RenderUtils.java

示例4: frame

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void frame(double x, double y, double z, double x2, double y2, double z2, Color color) {
	x -= Minecraft.getMinecraft().getRenderManager().renderPosX;
	y -= Minecraft.getMinecraft().getRenderManager().renderPosY;
	z -= Minecraft.getMinecraft().getRenderManager().renderPosZ;
	x2 -= Minecraft.getMinecraft().getRenderManager().renderPosX;
	y2 -= Minecraft.getMinecraft().getRenderManager().renderPosY;
	z2 -= Minecraft.getMinecraft().getRenderManager().renderPosZ;
	GL11.glBlendFunc(770, 771);
	GL11.glEnable(3042);
	GL11.glLineWidth(2.0F);
	GL11.glDisable(3553);
	GL11.glDisable(2929);
	GL11.glDepthMask(false);
	glColor(color);
	drawSelectionBoundingBox(new AxisAlignedBB(x, y, z, x2, y2, z2));
	GL11.glEnable(3553);
	GL11.glEnable(2929);
	GL11.glDepthMask(true);
	GL11.glDisable(3042);
}
 
开发者ID:Moudoux,项目名称:EMC,代码行数:21,代码来源:RenderUtils.java

示例5: drawLine

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
protected void drawLine(Vec3d p1, Vec3d p2, int colour, float alpha, float width)
{
	GL11.glPushMatrix();
	GL11.glEnable(GL11.GL_BLEND);
	GL11.glDisable(GL11.GL_DEPTH_TEST);
	float[] rgb = MathHelper.intToRGB(colour);
	GL11.glColor4f(rgb[0], rgb[1], rgb[2], alpha);
	GL11.glLineWidth(width);
	GL11.glDisable(GL11.GL_TEXTURE_2D);
	GL11.glBegin(GL11.GL_LINE_LOOP);
	GL11.glVertex3d(p1.x,p1.y,p1.z);
	GL11.glVertex3d(p2.x,p2.y,p2.z);
	GL11.glEnd();
	GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
	GL11.glEnable(GL11.GL_DEPTH_TEST);
	GL11.glEnable(GL11.GL_TEXTURE_2D);
	GL11.glDisable(GL11.GL_BLEND);
	GL11.glPopMatrix();
}
 
开发者ID:ObsidianSuite,项目名称:ObsidianSuite,代码行数:20,代码来源:GuiEntityRenderer.java

示例6: drawLine

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
/**
 * Draws a line from start to end with the given width.
 *
 * @param start The starting point of the line.
 * @param end   The ending point of the line.
 * @param width The thickness of the line.
 */
private void drawLine(Vector2f start, Vector2f end, float width) {
    // Disables textures so we can draw a solid line.
    GL11.glDisable(GL11.GL_TEXTURE_2D);

    // Sets the width.
    GL11.glLineWidth(width);

    // Begins drawing the line.
    GL11.glBegin(GL11.GL_LINES); {
        GL11.glVertex2f(start.x, start.y);
        GL11.glVertex2f(end.x, end.y);
    }
    // Ends drawing the line.
    GL11.glEnd();

    // Enables texturing back on.
    GL11.glEnable(GL11.GL_TEXTURE_2D);
}
 
开发者ID:SerenityEnterprises,项目名称:SerenityCE,代码行数:26,代码来源:TTFFontRenderer.java

示例7: framelessBlockESP

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void framelessBlockESP(IBlockPos IBlockPos, float red, float green, float blue) {
	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.glColor4f(red, green, blue, 0.15F);
	drawColorBox(new AxisAlignedBB(x, y, z, x + 1.0D, y + 1.0D, z + 1.0D), red, green, blue, 0.15F);
	GL11.glEnable(3553);
	GL11.glEnable(2929);
	GL11.glDepthMask(true);
	GL11.glDisable(3042);
	GlStateManager.resetColor();
}
 
开发者ID:Moudoux,项目名称:EMC,代码行数:21,代码来源:RenderUtils.java

示例8: renderWorldDirections

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
private void renderWorldDirections(float partialTicks)
{
    if (this.mc.gameSettings.showDebugInfo && !this.mc.gameSettings.hideGUI && !this.mc.thePlayer.hasReducedDebug() && !this.mc.gameSettings.reducedDebugInfo)
    {
        Entity entity = this.mc.getRenderViewEntity();
        GlStateManager.enableBlend();
        GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
        GL11.glLineWidth(1.0F);
        GlStateManager.disableTexture2D();
        GlStateManager.depthMask(false);
        GlStateManager.pushMatrix();
        GlStateManager.matrixMode(5888);
        GlStateManager.loadIdentity();
        this.orientCamera(partialTicks);
        GlStateManager.translate(0.0F, entity.getEyeHeight(), 0.0F);
        RenderGlobal.func_181563_a(new AxisAlignedBB(0.0D, 0.0D, 0.0D, 0.005D, 1.0E-4D, 1.0E-4D), 255, 0, 0, 255);
        RenderGlobal.func_181563_a(new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0E-4D, 1.0E-4D, 0.005D), 0, 0, 255, 255);
        RenderGlobal.func_181563_a(new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0E-4D, 0.0033D, 1.0E-4D), 0, 255, 0, 255);
        GlStateManager.popMatrix();
        GlStateManager.depthMask(true);
        GlStateManager.enableTexture2D();
        GlStateManager.disableBlend();
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:25,代码来源:EntityRenderer.java

示例9: render

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
@Override
public void render(float alpha)
{
    Vec2 pos = getPos();
    Vec2 radius = getRadius();
    
    GL11.glLineWidth(1.0f);
    float color = Main.instance().getFocus() == this ? 0.75f : 1.0f;
    GL11.glColor4f(color, color, 1.0f, alpha);
    font.render(text, pos, size, Alignment.C);
    
    GL11.glBegin(GL11.GL_LINE_LOOP);
    GL11.glVertex2f(pos.x - radius.x, pos.y - radius.y);
    GL11.glVertex2f(pos.x - radius.x, pos.y + radius.y);
    GL11.glVertex2f(pos.x + radius.x, pos.y + radius.y);
    GL11.glVertex2f(pos.x + radius.x, pos.y - radius.y);
    GL11.glEnd();
}
 
开发者ID:SmashMaster,项目名称:KraftigAudio,代码行数:19,代码来源:LabelButton.java

示例10: renderDirections

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void renderDirections(int p_188785_0_)
{
    GlStateManager.disableTexture2D();
    GlStateManager.depthMask(false);
    Tessellator tessellator = Tessellator.getInstance();
    VertexBuffer vertexbuffer = tessellator.getBuffer();
    GL11.glLineWidth(4.0F);
    vertexbuffer.begin(1, DefaultVertexFormats.POSITION_COLOR);
    vertexbuffer.pos(0.0D, 0.0D, 0.0D).color(0, 0, 0, 255).endVertex();
    vertexbuffer.pos((double)p_188785_0_, 0.0D, 0.0D).color(0, 0, 0, 255).endVertex();
    vertexbuffer.pos(0.0D, 0.0D, 0.0D).color(0, 0, 0, 255).endVertex();
    vertexbuffer.pos(0.0D, (double)p_188785_0_, 0.0D).color(0, 0, 0, 255).endVertex();
    vertexbuffer.pos(0.0D, 0.0D, 0.0D).color(0, 0, 0, 255).endVertex();
    vertexbuffer.pos(0.0D, 0.0D, (double)p_188785_0_).color(0, 0, 0, 255).endVertex();
    tessellator.draw();
    GL11.glLineWidth(2.0F);
    vertexbuffer.begin(1, DefaultVertexFormats.POSITION_COLOR);
    vertexbuffer.pos(0.0D, 0.0D, 0.0D).color(255, 0, 0, 255).endVertex();
    vertexbuffer.pos((double)p_188785_0_, 0.0D, 0.0D).color(255, 0, 0, 255).endVertex();
    vertexbuffer.pos(0.0D, 0.0D, 0.0D).color(0, 255, 0, 255).endVertex();
    vertexbuffer.pos(0.0D, (double)p_188785_0_, 0.0D).color(0, 255, 0, 255).endVertex();
    vertexbuffer.pos(0.0D, 0.0D, 0.0D).color(127, 127, 255, 255).endVertex();
    vertexbuffer.pos(0.0D, 0.0D, (double)p_188785_0_).color(127, 127, 255, 255).endVertex();
    tessellator.draw();
    GL11.glLineWidth(1.0F);
    GlStateManager.depthMask(true);
    GlStateManager.enableTexture2D();
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:29,代码来源:OpenGlHelper.java

示例11: 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);
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:12,代码来源:GuiChargingStation.java

示例12: render

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public void render(float alpha)
{
    GL11.glPushMatrix();
    
    if (top) GL11.glTranslatef(pos.x + radius.x - ARROW_BUTTON_RX, pos.y + radius.y - ARROW_BUTTON_RY, 0.0f);
    else GL11.glTranslatef(pos.x + radius.x - ARROW_BUTTON_RX, pos.y - radius.y + ARROW_BUTTON_RY, 0.0f);
    
    GL11.glLineWidth(1.0f);
    float color = Main.instance().getFocus() == this ? 0.75f : 1.0f;
    GL11.glColor4f(color, color, 1.0f, alpha);
    GL11.glBegin(GL11.GL_LINE_LOOP);
    GL11.glVertex2f(-ARROW_BUTTON_RX, -ARROW_BUTTON_RY);
    GL11.glVertex2f(-ARROW_BUTTON_RX, ARROW_BUTTON_RY);
    GL11.glVertex2f(ARROW_BUTTON_RX, ARROW_BUTTON_RY);
    GL11.glVertex2f(ARROW_BUTTON_RX, -ARROW_BUTTON_RY);
    GL11.glEnd();
    
    GL11.glBegin(GL11.GL_LINE_STRIP);
    if (top)
    {
        GL11.glVertex2f(-ARROW_RX, -ARROW_RY);
        GL11.glVertex2f(0.0f, ARROW_RY);
        GL11.glVertex2f(ARROW_RX, -ARROW_RY);
    }
    else
    {
        GL11.glVertex2f(-ARROW_RX, ARROW_RY);
        GL11.glVertex2f(0.0f, -ARROW_RY);
        GL11.glVertex2f(ARROW_RX, ARROW_RY);
    }
    GL11.glEnd();
    
    GL11.glPopMatrix();
}
 
开发者ID:SmashMaster,项目名称:KraftigAudio,代码行数:35,代码来源:ScrollBox.java

示例13: render

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
@Override
public void render(float alpha)
{
    Vec2 pos = getPos();
    Vec2 radius = getRadius();
    
    if (getValue())
    {
        GL11.glColor4f(1.0f, 1.0f, 1.0f, alpha*0.5f);
        GL11.glBegin(GL11.GL_QUADS);
        GL11.glVertex2f(pos.x - radius.x, pos.y - radius.y);
        GL11.glVertex2f(pos.x - radius.x, pos.y + radius.y);
        GL11.glVertex2f(pos.x + radius.x, pos.y + radius.y);
        GL11.glVertex2f(pos.x + radius.x, pos.y - radius.y);
        GL11.glEnd();
    }
    
    GL11.glLineWidth(1.0f);
    float color = Main.instance().getFocus() == this ? 0.75f : 1.0f;
    GL11.glColor4f(color, color, 1.0f, alpha);
    font.render(text, pos, size, Alignment.C);
    
    GL11.glBegin(GL11.GL_LINE_LOOP);
    GL11.glVertex2f(pos.x - radius.x, pos.y - radius.y);
    GL11.glVertex2f(pos.x - radius.x, pos.y + radius.y);
    GL11.glVertex2f(pos.x + radius.x, pos.y + radius.y);
    GL11.glVertex2f(pos.x + radius.x, pos.y - radius.y);
    GL11.glEnd();
}
 
开发者ID:SmashMaster,项目名称:KraftigAudio,代码行数:30,代码来源:ToggleLabelButton.java

示例14: drawLine

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
private void drawLine(double x, double y, double x1, double y1, float width)
{
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glLineWidth(width);
    GL11.glBegin(GL11.GL_LINES);
    GL11.glVertex2d(x, y);
    GL11.glVertex2d(x1, y1);
    GL11.glEnd();
    GL11.glEnable(GL11.GL_TEXTURE_2D);
}
 
开发者ID:fr1kin,项目名称:ForgeHax,代码行数:11,代码来源:MinecraftFontRenderer.java

示例15: drawSelectionBox

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
/**
 * Draws the selection box for the player. Args: entityPlayer, rayTraceHit, i, itemStack, partialTickTime
 */
public void drawSelectionBox(EntityPlayer player, MovingObjectPosition movingObjectPositionIn, int p_72731_3_, float partialTicks)
{
    if (p_72731_3_ == 0 && movingObjectPositionIn.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
    {
        GlStateManager.enableBlend();
        GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
        GlStateManager.color(0.0F, 0.0F, 0.0F, 0.4F);
        GL11.glLineWidth(2.0F);
        GlStateManager.disableTexture2D();
        GlStateManager.depthMask(false);
        float f = 0.002F;
        BlockPos blockpos = movingObjectPositionIn.getBlockPos();
        Block block = this.theWorld.getBlockState(blockpos).getBlock();

        if (block.getMaterial() != Material.air && this.theWorld.getWorldBorder().contains(blockpos))
        {
            block.setBlockBoundsBasedOnState(this.theWorld, blockpos);
            double d0 = player.lastTickPosX + (player.posX - player.lastTickPosX) * (double)partialTicks;
            double d1 = player.lastTickPosY + (player.posY - player.lastTickPosY) * (double)partialTicks;
            double d2 = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * (double)partialTicks;
            func_181561_a(block.getSelectedBoundingBox(this.theWorld, blockpos).expand(0.0020000000949949026D, 0.0020000000949949026D, 0.0020000000949949026D).offset(-d0, -d1, -d2));
        }

        GlStateManager.depthMask(true);
        GlStateManager.enableTexture2D();
        GlStateManager.disableBlend();
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:32,代码来源:RenderGlobal.java


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