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