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


Java GL11.glEnable方法代码示例

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


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

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

示例2: drawRect

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void drawRect(float g, float h, float i, float j, Color c) {
	GL11.glEnable(3042);
	GL11.glDisable(3553);
	GL11.glBlendFunc(770, 771);
	GL11.glEnable(2848);
	GL11.glPushMatrix();
	glColor(c);
	GL11.glBegin(7);
	GL11.glVertex2d(i, h);
	GL11.glVertex2d(g, h);
	GL11.glVertex2d(g, j);
	GL11.glVertex2d(i, j);
	GL11.glEnd();
	GL11.glPopMatrix();
	GL11.glEnable(3553);
	GL11.glDisable(3042);
	GL11.glDisable(2848);
}
 
开发者ID:Moudoux,项目名称:EMC,代码行数:19,代码来源:RenderUtils.java

示例3: drawFirstPersonHand

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public void drawFirstPersonHand(EntityPlayer entityplayer)
{
	modelBipedMain.setPlayer(entityplayer);
	modelBipedMain.updateStatus();
	modelBipedMain.onGround = 0.0F;
	modelBipedMain.setRotationAngles(0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
	if(!modelBipedMain.isLoaded && RenderEngine.skinResX != RenderEngine.skinResY)
	{
    	modelBipedMain.bipedRightArm_old.render(0.0625F);
    	return;
	}
	modelBipedMain.bipedRightArm.render(0.0625F);
    
    if(GameSettings.modelPart_right_sleeve)
    {
    	GL11.glDisable(GL11.GL_CULL_FACE);
    	modelBipedMain.bipedRightArm2.render(0.0625F);
    	GL11.glEnable(GL11.GL_CULL_FACE);
    }
}
 
开发者ID:jd-lang,项目名称:betaexpansion,代码行数:21,代码来源:RenderPlayer.java

示例4: 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) {
    RenderUtils.enableGL2D();
    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);
    RenderUtils.disableGL2D();
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:20,代码来源:RenderUtils.java

