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


Java GL11.glEnd方法代码示例

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


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

示例1: drawBorderedRectReliant

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void drawBorderedRectReliant(float x, float y, float x1, float y1, float lineWidth, int inside, int border) {
    RenderUtils.enableGL2D();
    RenderUtils.drawRect(x, y, x1, y1, inside);
    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

示例2: 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.renderEngine.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

示例3: render

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
void render()
{
    GL11.glLineWidth(1.0f);
    GL11.glColor3f(COLOR, COLOR, COLOR);
    GL11.glBegin(GL11.GL_LINES);
    for (int ix = -WIDTH; ix <= WIDTH; ix++)
    {
        float x = ix*SIZE;
        GL11.glVertex3f(x, FLOOR_HEIGHT, -REAL_WIDTH);
        GL11.glVertex3f(x, FLOOR_HEIGHT, REAL_WIDTH);
    }
    
    for (int iz = -WIDTH; iz <= WIDTH; iz++)
    {
        float z = iz*SIZE;
        GL11.glVertex3f(-REAL_WIDTH, FLOOR_HEIGHT, z);
        GL11.glVertex3f(REAL_WIDTH, FLOOR_HEIGHT, z);
    }
    GL11.glEnd();
}
 
开发者ID:SmashMaster,项目名称:KraftigAudio,代码行数:21,代码来源:Grid.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包/类
/**
 * Game loop render
 */
public void render() {
	Color.white.bind();
	texture.bind(); // or GL11.glBind(texture.getTextureID());
	
	GL11.glBegin(GL11.GL_QUADS);
		GL11.glTexCoord2f(0,0);
		GL11.glVertex2f(100,100);
		GL11.glTexCoord2f(1,0);
		GL11.glVertex2f(100+texture.getTextureWidth(),100);
		GL11.glTexCoord2f(1,1);
		GL11.glVertex2f(100+texture.getTextureWidth(),100+texture.getTextureHeight());
		GL11.glTexCoord2f(0,1);
		GL11.glVertex2f(100,100+texture.getTextureHeight());
	GL11.glEnd();
	
	font.drawString(150, 300, "HELLO LWJGL WORLD", Color.yellow);
}
 
开发者ID:IngSW-unipv,项目名称:Progetto-C,代码行数:21,代码来源:TestUtils.java

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

示例7: drawGradientHRect

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void drawGradientHRect(float x, float y, float x1, float y1, int topColor, int bottomColor) {
	GlStateManager.enableBlend();
    GlStateManager.disableTexture2D();
    GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
    GL11.glShadeModel((int)7425);
    GL11.glBegin((int)7);
    RenderUtils.glColor(topColor);
    GL11.glVertex2f((float)x, (float)y);
    GL11.glVertex2f((float)x, (float)y1);
    RenderUtils.glColor(bottomColor);
    GL11.glVertex2f((float)x1, (float)y1);
    GL11.glVertex2f((float)x1, (float)y);
    GL11.glEnd();
    GL11.glShadeModel((int)7424);
    GlStateManager.enableTexture2D();
    GlStateManager.disableBlend();
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:18,代码来源:RenderUtils.java

示例8: flushBuffer

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
/**
 * Flush the currently cached data down to the card 
 */
private void flushBuffer() {	
	if (vertIndex == 0) {
		return;
	}
	if (currentType == NONE) {
		return;
	}
	
	if (vertIndex < TOLERANCE) {
		GL11.glBegin(currentType);
		for (int i=0;i<vertIndex;i++) {
			GL11.glColor4f(cols[(i*4)+0], cols[(i*4)+1], cols[(i*4)+2], cols[(i*4)+3]);
			GL11.glTexCoord2f(texs[(i*2)+0], texs[(i*2)+1]);
			GL11.glVertex3f(verts[(i*3)+0], verts[(i*3)+1], verts[(i*3)+2]);
		}
		GL11.glEnd();
		currentType = NONE;
		return;
	}
	vertices.clear();
	colors.clear();
	textures.clear();
	
	vertices.put(verts,0,vertIndex*3);
	colors.put(cols,0,vertIndex*4);
	textures.put(texs,0,vertIndex*2);
	
	vertices.flip(); 
	colors.flip(); 
	textures.flip(); 
	
	GL11.glVertexPointer(3,0,vertices);     
	GL11.glColorPointer(4,0,colors);     
	GL11.glTexCoordPointer(2,0,textures);     
	
	GL11.glDrawArrays(currentType, 0, vertIndex);
	currentType = NONE;
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:42,代码来源:VAOGLRenderer.java

示例9: drawChar

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
/**
 * Draws the character.
 *
 * @param character     The character to be drawn.
 * @param characterData The character texture set to be used.
 */
private void drawChar(char character, CharacterData[] characterData, float x, float y) {
    // The char data that stores the character data.
    CharacterData charData = characterData[character];

    // Binds the character data texture.
    charData.bind();
    GL11.glPushMatrix();

    // Enables blending.
    GL11.glEnable(GL11.GL_BLEND);

    // Sets the blending function.
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);

    // Begins drawing the quad.
    GL11.glBegin(GL11.GL_QUADS); {
        // Maps out where the texture should be drawn.
        GL11.glTexCoord2f(0, 0);
        GL11.glVertex2d(x, y);
        GL11.glTexCoord2f(0, 1);
        GL11.glVertex2d(x, y + charData.height);
        GL11.glTexCoord2f(1, 1);
        GL11.glVertex2d(x + charData.width, y + charData.height);
        GL11.glTexCoord2f(1, 0);
        GL11.glVertex2d(x + charData.width, y);
    }
    // Ends the quad.
    GL11.glEnd();

    GL11.glDisable(GL11.GL_BLEND);
    GL11.glPopMatrix();

    // Binds the opengl texture by the texture id.
    GL11.glBindTexture(GL11.GL_TEXTURE_2D, 0);
}
 
开发者ID:SerenityEnterprises,项目名称:SerenityCE,代码行数:42,代码来源:TTFFontRenderer.java

示例10: drawOutlinedBox

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void drawOutlinedBox(AxisAlignedBB boundingBox) {
    if (boundingBox == null) {
        return;
    }
    GL11.glBegin((int)3);
    GL11.glVertex3d((double)boundingBox.minX, (double)boundingBox.maxZ, (double)boundingBox.maxZ);
    GL11.glVertex3d((double)boundingBox.maxZ, (double)boundingBox.maxZ, (double)boundingBox.maxZ);
    GL11.glVertex3d((double)boundingBox.maxZ, (double)boundingBox.maxZ, (double)boundingBox.maxZ);
    GL11.glVertex3d((double)boundingBox.minX, (double)boundingBox.maxZ, (double)boundingBox.maxZ);
    GL11.glVertex3d((double)boundingBox.minX, (double)boundingBox.maxZ, (double)boundingBox.maxZ);
    GL11.glEnd();
    GL11.glBegin((int)3);
    GL11.glVertex3d((double)boundingBox.minX, (double)boundingBox.maxZ, (double)boundingBox.maxZ);
    GL11.glVertex3d((double)boundingBox.maxZ, (double)boundingBox.maxZ, (double)boundingBox.maxZ);
    GL11.glVertex3d((double)boundingBox.maxZ, (double)boundingBox.maxZ, (double)boundingBox.maxZ);
    GL11.glVertex3d((double)boundingBox.minX, (double)boundingBox.maxZ, (double)boundingBox.maxZ);
    GL11.glVertex3d((double)boundingBox.minX, (double)boundingBox.maxZ, (double)boundingBox.maxZ);
    GL11.glEnd();
    GL11.glBegin((int)1);
    GL11.glVertex3d((double)boundingBox.minX, (double)boundingBox.maxZ, (double)boundingBox.maxZ);
    GL11.glVertex3d((double)boundingBox.minX, (double)boundingBox.maxZ, (double)boundingBox.maxZ);
    GL11.glVertex3d((double)boundingBox.maxZ, (double)boundingBox.maxZ, (double)boundingBox.maxZ);
    GL11.glVertex3d((double)boundingBox.maxZ, (double)boundingBox.maxZ, (double)boundingBox.maxZ);
    GL11.glVertex3d((double)boundingBox.maxZ, (double)boundingBox.maxZ, (double)boundingBox.maxZ);
    GL11.glVertex3d((double)boundingBox.maxZ, (double)boundingBox.maxZ, (double)boundingBox.maxZ);
    GL11.glVertex3d((double)boundingBox.minX, (double)boundingBox.maxZ, (double)boundingBox.maxZ);
    GL11.glVertex3d((double)boundingBox.minX, (double)boundingBox.maxZ, (double)boundingBox.maxZ);
    GL11.glEnd();
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:30,代码来源:RenderUtils.java

示例11: drawBorderedRect

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

    final float f = (col1 >> 24 & 0xFF) / 255F;
    final float f1 = (col1 >> 16 & 0xFF) / 255F;
    final float f2 = (col1 >> 8 & 0xFF) / 255F;
    final float f3 = (col1 & 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.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.glPopMatrix();

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

示例12: drawGradientRect

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void drawGradientRect(float x, float y, float x1, float y1, int topColor, int bottomColor) {
    RenderUtils.enableGL2D();
    GL11.glShadeModel((int)7425);
    GL11.glBegin((int)7);
    RenderUtils.glColor(topColor);
    GL11.glVertex2f((float)x, (float)y1);
    GL11.glVertex2f((float)x1, (float)y1);
    RenderUtils.glColor(bottomColor);
    GL11.glVertex2f((float)x1, (float)y);
    GL11.glVertex2f((float)x, (float)y);
    GL11.glEnd();
    GL11.glShadeModel((int)7424);
    RenderUtils.disableGL2D();
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:15,代码来源:RenderUtils.java

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

示例14: drawScreen

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
@Override
public void drawScreen(int mouseX, int mouseY, float partialTicks)
{
	// middle
	int middleX = width / 2;
	int middleY = height / 2;
	
	// background positions
	int x1 = middleX - 100;
	int y1 = middleY + 15;
	int x2 = middleX + 100;
	int y2 = middleY + 26;
	
	// background
	GL11.glDisable(GL11.GL_TEXTURE_2D);
	GL11.glDisable(GL11.GL_CULL_FACE);
	GL11.glColor4f(0, 0, 0, 0.5F);
	GL11.glBegin(GL11.GL_QUADS);
	{
		GL11.glVertex2d(x1, y1);
		GL11.glVertex2d(x2, y1);
		GL11.glVertex2d(x2, y2);
		GL11.glVertex2d(x1, y2);
	}
	GL11.glEnd();
	GL11.glColor4f(1, 1, 1, 1);
	GL11.glEnable(GL11.GL_TEXTURE_2D);
	GL11.glEnable(GL11.GL_CULL_FACE);
	
	// name field
	nameField.drawTextBox();
	
	// buttons
	super.drawScreen(mouseX, mouseY, partialTicks);
}
 
开发者ID:Wurst-Imperium,项目名称:Wurst-MC-1.12,代码行数:36,代码来源:TemplateToolMod.java

示例15: renderTileEntityAt

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
@Override
public void renderTileEntityAt(TileEntityPictureFrameMultiple frame, double x, double y, double z,
		float partialTicks, int destroyStage) {
	if (frame.shouldrender) {
		// 1:normal 2:failtoload 3:loding
		int rendertype = 0;
		if (frame.istextureLoaded()) {
			if (frame.textureID != -1) {
				rendertype = 1;
			}
		} else {
			if (frame.hasImageName()) {
				if (frame.canLoadImage()) {
					frame.loadImage();
				}
				if (frame.isFailed()) {
					rendertype = 2;
				} else {
					rendertype = 3;
				}
			}
		}
		//render
		if (rendertype > 0) {
			boolean flippedX = false;
			boolean flippedY = false;
			GlStateManager.enableBlend();
			OpenGlHelper.glBlendFunc(770, 771, 1, 0);
			GlStateManager.disableLighting();
			GlStateManager.color(1, 1, 1, 1);

			switch (rendertype) {
			case 1:
				GlStateManager.bindTexture(frame.textureID);
				break;
			case 2:
				Minecraft.getMinecraft().getTextureManager().bindTexture(PictureFactory.FailToLoadImage);
				break;
			case 3:
				Minecraft.getMinecraft().getTextureManager().bindTexture(PictureFactory.LODINGIMAGE);
				break;
			default:
				return;
			}

			GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST);
			GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);

			GlStateManager.pushMatrix();
			GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5);

			EnumFacing direction = EnumFacing.getFront(frame.getBlockMetadata() & 3);
			EnumStateType stateType = EnumStateType.HANDGING;
			applyDirection(direction);
			GlStateManager.enableRescaleNormal();
			GL11.glTranslated(0, (frame.height - 1) * 0.5, (frame.width - 1) * -0.5);
			GL11.glScaled(1, frame.height - 0.4, frame.width - 0.4);
			GL11.glTranslated(-0.93, 0, 0);

			GL11.glBegin(GL11.GL_POLYGON);
			GL11.glNormal3f(1.0f, 0.0F, 0.0f);

			GL11.glTexCoord3f(flippedY ? 0 : 1, flippedX ? 0 : 1, 0);
			GL11.glVertex3f(0.5F, -0.5f, -0.5f);
			GL11.glTexCoord3f(flippedY ? 0 : 1, flippedX ? 1 : 0, 0);
			GL11.glVertex3f(0.5f, 0.5f, -0.5f);
			GL11.glTexCoord3f(flippedY ? 1 : 0, flippedX ? 1 : 0, 0);
			GL11.glVertex3f(0.5f, 0.5f, 0.5f);
			GL11.glTexCoord3f(flippedY ? 1 : 0, flippedX ? 0 : 1, 0);
			GL11.glVertex3f(0.5f, -0.5f, 0.5f);
			GL11.glEnd();
			GlStateManager.popMatrix();

			GlStateManager.disableRescaleNormal();
			GlStateManager.disableBlend();
			GlStateManager.enableLighting();
		}
	}
}
 
开发者ID:PorPit,项目名称:MineCamera,代码行数:80,代码来源:PictureFrameMultipleTileRenderer.java


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