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


Java GL11.glBlendFunc方法代码示例

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


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

示例1: frame

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
/**
 * Renders a frame with any size and any color.
 *
 * @param x
 * @param y
 * @param z
 * @param x2
 * @param y2
 * @param z2
 * @param color
 */
public static void frame(double x, double y, double z, double x2, double y2, double z2, Color color) {
	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);
	setColor(color);
	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,代码行数:32,代码来源:RenderUtils.java

示例2: box

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
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 -= 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);
	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.0D, 0.0D, 0.0D, 0.5D);
	drawSelectionBoundingBox(new AxisAlignedBB(x, y, z, x2, y2, z2));
	GL11.glEnable(3553);
	GL11.glEnable(2929);
	GL11.glDepthMask(true);
	GL11.glDisable(3042);
	GlStateManager.resetColor();
}
 
开发者ID:Moudoux,项目名称:EMC,代码行数:26,代码来源:RenderUtils.java

示例3: blockESPBox

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void blockESPBox(IBlockPos IBlockPos) {
	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.glColor4d(0.0D, 1.0D, 0.0D, 0.26000000596046448D);
	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);
}
 
开发者ID:Moudoux,项目名称:EMC,代码行数:20,代码来源:RenderUtils.java

示例4: 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

示例5: drawBorderedRect

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void drawBorderedRect(float x, float y, float x2, float y2, float l1, Color c, Color c2) {
	drawRect(x, y, x2, y2, c2);
	GL11.glEnable(3042);
	GL11.glDisable(3553);
	GL11.glBlendFunc(770, 771);
	GL11.glEnable(2848);
	GL11.glPushMatrix();
	glColor(c);
	GL11.glLineWidth(l1);
	GL11.glBegin(1);
	GL11.glVertex2d(x, y);
	GL11.glVertex2d(x, y2);
	GL11.glVertex2d(x2, y2);
	GL11.glVertex2d(x2, y);
	GL11.glVertex2d(x, y);
	GL11.glVertex2d(x2, y);
	GL11.glVertex2d(x, y2);
	GL11.glVertex2d(x2, y2);
	GL11.glEnd();
	GL11.glPopMatrix();
	GL11.glEnable(3553);
	GL11.glDisable(3042);
	GL11.glDisable(2848);
}
 
开发者ID:Moudoux,项目名称:EMC,代码行数:25,代码来源:RenderUtils.java

示例6: drawGradientBorderedRectReliant

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void drawGradientBorderedRectReliant(float x, float y, float x1, float y1, float lineWidth, int border, int bottom, int top) {
	GlStateManager.enableBlend();
    GlStateManager.disableTexture2D();
    GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
    RenderUtils.drawGradientRect(x, y, x1, y1, top, bottom);
    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

示例7: 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

示例8: initGL

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
/**
 * Initialise the GL context
 */
protected void initGL() {
	GL11.glEnable(GL11.GL_TEXTURE_2D);
	GL11.glShadeModel(GL11.GL_SMOOTH);        
	GL11.glDisable(GL11.GL_DEPTH_TEST);
	GL11.glDisable(GL11.GL_LIGHTING);                    
       
	GL11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);                
       GL11.glClearDepth(1);                                       
       
       GL11.glEnable(GL11.GL_BLEND);
       GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
       
       GL11.glViewport(0,0,screenWidth,screenHeight);
	GL11.glMatrixMode(GL11.GL_MODELVIEW);
	GL11.glLoadIdentity();
	
	enterOrtho();
}
 
开发者ID:IngSW-unipv,项目名称:Progetto-C,代码行数:22,代码来源:PBufferUniqueGraphics.java

