當前位置: 首頁>>代碼示例>>Java>>正文


Java GL11類代碼示例

本文整理匯總了Java中org.lwjgl.opengl.GL11的典型用法代碼示例。如果您正苦於以下問題:Java GL11類的具體用法?Java GL11怎麽用?Java GL11使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


GL11類屬於org.lwjgl.opengl包,在下文中一共展示了GL11類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: renderDefaultChar

import org.lwjgl.opengl.GL11; //導入依賴的package包/類
/**
 * Render a single character with the default.png font at current (posX,posY) location...
 */
private float renderDefaultChar(int p_78266_1_, boolean p_78266_2_)
{
    int i = p_78266_1_ % 16 * 8;
    int j = p_78266_1_ / 16 * 8;
    int k = p_78266_2_ ? 1 : 0;
    this.bindTexture(this.locationFontTexture);
    float f = this.charWidth[p_78266_1_];
    float f1 = 7.99F;
    GL11.glBegin(GL11.GL_TRIANGLE_STRIP);
    GL11.glTexCoord2f((float)i / 128.0F, (float)j / 128.0F);
    GL11.glVertex3f(this.posX + (float)k, this.posY, 0.0F);
    GL11.glTexCoord2f((float)i / 128.0F, ((float)j + 7.99F) / 128.0F);
    GL11.glVertex3f(this.posX - (float)k, this.posY + 7.99F, 0.0F);
    GL11.glTexCoord2f(((float)i + f1 - 1.0F) / 128.0F, (float)j / 128.0F);
    GL11.glVertex3f(this.posX + f1 - 1.0F + (float)k, this.posY, 0.0F);
    GL11.glTexCoord2f(((float)i + f1 - 1.0F) / 128.0F, ((float)j + 7.99F) / 128.0F);
    GL11.glVertex3f(this.posX + f1 - 1.0F - (float)k, this.posY + 7.99F, 0.0F);
    GL11.glEnd();
    return f;
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:24,代碼來源:FontRenderer.java

示例2: render

import org.lwjgl.opengl.GL11; //導入依賴的package包/類
@Override
public void render(SemiBlockCropSupport semiBlock, float partialTick) {
    GL11.glPushMatrix();
    Minecraft.getMinecraft().renderEngine.bindTexture(Textures.MODEL_HEAT_FRAME);

    double brightness = 0.2;
    GL11.glColor4d(brightness, brightness, brightness, 1);

    AxisAlignedBB aabb = new AxisAlignedBB(3 / 16D, -6 / 16D, 3 / 16D, 13 / 16D, 17 / 16D, 13 / 16D);
   
    GL11.glTranslated(aabb.minX, aabb.minY, aabb.minZ);
    GL11.glScaled(aabb.maxX - aabb.minX, aabb.maxY - aabb.minY, aabb.maxZ - aabb.minZ);
    GL11.glTranslated(0.5, -0.5, 0.5);
    model.render(null, 0, 0, 0, 0, 0, 1 / 16F);
    GL11.glPopMatrix();
    GL11.glColor4d(1, 1, 1, 1);
}
 
開發者ID:TeamPneumatic,項目名稱:pnc-repressurized,代碼行數:18,代碼來源:SemiBlockRendererCropSupport.java

示例3: renderTieBottom

import org.lwjgl.opengl.GL11; //導入依賴的package包/類
@SideOnly(Side.CLIENT)
private static final void renderTieBottom(float width){
	GL11.glTexCoord2f(tieTopMinU, tieTopMinV);
	GL11.glNormal3f(0, 1, 0);
	GL11.glVertex3f(width/2, 0, length/2);

	GL11.glTexCoord2f(tieTopMaxU, tieTopMinV);
	GL11.glNormal3f(0, 1, 0);
	GL11.glVertex3f(-width/2, 0, length/2);

	GL11.glTexCoord2f(tieTopMaxU, tieTopMaxV);
	GL11.glNormal3f(0, 1, 0);
	GL11.glVertex3f(-width/2, 0, -length/2);

	GL11.glTexCoord2f(tieTopMinU, tieTopMaxV);
	GL11.glNormal3f(0, 1, 0);
	GL11.glVertex3f(width/2, 0, -length/2);
}
 
開發者ID:DonBruce64,項目名稱:OpenFlexiTrack,代碼行數:19,代碼來源:DefaultSleeperType.java

示例4: 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);
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:18,代碼來源:RenderUtils.java