示例5: render

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
public void render(double x, double y, double z, double gunRadius) {
    if (isMinigunActivated() && getMinigunSpeed() == MAX_GUN_SPEED && gunAimedAtTarget && attackTarget != null) {
        GL11.glPushMatrix();
        GL11.glScaled(1, 1, 1);
        GL11.glTranslated(-x, -y, -z);
        GL11.glDisable(GL11.GL_TEXTURE_2D);
        //GL11.glDisable(GL11.GL_LIGHTING);
        RenderUtils.glColorHex(0xFF000000 | getAmmoColor());
        for (int i = 0; i < 5; i++) {

            Vec3d vec = new Vec3d(attackTarget.posX - x, attackTarget.posY - y, attackTarget.posZ - z).normalize();
            minigunFire.startX = x + vec.x * gunRadius;
            minigunFire.startY = y + vec.y * gunRadius;
            minigunFire.startZ = z + vec.z * gunRadius;
            minigunFire.endX = attackTarget.posX + rand.nextDouble() - 0.5;
            minigunFire.endY = attackTarget.posY + attackTarget.height / 2 + rand.nextDouble() - 0.5;
            minigunFire.endZ = attackTarget.posZ + rand.nextDouble() - 0.5;
            minigunFire.render();
        }
        GL11.glColor4d(1, 1, 1, 1);
        // GL11.glEnable(GL11.GL_LIGHTING);
        GL11.glEnable(GL11.GL_TEXTURE_2D);
        GL11.glPopMatrix();
    }
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:27,代码来源:Minigun.java

示例6: 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:IngSW-unipv,项目名称:Progetto-C,代码行数:24,代码来源:ImmediateModeOGLRenderer.java

示例7: disableGL2D

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

示例8: antialias

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void antialias(boolean enable) {
	if (enable && !antialiasing) {
		GL11.glEnable(GL13.GL_MULTISAMPLE);
		antialiasing = true;
	} else if (!enable && antialiasing) {
		GL11.glDisable(GL13.GL_MULTISAMPLE);
		antialiasing = false;
	}
}
 
开发者ID:TheThinMatrix,项目名称:LowPolyTerrain,代码行数:10,代码来源:OpenGlUtils.java

示例9: render

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
/**
 * @see org.newdawn.slick.Game#render(org.newdawn.slick.GameContainer, org.newdawn.slick.Graphics)
 */
public void render(GameContainer container, Graphics g)
		throws SlickException {
	String text = "abc";
	font.drawString(610,100,text);
	
	GL11.glDisable(GL11.GL_BLEND);
	GL11.glEnable(GL11.GL_ALPHA_TEST);
	GL11.glAlphaFunc(GL11.GL_GEQUAL, 0.5f);
	font.drawString(610,150,text);
	GL11.glDisable(GL11.GL_ALPHA_TEST);
	GL11.glEnable(GL11.GL_BLEND);
	
	g.translate(-50,-130);
	g.scale(10,10);
	font.drawString(0,0,text);

	GL11.glDisable(GL11.GL_BLEND);
	GL11.glEnable(GL11.GL_ALPHA_TEST);
	GL11.glAlphaFunc(GL11.GL_GEQUAL, 0.5f);
	font.drawString(0,26,text);
	GL11.glDisable(GL11.GL_ALPHA_TEST);
	GL11.glEnable(GL11.GL_BLEND);
	
	g.resetTransform();
	g.setColor(Color.lightGray);
	g.drawString("Original Size on Sheet", 620, 210);
	g.drawString("10x Scale Up", 40, 575);
	
	g.setColor(Color.darkGray);
	g.drawRect(40, 40, 560,530);
	g.drawRect(610, 105, 150,100);

	g.setColor(Color.white);
	g.drawString("512x512 Font Sheet", 620, 300);
	g.drawString("NEHE Charset", 620, 320);
	g.drawString("4096x4096 (8x) Source Image", 620, 340);
	g.drawString("ScanSize = 20", 620, 360);
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:42,代码来源:DistanceFieldTest.java

示例10: drawK

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
private static void drawK(float scale, float startX, float y)
{
       convert(scale * (startX - 0.5f), scale * (y),scale * (startX - 0.5f), scale * (y - 1.1f));

       GL11.glLineWidth(3.5f);
       GL11.glBegin(GL11.GL_LINE_STRIP);
       GL11.glEnable(GL11.GL_LINE_WIDTH);
       GL11.glVertex2f(scale * (startX - 0.4f), scale * (y-0.45f));
       GL11.glVertex2f(scale * (startX), scale * (y - 1));
       GL11.glVertex2f(scale * (startX - 0.4f), scale * (y-0.45f));
       GL11.glVertex2f(scale * (startX), scale * (y  - 0.1f));
       GL11.glEnd();
       
}
 
开发者ID:TauOmicronMu,项目名称:TeamProject,代码行数:15,代码来源:Text.java

示例11: createDisplay

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static DisplayManager createDisplay(){
	try {
		Display.setDisplayMode(new DisplayMode(WIDTH,HEIGHT));
		Display.create(new PixelFormat().withDepthBits(24).withSamples(4));
		Display.setTitle(TITLE);
		GL11.glEnable(GL13.GL_MULTISAMPLE);
	} catch (LWJGLException e) {
		e.printStackTrace();
		System.err.println("Couldn't create display!");
		System.exit(-1);
	}	
	GL11.glViewport(0,0, WIDTH, HEIGHT);
	return new DisplayManager();
}
 
开发者ID:TheThinMatrix,项目名称:OcclusionQueries,代码行数:15,代码来源:DisplayManager.java

示例12: drawCircle

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void drawCircle(float cx, float cy, float r, int num_segments, int c)
{
	GL11.glScalef(0.5F, 0.5F, 0.5F);
	r *= 2;
	cx *= 2;
	cy *= 2;
	float f = (float) (c >> 24 & 0xff) / 255F;
	float f1 = (float) (c >> 16 & 0xff) / 255F;
	float f2 = (float) (c >> 8 & 0xff) / 255F;
	float f3 = (float) (c & 0xff) / 255F;
	float theta = (float) (2 * 3.1415926 / (num_segments));
	float p = (float) Math.cos(theta);//calculate the sine and cosine
	float s = (float) Math.sin(theta);
	float t;
	GL11.glColor4f(f1, f2, f3, f);
	float x = r;
	float y = 0;//start at angle = 0
			GL11.glEnable(3042);
	GL11.glDisable(3553);
	GL11.glEnable(GL11.GL_LINE_SMOOTH);
	GL11.glBlendFunc(770, 771);
	GL11.glBegin(GL11.GL_LINE_LOOP);
	for(int ii = 0; ii < num_segments; ii++)
	{
		GL11.glVertex2f(x + cx, y + cy);//final vertex vertex

		//rotate the stuff
		t = x;
		x = p * x - s * y;
		y = s * t + p * y;
	}
	GL11.glEnd();
	GL11.glEnable(3553);
	GL11.glDisable(3042);
	GL11.glDisable(GL11.GL_LINE_SMOOTH);
	GL11.glScalef(2F, 2F, 2F);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:38,代码来源:RenderUtils.java

示例13: drawString

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void drawString(String str, int x, int y, int color) {
    if (str == null) return;
    boolean blend = GL11.glIsEnabled(GL11.GL_BLEND);
    GL11.glDisable(GL11.GL_BLEND);
    fontRenderer().func_78276_b(str, x, y, color);
    if (blend) GL11.glEnable(GL11.GL_BLEND);
}
 
开发者ID:Ygore,项目名称:bit-client,代码行数:8,代码来源:Wrapper.java

示例14: begin

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static final void begin() {

		GL11.glEnable(GL11.GL_BLEND);
		GL11.glDisable(GL11.GL_DEPTH_TEST);
		GL11.glDepthMask(false);

		GL30.glBindVertexArray(model.id);

		GL20.glEnableVertexAttribArray(0);
		GL20.glEnableVertexAttribArray(1);

		texture.bind(0);

		shader.start();
		shader.loadProjectionMatrix(GameCamera.projection_primary);
		shader.stop();

	}
 
开发者ID:ASasseCreations,项目名称:Voxel_Game,代码行数:19,代码来源:SunRenderer.java

示例15: render

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
@Override
public void render(int mouseX, int mouseY, float partialTicks) {
    lastMouseX = mouseX;
    lastMouseY = mouseY;
    float zLevel = 0;
    FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer;
    int renderBaseX = (int) (oldBaseX + (baseX - oldBaseX) * partialTicks);
    int renderAffectedY = (int) (oldAffectedY + (affectedY - oldAffectedY) * partialTicks);
    int renderWidth = (int) (oldWidth + (width - oldWidth) * partialTicks);
    int renderHeight = (int) (oldHeight + (height - oldHeight) * partialTicks);

    if (leftSided) renderWidth *= -1;
    Gui.drawRect(renderBaseX, renderAffectedY /* + 1 */, renderBaseX + renderWidth /*- 1*/, renderAffectedY + renderHeight, backGroundColor);
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glLineWidth(3.0F);
    GL11.glColor4d(0, 0, 0, 1);
    BufferBuilder wr = Tessellator.getInstance().getBuffer();
    wr.begin(GL11.GL_LINE_LOOP, DefaultVertexFormats.POSITION);
    wr.pos(renderBaseX, renderAffectedY, zLevel).endVertex();
    wr.pos(renderBaseX + renderWidth, renderAffectedY, zLevel).endVertex();
    wr.pos(renderBaseX + renderWidth, renderAffectedY + renderHeight, zLevel).endVertex();
    wr.pos(renderBaseX, renderAffectedY + renderHeight, zLevel).endVertex();
    Tessellator.getInstance().draw();
    GL11.glEnable(GL11.GL_TEXTURE_2D);
    if (leftSided) renderWidth *= -1;
    // if done expanding, draw the information
    if (doneExpanding) {
        GL11.glPushMatrix();
        GL11.glTranslated(renderBaseX + (leftSided ? -renderWidth : 16), renderAffectedY, 0);
        GL11.glScaled(textSize, textSize, textSize);
        GL11.glTranslated(-renderBaseX - (leftSided ? -renderWidth : 16), -renderAffectedY, 0);
        fontRenderer.drawStringWithShadow(title, renderBaseX + (leftSided ? -renderWidth + 2 : 18), renderAffectedY + 2, 0xFFFF00);
        for (int i = curScroll; i < textList.size() && i < curScroll + MAX_LINES; i++) {

            if (textList.get(i).contains("\u00a70") || textList.get(i).contains(TextFormatting.DARK_RED.toString())) {
                fontRenderer.drawString(textList.get(i), renderBaseX + (leftSided ? -renderWidth + 2 : 18), renderAffectedY + (i - curScroll) * 10 + 12, 0xFFFFFF);
            } else {
                fontRenderer.drawStringWithShadow(textList.get(i), renderBaseX + (leftSided ? -renderWidth + 2 : 18), renderAffectedY + (i - curScroll) * 10 + 12, 0xFFFFFF);
            }
        }
        GL11.glPopMatrix();

        GL11.glPushMatrix();
        GL11.glTranslated(renderBaseX, renderAffectedY, 0);
        GL11.glEnable(GL11.GL_TEXTURE_2D);
        for (IGuiWidget widget : widgets)
            widget.render(mouseX - renderBaseX, mouseY - renderAffectedY, partialTicks);
        GL11.glPopMatrix();
    }
    if (renderHeight > 16 && renderWidth > 16) {
        GL11.glColor4d(1, 1, 1, 1);
        GL11.glEnable(GL11.GL_BLEND);
        GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
        if (iStack.isEmpty()) {
            if (texture.contains(Textures.GUI_LOCATION)) {
                GuiPneumaticContainerBase.drawTexture(texture, renderBaseX - (leftSided ? 16 : 0), renderAffectedY);
            } else {
                fontRenderer.drawString(texture, renderBaseX - (leftSided ? 16 : 0), renderAffectedY, 0xFFFFFFFF);
            }
        } else if (gui != null || !(iStack.getItem() instanceof ItemBlock)) {
            if (itemRenderer == null) itemRenderer = Minecraft.getMinecraft().getRenderItem();
            itemRenderer.zLevel = 1;
            GL11.glPushMatrix();
            GL11.glTranslated(0, 0, -50);
            GL11.glEnable(GL12.GL_RESCALE_NORMAL);
            RenderHelper.enableGUIStandardItemLighting();
            itemRenderer.renderItemAndEffectIntoGUI(iStack, renderBaseX - (leftSided ? 16 : 0), renderAffectedY);
            RenderHelper.disableStandardItemLighting();
            GL11.glDisable(GL12.GL_RESCALE_NORMAL);
            GL11.glPopMatrix();
        }
        GL11.glDisable(GL11.GL_BLEND);
    }
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:75,代码来源:GuiAnimatedStat.java


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