示例9: drawRect

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void drawRect(final float x1, final float y1, final float x2,
                            final float y2, final int colour) {
    final float f = (colour >> 24 & 0xFF) / 255F;
    final float f1 = (colour >> 16 & 0xFF) / 255F;
    final float f2 = (colour >> 8 & 0xFF) / 255F;
    final float f3 = (colour & 0xFF) / 255F;

    GL11.glEnable(GL11.GL_BLEND);
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    GL11.glEnable(GL11.GL_LINE_SMOOTH);

    GL11.glPushMatrix();
    GL11.glColor4f(f1, f2, f3, f);
    GL11.glBegin(GL11.GL_QUADS);
    GL11.glVertex2d(x2, y1);
    GL11.glVertex2d(x1, y1);
    GL11.glVertex2d(x1, y2);
    GL11.glVertex2d(x2, y2);
    GL11.glEnd();
    GL11.glPopMatrix();

    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glDisable(GL11.GL_BLEND);
    GL11.glDisable(GL11.GL_LINE_SMOOTH);
}
 
开发者ID:SerenityEnterprises,项目名称:SerenityCE,代码行数:27,代码来源:RenderUtilities.java

示例10: initDisplay

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
/**
 * @see org.newdawn.slick.opengl.renderer.SGL#initDisplay(int, int)
 */
public void initDisplay(int width, int height) {
	this.width = width;
	this.height = height;
	
	String extensions = GL11.glGetString(GL11.GL_EXTENSIONS);
	
	GL11.glEnable(GL11.GL_TEXTURE_2D);
	GL11.glShadeModel(GL11.GL_SMOOTH);        
	GL11.glDisable(GL11.GL_DEPTH_TEST);
	GL11.glDisable(GL11.GL_LIGHTING);                    
       
	GL11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);                
       GL11.glClearDepth(1);                                       
       
       GL11.glEnable(GL11.GL_BLEND);
       GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
       
       GL11.glViewport(0,0,width,height);
	GL11.glMatrixMode(GL11.GL_MODELVIEW);
}
 
开发者ID:imaTowan,项目名称:Towan,代码行数:24,代码来源:ImmediateModeOGLRenderer.java

示例11: renderWarpedTextureOverlay

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
private void renderWarpedTextureOverlay(float f)
{
    Tessellator tessellator = Tessellator.instance;
    float f1 = mc.thePlayer.getEntityBrightness(f);
    GL11.glColor4f(f1, f1, f1, 0.5F);
    GL11.glEnable(3042 /*GL_BLEND*/);
    GL11.glBlendFunc(770, 771);
    GL11.glPushMatrix();
    float f2 = 4F;
    float f3 = -1F;
    float f4 = 1.0F;
    float f5 = -1F;
    float f6 = 1.0F;
    float f7 = -0.5F;
    float f8 = -mc.thePlayer.rotationYaw / 64F;
    float f9 = mc.thePlayer.rotationPitch / 64F;
    tessellator.startDrawingQuads();
    tessellator.addVertexWithUV(f3, f5, f7, f2 + f8, f2 + f9);
    tessellator.addVertexWithUV(f4, f5, f7, 0.0F + f8, f2 + f9);
    tessellator.addVertexWithUV(f4, f6, f7, 0.0F + f8, 0.0F + f9);
    tessellator.addVertexWithUV(f3, f6, f7, f2 + f8, 0.0F + f9);
    tessellator.draw();
    GL11.glPopMatrix();
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    GL11.glDisable(3042 /*GL_BLEND*/);
}
 
开发者ID:jd-lang,项目名称:betaexpansion,代码行数:27,代码来源:ItemRenderer.java

示例12: onDraw

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
@SubscribeEvent
public void onDraw(RenderWorldLastEvent event){
    float partialTicks = event.getPartialTicks();
    double pX = MINECRAFT.player.prevPosX + (MINECRAFT.player.posX - MINECRAFT.player.prevPosX) * partialTicks;
    double pY = MINECRAFT.player.prevPosY + (MINECRAFT.player.posY - MINECRAFT.player.prevPosY) * partialTicks;
    double pZ = MINECRAFT.player.prevPosZ + (MINECRAFT.player.posZ - MINECRAFT.player.prevPosZ) * partialTicks;

    /* Prepare */
    GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
    GL11.glPushMatrix();
    GL11.glTranslated(-pX,-pY,-pZ);
    GL11.glDisable(GL11.GL_LIGHTING);
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glDisable(GL11.GL_DEPTH_TEST);
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    GL11.glHint( GL11.GL_LINE_SMOOTH_HINT, GL11.GL_NICEST );


    calculateFlash();
    drawBlocksAndChunks(pY);
    drawEntities(partialTicks);
    drawTileEntityTags();
    drawEntityTags(partialTicks);


    /* Restore settings */
    GL11.glEnable(GL11.GL_LIGHTING);
    GL11.glEnable(GL11.GL_DEPTH_TEST);
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glPopMatrix();
    GL11.glPopAttrib();

}
 