示例5: drawGuiContainerBackgroundLayer

import org.lwjgl.opengl.GL11; //導入依賴的package包/類
@Override
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY)
{
    if (content.bg != null)
    {
        mc.getTextureManager().bindTexture(content.bg);
        int x = (width - xSize) / 2;
        int y = (height - ySize) / 2;
        drawTexturedModalRect(x, y, content.bgTexX, content.bgTexY, xSize, ySize);

        GL11.glPushMatrix();
        GL11.glTranslatef(x, y, 0f);
        for (ProgressBar bar : content.progressBars)
        {
            bar.draw(progressBarSource);
        }
        GL11.glPopMatrix();
    }
}
 
開發者ID:cubex2,項目名稱:customstuff4,代碼行數:20,代碼來源:GuiContainerCS4.java

示例6: draw

import org.lwjgl.opengl.GL11; //導入依賴的package包/類
@Override
public void draw() {
	
	super.draw();
	
	TextureManager render = mc.renderEngine;
	render.bindTexture(resource);
	
	GlStateManager.enableBlend();
	GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
	GlStateManager.color(1F, 1F, 1F, 1F);
	int k = (gui.width - gui.WIDTH) / 2;
	gui.drawTexturedModalRect(k + 5, 5, 0, 0, gui.WIDTH, gui.HEIGHT);
	gui.drawCenteredString(mc.fontRendererObj, text, drawX + 60, drawY + 150, Color.gray.getRGB());
	GlStateManager.disableBlend();
}
 
開發者ID:bafomdad,項目名稱:uniquecrops,代碼行數:17,代碼來源:PageImage.java

示例7: onWorldDraw

import org.lwjgl.opengl.GL11; //導入依賴的package包/類
@Override
protected void onWorldDraw(float delta, float x, float y, float z) {
    float mx, my, mz;
    if (!safeShow) return;
    if (--safeUpdate < 0) {
        safeUpdate = 13;
        reCheckSafe(fix(x), fix(y), fix(z));
    }
    if (safeGhost) GL11.glDisable(GL11.GL_DEPTH_TEST);
    else           GL11.glEnable( GL11.GL_DEPTH_TEST);
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glDisable(GL11.GL_BLEND);
    GL11.glDisable(GL11.GL_FOG);
    GL11.glBegin(GL11.GL_LINES);
    for (int i = 0; i < safeCur; ++i) {
        Vec3i pos   = safePoses[i];
        Color color = safeMarks[i];
        GL11.glColor3ub(color.rb, color.gb, color.bb);
        mx = pos.getX() - x; my = pos.getY() - y; mz = pos.getZ() - z;
        GL11.glVertex3f(mx+0.9f,my+0.01f,mz+0.9f);
        GL11.glVertex3f(mx+0.1f,my+0.01f,mz+0.1f);
        GL11.glVertex3f(mx+0.9f,my+0.01f,mz+0.1f);
        GL11.glVertex3f(mx+0.1f,my+0.01f,mz+0.9f);
    }
    GL11.glEnd();
}
 
開發者ID:NSExceptional,項目名稱:Zombe-Modpack,代碼行數:27,代碼來源:Safe.java

示例8: onControllerDrag

import org.lwjgl.opengl.GL11; //導入依賴的package包/類
@Override
protected void onControllerDrag()
{
	Part part = selectedPart;
	if(part instanceof PartObj || part instanceof PartRotation)
		super.onControllerDrag();
	else
	{
		GL11.glPushMatrix();
		if(part instanceof PartEntityPos)
			GL11.glTranslated(-entityToRender.posX, -entityToRender.posY, -entityToRender.posZ);
		int i = translationAxisPlane == 0 ? 2 : translationAxisPlane - 1;
		translationGuidePoint = getMouseVectorInPlane(i);
		processAxisDrag();
		GL11.glPopMatrix();
	}
}
 
