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


Java GlStateManager.glTexCoord2f方法代碼示例

本文整理匯總了Java中net.minecraft.client.renderer.GlStateManager.glTexCoord2f方法的典型用法代碼示例。如果您正苦於以下問題:Java GlStateManager.glTexCoord2f方法的具體用法?Java GlStateManager.glTexCoord2f怎麽用?Java GlStateManager.glTexCoord2f使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraft.client.renderer.GlStateManager的用法示例。


在下文中一共展示了GlStateManager.glTexCoord2f方法的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;
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:24,代碼來源:FontRenderer.java

示例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;
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:24,代碼來源:FontRenderer.java

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

示例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;
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:37,代碼來源:FontRenderer.java


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