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


Java GlStateManager.clear方法代碼示例

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


在下文中一共展示了GlStateManager.clear方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: updateAchievementWindowScale

import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
private void updateAchievementWindowScale()
{
    GlStateManager.viewport(0, 0, this.mc.displayWidth, this.mc.displayHeight);
    GlStateManager.matrixMode(5889);
    GlStateManager.loadIdentity();
    GlStateManager.matrixMode(5888);
    GlStateManager.loadIdentity();
    this.width = this.mc.displayWidth;
    this.height = this.mc.displayHeight;
    ScaledResolution scaledresolution = new ScaledResolution(this.mc);
    this.width = scaledresolution.getScaledWidth();
    this.height = scaledresolution.getScaledHeight();
    GlStateManager.clear(256);
    GlStateManager.matrixMode(5889);
    GlStateManager.loadIdentity();
    GlStateManager.ortho(0.0D, (double)this.width, (double)this.height, 0.0D, 1000.0D, 3000.0D);
    GlStateManager.matrixMode(5888);
    GlStateManager.loadIdentity();
    GlStateManager.translate(0.0F, 0.0F, -2000.0F);
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:21,代碼來源:GuiAchievement.java

示例2: setupOverlayRendering

import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
public static void setupOverlayRendering(double sw, double sh) {
    GlStateManager.clear(256);
    GlStateManager.matrixMode(GL11.GL_PROJECTION);
    GlStateManager.loadIdentity();
    GlStateManager.ortho(0.0D, sw, sh, 0.0D, 1000.0D, 3000.0D);
    GlStateManager.matrixMode(GL11.GL_MODELVIEW);
    GlStateManager.loadIdentity();
    GlStateManager.translate(0.0F, 0.0F, -2000.0F);
}
 
開發者ID:McJty,項目名稱:MeeCreeps,代碼行數:10,代碼來源:BalloonRenderer.java

示例3: displayString

import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
private void displayString(String message)
{
    this.currentlyDisplayedText = message;

    if (!this.mc.running)
    {
        if (!this.field_73724_e)
        {
            throw new MinecraftError();
        }
    }
    else
    {
        GlStateManager.clear(256);
        GlStateManager.matrixMode(5889);
        GlStateManager.loadIdentity();

        if (OpenGlHelper.isFramebufferEnabled())
        {
            int i = this.scaledResolution.getScaleFactor();
            GlStateManager.ortho(0.0D, (double)(this.scaledResolution.getScaledWidth() * i), (double)(this.scaledResolution.getScaledHeight() * i), 0.0D, 100.0D, 300.0D);
        }
        else
        {
            ScaledResolution scaledresolution = new ScaledResolution(this.mc);
            GlStateManager.ortho(0.0D, scaledresolution.getScaledWidth_double(), scaledresolution.getScaledHeight_double(), 0.0D, 100.0D, 300.0D);
        }

        GlStateManager.matrixMode(5888);
        GlStateManager.loadIdentity();
        GlStateManager.translate(0.0F, 0.0F, -200.0F);
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:34,代碼來源:LoadingScreenRenderer.java

示例4: framebufferClear

import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
public void framebufferClear()
{
    this.bindFramebuffer(true);
    GlStateManager.clearColor(this.framebufferColor[0], this.framebufferColor[1], this.framebufferColor[2], this.framebufferColor[3]);
    int i = 16384;

    if (this.useDepth)
    {
        GlStateManager.clearDepth(1.0D);
        i |= 256;
    }

    GlStateManager.clear(i);
    this.unbindFramebuffer();
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:16,代碼來源:Framebuffer.java

示例5: displayString

import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
private void displayString(String message)
{
    this.currentlyDisplayedText = message;

    if (!this.mc.running)
    {
        if (!this.loadingSuccess)
        {
            throw new MinecraftError();
        }
    }
    else
    {
        GlStateManager.clear(256);
        GlStateManager.matrixMode(5889);
        GlStateManager.loadIdentity();

        if (OpenGlHelper.isFramebufferEnabled())
        {
            int i = this.scaledResolution.getScaleFactor();
            GlStateManager.ortho(0.0D, (double)(this.scaledResolution.getScaledWidth() * i), (double)(this.scaledResolution.getScaledHeight() * i), 0.0D, 100.0D, 300.0D);
        }
        else
        {
            ScaledResolution scaledresolution = new ScaledResolution(this.mc);
            GlStateManager.ortho(0.0D, scaledresolution.getScaledWidth_double(), scaledresolution.getScaledHeight_double(), 0.0D, 100.0D, 300.0D);
        }

        GlStateManager.matrixMode(5888);
        GlStateManager.loadIdentity();
        GlStateManager.translate(0.0F, 0.0F, -200.0F);
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:34,代碼來源:LoadingScreenRenderer.java

示例6: showLagometer

import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
public static void showLagometer(ScaledResolution p_showLagometer_0_)
{
    if (gameSettings != null)
    {
        if (gameSettings.ofLagometer || gameSettings.field_181657_aC)
        {
            long i = System.nanoTime();
            GlStateManager.clear(256);
            GlStateManager.matrixMode(5889);
            GlStateManager.pushMatrix();
            GlStateManager.enableColorMaterial();
            GlStateManager.loadIdentity();
            GlStateManager.ortho(0.0D, (double)mc.displayWidth, (double)mc.displayHeight, 0.0D, 1000.0D, 3000.0D);
            GlStateManager.matrixMode(5888);
            GlStateManager.pushMatrix();
            GlStateManager.loadIdentity();
            GlStateManager.translate(0.0F, 0.0F, -2000.0F);
            GL11.glLineWidth(1.0F);
            GlStateManager.disableTexture2D();
            Tessellator tessellator = Tessellator.getInstance();
            WorldRenderer worldrenderer = tessellator.getWorldRenderer();
            worldrenderer.begin(1, DefaultVertexFormats.POSITION_COLOR);

            for (int j = 0; j < timesFrame.length; ++j)
            {
                int k = (j - numRecordedFrameTimes & timesFrame.length - 1) * 100 / timesFrame.length;
                k = k + 155;
                float f = (float)mc.displayHeight;
                long l = 0L;

                if (gcs[j])
                {
                    renderTime(j, timesFrame[j], k, k / 2, 0, f, worldrenderer);
                }
                else
                {
                    renderTime(j, timesFrame[j], k, k, k, f, worldrenderer);
                    f = f - (float)renderTime(j, timesServer[j], k / 2, k / 2, k / 2, f, worldrenderer);
                    f = f - (float)renderTime(j, timesTerrain[j], 0, k, 0, f, worldrenderer);
                    f = f - (float)renderTime(j, timesVisibility[j], k, k, 0, f, worldrenderer);
                    f = f - (float)renderTime(j, timesChunkUpdate[j], k, 0, 0, f, worldrenderer);
                    f = f - (float)renderTime(j, timesChunkUpload[j], k, 0, k, f, worldrenderer);
                    f = f - (float)renderTime(j, timesScheduledExecutables[j], 0, 0, k, f, worldrenderer);
                    float f2 = f - (float)renderTime(j, timesTick[j], 0, k, k, f, worldrenderer);
                }
            }

            renderTimeDivider(0, timesFrame.length, 33333333L, 196, 196, 196, (float)mc.displayHeight, worldrenderer);
            renderTimeDivider(0, timesFrame.length, 16666666L, 196, 196, 196, (float)mc.displayHeight, worldrenderer);
            tessellator.draw();
            GlStateManager.enableTexture2D();
            int j2 = mc.displayHeight - 80;
            int k2 = mc.displayHeight - 160;
            mc.fontRendererObj.drawString("30", 2, k2 + 1, -8947849);
            mc.fontRendererObj.drawString("30", 1, k2, -3881788);
            mc.fontRendererObj.drawString("60", 2, j2 + 1, -8947849);
            mc.fontRendererObj.drawString("60", 1, j2, -3881788);
            GlStateManager.matrixMode(5889);
            GlStateManager.popMatrix();
            GlStateManager.matrixMode(5888);
            GlStateManager.popMatrix();
            GlStateManager.enableTexture2D();
            float f1 = 1.0F - (float)((double)(System.currentTimeMillis() - memTimeStartMs) / 1000.0D);
            f1 = Config.limit(f1, 0.0F, 1.0F);
            int l2 = (int)(170.0F + f1 * 85.0F);
            int i1 = (int)(100.0F + f1 * 55.0F);
            int j1 = (int)(10.0F + f1 * 10.0F);
            int k1 = l2 << 16 | i1 << 8 | j1;
            int l1 = 512 / p_showLagometer_0_.getScaleFactor() + 2;
            int i2 = mc.displayHeight / p_showLagometer_0_.getScaleFactor() - 8;
            GuiIngame guiingame = mc.ingameGUI;
            GuiIngame.drawRect(l1 - 1, i2 - 1, l1 + 50, i2 + 10, -1605349296);
            mc.fontRendererObj.drawString(" " + memMbSec + " MB/s", l1, i2, k1);
            renderTimeNano = System.nanoTime() - i;
        }
    }
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:78,代碼來源:Lagometer.java

示例7: showLagometer

import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
public static void showLagometer(ScaledResolution p_showLagometer_0_)
{
    if (gameSettings != null && gameSettings.ofLagometer)
    {
        long i = System.nanoTime();
        GlStateManager.clear(256);
        GlStateManager.matrixMode(5889);
        GlStateManager.pushMatrix();
        GlStateManager.enableColorMaterial();
        GlStateManager.loadIdentity();
        GlStateManager.ortho(0.0D, (double)mc.displayWidth, (double)mc.displayHeight, 0.0D, 1000.0D, 3000.0D);
        GlStateManager.matrixMode(5888);
        GlStateManager.pushMatrix();
        GlStateManager.loadIdentity();
        GlStateManager.translate(0.0F, 0.0F, -2000.0F);
        GL11.glLineWidth(1.0F);
        GlStateManager.disableTexture2D();
        Tessellator tessellator = Tessellator.getInstance();
        WorldRenderer worldrenderer = tessellator.getWorldRenderer();
        worldrenderer.begin(1, DefaultVertexFormats.POSITION_COLOR);

        for (int j = 0; j < timesFrame.length; ++j)
        {
            int k = (j - numRecordedFrameTimes & timesFrame.length - 1) * 100 / timesFrame.length;
            k = k + 155;
            float f = (float)mc.displayHeight;
            long l = 0L;

            if (gcs[j])
            {
                renderTime(j, timesFrame[j], k, k / 2, 0, f, worldrenderer);
            }
            else
            {
                renderTime(j, timesFrame[j], k, k, k, f, worldrenderer);
                f = f - (float)renderTime(j, timesServer[j], k / 2, k / 2, k / 2, f, worldrenderer);
                f = f - (float)renderTime(j, timesTerrain[j], 0, k, 0, f, worldrenderer);
                f = f - (float)renderTime(j, timesVisibility[j], k, k, 0, f, worldrenderer);
                f = f - (float)renderTime(j, timesChunkUpdate[j], k, 0, 0, f, worldrenderer);
                f = f - (float)renderTime(j, timesChunkUpload[j], k, 0, k, f, worldrenderer);
                f = f - (float)renderTime(j, timesScheduledExecutables[j], 0, 0, k, f, worldrenderer);
                float f2 = f - (float)renderTime(j, timesTick[j], 0, k, k, f, worldrenderer);
            }
        }

        tessellator.draw();
        GlStateManager.matrixMode(5889);
        GlStateManager.popMatrix();
        GlStateManager.matrixMode(5888);
        GlStateManager.popMatrix();
        GlStateManager.enableTexture2D();
        float f1 = 1.0F - (float)((double)(System.currentTimeMillis() - memTimeStartMs) / 1000.0D);
        f1 = Config.limit(f1, 0.0F, 1.0F);
        int l1 = (int)(170.0F + f1 * 85.0F);
        int i2 = (int)(100.0F + f1 * 55.0F);
        int j2 = (int)(10.0F + f1 * 10.0F);
        int i1 = l1 << 16 | i2 << 8 | j2;
        int j1 = 512 / p_showLagometer_0_.getScaleFactor() + 2;
        int k1 = mc.displayHeight / p_showLagometer_0_.getScaleFactor() - 8;
        GuiIngame guiingame = mc.ingameGUI;
        GuiIngame.drawRect(j1 - 1, k1 - 1, j1 + 50, k1 + 10, -1605349296);
        mc.fontRendererObj.drawString(" " + memMbSec + " MB/s", j1, k1, i1);
        renderTimeNano = System.nanoTime() - i;
    }
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:66,代碼來源:Lagometer.java

示例8: showLagometer

import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
public static void showLagometer(ScaledResolution p_showLagometer_0_)
{
    if (gameSettings != null)
    {
        if (gameSettings.ofLagometer || gameSettings.showLagometer)
        {
            long i = System.nanoTime();
            GlStateManager.clear(256);
            GlStateManager.matrixMode(5889);
            GlStateManager.pushMatrix();
            GlStateManager.enableColorMaterial();
            GlStateManager.loadIdentity();
            GlStateManager.ortho(0.0D, (double)mc.displayWidth, (double)mc.displayHeight, 0.0D, 1000.0D, 3000.0D);
            GlStateManager.matrixMode(5888);
            GlStateManager.pushMatrix();
            GlStateManager.loadIdentity();
            GlStateManager.translate(0.0F, 0.0F, -2000.0F);
            GL11.glLineWidth(1.0F);
            GlStateManager.disableTexture2D();
            Tessellator tessellator = Tessellator.getInstance();
            VertexBuffer vertexbuffer = tessellator.getBuffer();
            vertexbuffer.begin(1, DefaultVertexFormats.POSITION_COLOR);

            for (int j = 0; j < timesFrame.length; ++j)
            {
                int k = (j - numRecordedFrameTimes & timesFrame.length - 1) * 100 / timesFrame.length;
                k = k + 155;
                float f = (float)mc.displayHeight;
                long l = 0L;

                if (gcs[j])
                {
                    renderTime(j, timesFrame[j], k, k / 2, 0, f, vertexbuffer);
                }
                else
                {
                    renderTime(j, timesFrame[j], k, k, k, f, vertexbuffer);
                    f = f - (float)renderTime(j, timesServer[j], k / 2, k / 2, k / 2, f, vertexbuffer);
                    f = f - (float)renderTime(j, timesTerrain[j], 0, k, 0, f, vertexbuffer);
                    f = f - (float)renderTime(j, timesVisibility[j], k, k, 0, f, vertexbuffer);
                    f = f - (float)renderTime(j, timesChunkUpdate[j], k, 0, 0, f, vertexbuffer);
                    f = f - (float)renderTime(j, timesChunkUpload[j], k, 0, k, f, vertexbuffer);
                    f = f - (float)renderTime(j, timesScheduledExecutables[j], 0, 0, k, f, vertexbuffer);
                    float f2 = f - (float)renderTime(j, timesTick[j], 0, k, k, f, vertexbuffer);
                }
            }

            renderTimeDivider(0, timesFrame.length, 33333333L, 196, 196, 196, (float)mc.displayHeight, vertexbuffer);
            renderTimeDivider(0, timesFrame.length, 16666666L, 196, 196, 196, (float)mc.displayHeight, vertexbuffer);
            tessellator.draw();
            GlStateManager.enableTexture2D();
            int j2 = mc.displayHeight - 80;
            int k2 = mc.displayHeight - 160;
            mc.fontRendererObj.drawString("30", 2, k2 + 1, -8947849);
            mc.fontRendererObj.drawString("30", 1, k2, -3881788);
            mc.fontRendererObj.drawString("60", 2, j2 + 1, -8947849);
            mc.fontRendererObj.drawString("60", 1, j2, -3881788);
            GlStateManager.matrixMode(5889);
            GlStateManager.popMatrix();
            GlStateManager.matrixMode(5888);
            GlStateManager.popMatrix();
            GlStateManager.enableTexture2D();
            float f1 = 1.0F - (float)((double)(System.currentTimeMillis() - memTimeStartMs) / 1000.0D);
            f1 = Config.limit(f1, 0.0F, 1.0F);
            int l2 = (int)(170.0F + f1 * 85.0F);
            int i1 = (int)(100.0F + f1 * 55.0F);
            int j1 = (int)(10.0F + f1 * 10.0F);
            int k1 = l2 << 16 | i1 << 8 | j1;
            int l1 = 512 / p_showLagometer_0_.getScaleFactor() + 2;
            int i2 = mc.displayHeight / p_showLagometer_0_.getScaleFactor() - 8;
            GuiIngame guiingame = mc.ingameGUI;
            GuiIngame.drawRect(l1 - 1, i2 - 1, l1 + 50, i2 + 10, -1605349296);
            mc.fontRendererObj.drawString(" " + memMbSec + " MB/s", l1, i2, k1);
            renderTimeNano = System.nanoTime() - i;
        }
    }
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:78,代碼來源:Lagometer.java


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