本文整理匯總了Java中net.minecraft.client.renderer.GlStateManager.glEnd方法的典型用法代碼示例。如果您正苦於以下問題:Java GlStateManager.glEnd方法的具體用法?Java GlStateManager.glEnd怎麽用?Java GlStateManager.glEnd使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.client.renderer.GlStateManager
的用法示例。
在下文中一共展示了GlStateManager.glEnd方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: renderDefaultChar
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
/**
* Render a single character with the default.png font at current (posX,posY) location...
*/
private float renderDefaultChar(int ch, boolean italic)
{
int i = ch % 16 * 8;
int j = ch / 16 * 8;
int k = italic ? 1 : 0;
this.bindTexture(this.locationFontTexture);
float f = this.charWidthFloat[ch];
float f1 = 7.99F;
GlStateManager.glBegin(5);
GlStateManager.glTexCoord2f((float)i / 128.0F, (float)j / 128.0F);
GlStateManager.glVertex3f(this.posX + (float)k, this.posY, 0.0F);
GlStateManager.glTexCoord2f((float)i / 128.0F, ((float)j + 7.99F) / 128.0F);
GlStateManager.glVertex3f(this.posX - (float)k, this.posY + 7.99F, 0.0F);
GlStateManager.glTexCoord2f(((float)i + f1 - 1.0F) / 128.0F, (float)j / 128.0F);
GlStateManager.glVertex3f(this.posX + f1 - 1.0F + (float)k, this.posY, 0.0F);
GlStateManager.glTexCoord2f(((float)i + f1 - 1.0F) / 128.0F, ((float)j + 7.99F) / 128.0F);
GlStateManager.glVertex3f(this.posX + f1 - 1.0F - (float)k, this.posY + 7.99F, 0.0F);
GlStateManager.glEnd();
return f;
}
示例2: renderDefaultChar
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
/**
* Render a single character with the default.png font at current (posX,posY) location...
*/
protected float renderDefaultChar(int ch, boolean italic)
{
int i = ch % 16 * 8;
int j = ch / 16 * 8;
int k = italic ? 1 : 0;
bindTexture(this.locationFontTexture);
int l = this.charWidth[ch];
float f = (float)l - 0.01F;
GlStateManager.glBegin(5);
GlStateManager.glTexCoord2f((float)i / 128.0F, (float)j / 128.0F);
GlStateManager.glVertex3f(this.posX + (float)k, this.posY, 0.0F);
GlStateManager.glTexCoord2f((float)i / 128.0F, ((float)j + 7.99F) / 128.0F);
GlStateManager.glVertex3f(this.posX - (float)k, this.posY + 7.99F, 0.0F);
GlStateManager.glTexCoord2f(((float)i + f - 1.0F) / 128.0F, (float)j / 128.0F);
GlStateManager.glVertex3f(this.posX + f - 1.0F + (float)k, this.posY, 0.0F);
GlStateManager.glTexCoord2f(((float)i + f - 1.0F) / 128.0F, ((float)j + 7.99F) / 128.0F);
GlStateManager.glVertex3f(this.posX + f - 1.0F - (float)k, this.posY + 7.99F, 0.0F);
GlStateManager.glEnd();
return (float)l;
}
示例3: renderUnicodeChar
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
/**
* Render a single Unicode character at current (posX,posY) location using one of the /font/glyph_XX.png files...
*/
private float renderUnicodeChar(char ch, boolean italic)
{
int i = this.glyphWidth[ch] & 255;
if (i == 0)
{
return 0.0F;
}
else
{
int j = ch / 256;
this.loadGlyphTexture(j);
int k = i >>> 4;
int l = i & 15;
float f = (float)k;
float f1 = (float)(l + 1);
float f2 = (float)(ch % 16 * 16) + f;
float f3 = (float)((ch & 255) / 16 * 16);
float f4 = f1 - f - 0.02F;
float f5 = italic ? 1.0F : 0.0F;
GlStateManager.glBegin(5);
GlStateManager.glTexCoord2f(f2 / 256.0F, f3 / 256.0F);
GlStateManager.glVertex3f(this.posX + f5, this.posY, 0.0F);
GlStateManager.glTexCoord2f(f2 / 256.0F, (f3 + 15.98F) / 256.0F);
GlStateManager.glVertex3f(this.posX - f5, this.posY + 7.99F, 0.0F);
GlStateManager.glTexCoord2f((f2 + f4) / 256.0F, f3 / 256.0F);
GlStateManager.glVertex3f(this.posX + f4 / 2.0F + f5, this.posY, 0.0F);
GlStateManager.glTexCoord2f((f2 + f4) / 256.0F, (f3 + 15.98F) / 256.0F);
GlStateManager.glVertex3f(this.posX + f4 / 2.0F - f5, this.posY + 7.99F, 0.0F);
GlStateManager.glEnd();
return (f1 - f) / 2.0F + 1.0F;
}
}
示例4: renderUnicodeChar
import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
/**
* Render a single Unicode character at current (posX,posY) location using one of the /font/glyph_XX.png files...
*/
protected float renderUnicodeChar(char ch, boolean italic)
{
int i = this.glyphWidth[ch] & 255;
if (i == 0)
{
return 0.0F;
}
else
{
int j = ch / 256;
this.loadGlyphTexture(j);
int k = i >>> 4;
int l = i & 15;
float f = (float)k;
float f1 = (float)(l + 1);
float f2 = (float)(ch % 16 * 16) + f;
float f3 = (float)((ch & 255) / 16 * 16);
float f4 = f1 - f - 0.02F;
float f5 = italic ? 1.0F : 0.0F;
GlStateManager.glBegin(5);
GlStateManager.glTexCoord2f(f2 / 256.0F, f3 / 256.0F);
GlStateManager.glVertex3f(this.posX + f5, this.posY, 0.0F);
GlStateManager.glTexCoord2f(f2 / 256.0F, (f3 + 15.98F) / 256.0F);
GlStateManager.glVertex3f(this.posX - f5, this.posY + 7.99F, 0.0F);
GlStateManager.glTexCoord2f((f2 + f4) / 256.0F, f3 / 256.0F);
GlStateManager.glVertex3f(this.posX + f4 / 2.0F + f5, this.posY, 0.0F);
GlStateManager.glTexCoord2f((f2 + f4) / 256.0F, (f3 + 15.98F) / 256.0F);
GlStateManager.glVertex3f(this.posX + f4 / 2.0F - f5, this.posY + 7.99F, 0.0F);
GlStateManager.glEnd();
return (f1 - f) / 2.0F + 1.0F;
}
}