当前位置: 首页>>代码示例>>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;未经允许,请勿转载。