RenderUtils.java 文件源码

java
阅读 26 收藏 0 点赞 0 评论 0

项目:Machines-and-Stuff 作者:
public static void drawLine(double x, double y, double x2, double y2, float red, float green, float blue, float lineWidth, float fadeSpeed) {
    int count = FMLClientHandler.instance().getClient().player.ticksExisted;
    float alpha = fadeSpeed + 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, 771);
    buff.begin(3, DefaultVertexFormats.POSITION_COLOR);
    buff.pos(x, y, 0).color(red, green, blue, alpha).endVertex();
    buff.pos(x2, y2, 0).color(red, green, blue, alpha).endVertex();
    tess.draw();

    GL11.glBlendFunc(770, 771);
    GL11.glDisable(32826);
    GL11.glDisable(3042);
    GL11.glEnable(3553);
    GL11.glPopMatrix();
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号