開發者ID:ObsidianSuite,項目名稱:ObsidianSuite,代碼行數:18,代碼來源:GuiEntityRendererWithTranslation.java

示例9: updateData

import org.lwjgl.opengl.GL11; //導入依賴的package包/類
public VBO updateData(IntBuffer buffer, long offset)
{
	if (this.type != GL11.GL_UNSIGNED_INT)
	{
		throw new IllegalArgumentException("Cannot store mismatching type in buffer!");
	}

	if (offset + buffer.limit() > this.length)
	{
		int usage = GL15.glGetBufferParameteri(this.target, GL15.GL_BUFFER_USAGE);
		this.putData(buffer, this.normalized, usage);
	}

	GL15.glBindBuffer(this.target, this.handle);
	GL15.glBufferSubData(this.target, offset, buffer);

	return this;
}
 
開發者ID:andykuo1,項目名稱:candlelight,代碼行數:19,代碼來源:VBO.java

示例10: render

import org.lwjgl.opengl.GL11; //導入依賴的package包/類
@Override
public void render() {
    FMLClientHandler.instance().getClient().getTextureManager().bindTexture(getTexture());
    int width = getWidth() + (getParameters() != null && getParameters().length > 0 ? 10 : 0);
    int height = getHeight() + (hasStepOutput() ? 10 : 0);
    Pair<Double, Double> maxUV = getMaxUV();
    double u = maxUV.getLeft();
    double v = maxUV.getRight();
    BufferBuilder wr = Tessellator.getInstance().getBuffer();
    wr.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX);
    wr.pos(0, 0, 0).tex(0, 0).endVertex();
    wr.pos(0, height, 0).tex(0, v).endVertex();
    wr.pos(width, height, 0).tex(u, v).endVertex();
    wr.pos(width, 0, 0).tex(u, 0).endVertex();
    Tessellator.getInstance().draw();
}
 
開發者ID:TeamPneumatic,項目名稱:pnc-repressurized,代碼行數:17,代碼來源:ProgWidget.java

示例11: renderDynamic

import org.lwjgl.opengl.GL11; //導入依賴的package包/類
@Override
protected void renderDynamic(float scale, float partialTicks) {
    shape1.render(scale);
    shape2.render(scale);

    float pressure = 0f;
    float dangerPressure = 5f;
    float critPressure = 7f;
    if (gaugeModule != null && gaugeModule.getTube() instanceof TileEntityPneumaticBase) {
        TileEntityPneumaticBase base = (TileEntityPneumaticBase) gaugeModule.getTube();
        pressure = base.getPressure();
        critPressure = base.criticalPressure;
        dangerPressure = base.dangerPressure;
    }
    GL11.glTranslated(0, 1, 0.378);
    double widgetScale = 0.007D;
    GL11.glScaled(widgetScale, widgetScale, widgetScale);
    GL11.glRotated(180, 0, 1, 0);
    GL11.glDisable(GL11.GL_LIGHTING);
    GuiUtils.drawPressureGauge(FMLClientHandler.instance().getClient().fontRenderer, -1, critPressure, dangerPressure, -1, pressure, 0, 0, 0);
    GL11.glEnable(GL11.GL_LIGHTING);
}
 
開發者ID:TeamPneumatic,項目名稱:pnc-repressurized,代碼行數:23,代碼來源:ModelGauge.java

示例12: renderPumpkinBlur