开发者ID:TerminatorNL,项目名称:LagGoggles,代码行数:35,代码来源:LagOverlayGui.java

示例13: enableGL2D

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void enableGL2D() {
    GL11.glDisable((int)2929);
    GL11.glEnable((int)3042);
    GL11.glDisable((int)3553);
    GL11.glBlendFunc((int)770, (int)771);
    GL11.glDepthMask((boolean)true);
    GL11.glEnable((int)2848);
    GL11.glHint((int)3154, (int)4354);
    GL11.glHint((int)3155, (int)4354);
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:11,代码来源:RenderUtils.java

示例14: drawBorderedRect

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void drawBorderedRect(double x, double y, double x2, double y2, float l1, int col1, int col2) {
       drawRect((float)x, (float)y, (float)x2, (float)y2, col2);

       float f = (float)(col1 >> 24 & 0xFF) / 255F;
       float f1 = (float)(col1 >> 16 & 0xFF) / 255F;
       float f2 = (float)(col1 >> 8 & 0xFF) / 255F;
       float f3 = (float)(col1 & 0xFF) / 255F;
       GL11.glPushMatrix();
       GL11.glEnable(GL11.GL_BLEND);
       GL11.glDisable(GL11.GL_TEXTURE_2D);
       GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
       GL11.glEnable(GL11.GL_LINE_SMOOTH);

       GL11.glColor4f(f1, f2, f3, f);
       GL11.glLineWidth(l1);
       GL11.glBegin(GL11.GL_LINES);
       GL11.glVertex2d(x, y);
       GL11.glVertex2d(x, y2);
       GL11.glVertex2d(x2, y2);
       GL11.glVertex2d(x2, y);
       GL11.glVertex2d(x, y);
       GL11.glVertex2d(x2, y);
       GL11.glVertex2d(x, y2);
       GL11.glVertex2d(x2, y2);
       GL11.glEnd();

       GL11.glEnable(GL11.GL_TEXTURE_2D);
       GL11.glDisable(GL11.GL_BLEND);
       GL11.glDisable(GL11.GL_LINE_SMOOTH);
       GL11.glPopMatrix();
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:32,代码来源:RenderUtils.java

示例15: tracerLine

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void tracerLine(Entity entity, int mode) {
	RenderUtils.fixDarkLight();
	GlStateManager.resetColor();
	double x = entity.posX - Minecraft.getMinecraft().getRenderManager().renderPosX;
	double y = entity.posY + entity.height / 2.0F - Minecraft.getMinecraft().getRenderManager().renderPosY;
	double z = entity.posZ - Minecraft.getMinecraft().getRenderManager().renderPosZ;
	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);
	}
	Vec3d eyes = new Vec3d(0.0D, 0.0D, 1.0D)
			.rotatePitch(-(float) Math.toRadians(Minecraft.getMinecraft().player.rotationPitch))
			.rotateYaw(-(float) Math.toRadians(Minecraft.getMinecraft().player.rotationYaw));

	GL11.glBegin(1);

	GL11.glVertex3d(eyes.xCoord, Minecraft.getMinecraft().player.getEyeHeight() + eyes.yCoord, eyes.zCoord);
	GL11.glVertex3d(x, y, z);

	GL11.glEnd();
	GL11.glEnable(3553);
	GL11.glEnable(2929);
	GL11.glDepthMask(true);
	GL11.glDisable(3042);
}
 
开发者ID:Moudoux,项目名称:EMC,代码行数:40,代码来源:RenderUtils.java


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