import org.lwjgl.opengl.GL11; //導入依賴的package包/類
private void renderPumpkinBlur(int i, int j)
{
    GL11.glDisable(2929 /*GL_DEPTH_TEST*/);
    GL11.glDepthMask(false);
    GL11.glBlendFunc(770, 771);
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    GL11.glDisable(3008 /*GL_ALPHA_TEST*/);
    GL11.glBindTexture(3553 /*GL_TEXTURE_2D*/, mc.renderEngine.getTexture("%blur%/misc/pumpkinblur.png"));
    Tessellator tessellator = Tessellator.instance;
    tessellator.startDrawingQuads();
    tessellator.addVertexWithUV(0.0D, j, -90D, 0.0D, 1.0D);
    tessellator.addVertexWithUV(i, j, -90D, 1.0D, 1.0D);
    tessellator.addVertexWithUV(i, 0.0D, -90D, 1.0D, 0.0D);
    tessellator.addVertexWithUV(0.0D, 0.0D, -90D, 0.0D, 0.0D);
    tessellator.draw();
    GL11.glDepthMask(true);
    GL11.glEnable(2929 /*GL_DEPTH_TEST*/);
    GL11.glEnable(3008 /*GL_ALPHA_TEST*/);
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
}
 
開發者ID:jd-lang,項目名稱:betaexpansion,代碼行數:21,代碼來源:GuiIngame.java

示例13: disable

import org.lwjgl.opengl.GL11; //導入依賴的package包/類
/**
 * @see org.newdawn.slick.Graphics#disable()
 */
protected void disable() {
	// Bind the texture after rendering.
	GL11.glBindTexture(GL11.GL_TEXTURE_2D, image.getTexture().getTextureID());
	GL11.glCopyTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGBA, 0, 0, 
						  image.getTexture().getTextureWidth(), 
						  image.getTexture().getTextureHeight(), 0);
	
	try {
		Display.makeCurrent();
	} catch (LWJGLException e) {
		Log.error(e);
	}
	
	SlickCallable.leaveSafeBlock();
}
 
開發者ID:IngSW-unipv,項目名稱:Progetto-C,代碼行數:19,代碼來源:PBufferUniqueGraphics.java

示例14: renderGhostModel

import org.lwjgl.opengl.GL11; //導入依賴的package包/類
public static void renderGhostModel(IBakedModel model, BlockPos position, Color color, boolean noDepth, float partialTicks)
{
	GlStateManager.enableBlend();
       GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE_MINUS_DST_COLOR);
	BufferBuilder vb;
	if(noDepth)
	{
           GlStateManager.depthFunc(519);
		vb = prepRenderBlockDepth(partialTicks, true);
	}
	else
        vb = prepRender(partialTicks, true);
       vb.begin(7, DefaultVertexFormats.BLOCK);
       World world = Minecraft.getMinecraft().world;
       BlockRendererDispatcher dispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
       dispatcher.getBlockModelRenderer().renderModel(world, model, Minecraft.getMinecraft().world.getBlockState(position), position.add(0, noDepth ? 500 : 0, 0), vb, false);
       for(int i = 0; i < vb.getVertexCount(); i++)
       	vb.putColorMultiplier(color.getRed() / 255f, color.getGreen() / 255f, color.getBlue() / 255f, i);
       vb.color(1, 1, 1, 0.1f);
       postRender();
       GlStateManager.depthFunc(515);
       GlStateManager.disableBlend();
}
 
開發者ID:kenijey,項目名稱:harshencastle,代碼行數:24,代碼來源:HarshenClientUtils.java

示例15: renderBillboardQuadWithRotation

import org.lwjgl.opengl.GL11; //導入依賴的package包/類
public static void renderBillboardQuadWithRotation(float rot, double scale) {
    GlStateManager.pushMatrix();

    rotateToPlayer();

    GlStateManager.rotate(rot, 0, 0, 1);

    Tessellator tessellator = Tessellator.getInstance();
    VertexBuffer buffer = tessellator.getBuffer();
    buffer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX);
    buffer.pos(-scale, -scale, 0).tex(0, 0).endVertex();
    buffer.pos(-scale, +scale, 0).tex(0, 1).endVertex();
    ;
    buffer.pos(+scale, +scale, 0).tex(1, 1).endVertex();
    ;
    buffer.pos(+scale, -scale, 0).tex(1, 0).endVertex();
    ;
    tessellator.draw();
    GlStateManager.popMatrix();
}
 
開發者ID:McJty,項目名稱:interactionwheel,代碼行數:21,代碼來源:RenderHelper.java


注:本文中的org.lwjgl.opengl.GL11類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。