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


Java GlStateManager.ortho方法代码示例

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


在下文中一共展示了GlStateManager.ortho方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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:F1r3w477,项目名称:CustomWorldGen,代码行数: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: 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:F1r3w477,项目名称:CustomWorldGen,代码行数:34,代码来源:LoadingScreenRenderer.java

示例5: framebufferRenderExt

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public void framebufferRenderExt(int width, int height, boolean p_178038_3_)
{
    if (OpenGlHelper.isFramebufferEnabled())
    {
        GlStateManager.colorMask(true, true, true, false);
        GlStateManager.disableDepth();
        GlStateManager.depthMask(false);
        GlStateManager.matrixMode(5889);
        GlStateManager.loadIdentity();
        GlStateManager.ortho(0.0D, (double)width, (double)height, 0.0D, 1000.0D, 3000.0D);
        GlStateManager.matrixMode(5888);
        GlStateManager.loadIdentity();
        GlStateManager.translate(0.0F, 0.0F, -2000.0F);
        GlStateManager.viewport(0, 0, width, height);
        GlStateManager.enableTexture2D();
        GlStateManager.disableLighting();
        GlStateManager.disableAlpha();

        if (p_178038_3_)
        {
            GlStateManager.disableBlend();
            GlStateManager.enableColorMaterial();
        }

        GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
        this.bindFramebufferTexture();
        float f = (float)width;
        float f1 = (float)height;
        float f2 = (float)this.framebufferWidth / (float)this.framebufferTextureWidth;
        float f3 = (float)this.framebufferHeight / (float)this.framebufferTextureHeight;
        Tessellator tessellator = Tessellator.getInstance();
        VertexBuffer vertexbuffer = tessellator.getBuffer();
        vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
        vertexbuffer.pos(0.0D, (double)f1, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex();
        vertexbuffer.pos((double)f, (double)f1, 0.0D).tex((double)f2, 0.0D).color(255, 255, 255, 255).endVertex();
        vertexbuffer.pos((double)f, 0.0D, 0.0D).tex((double)f2, (double)f3).color(255, 255, 255, 255).endVertex();
        vertexbuffer.pos(0.0D, 0.0D, 0.0D).tex(0.0D, (double)f3).color(255, 255, 255, 255).endVertex();
        tessellator.draw();
        this.unbindFramebufferTexture();
        GlStateManager.depthMask(true);
        GlStateManager.colorMask(true, true, true, true);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:44,代码来源:Framebuffer.java

示例6: framebufferRenderExt

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public void framebufferRenderExt(int p_178038_1_, int p_178038_2_, boolean p_178038_3_)
{
    if (OpenGlHelper.isFramebufferEnabled())
    {
        GlStateManager.colorMask(true, true, true, false);
        GlStateManager.disableDepth();
        GlStateManager.depthMask(false);
        GlStateManager.matrixMode(5889);
        GlStateManager.loadIdentity();
        GlStateManager.ortho(0.0D, (double)p_178038_1_, (double)p_178038_2_, 0.0D, 1000.0D, 3000.0D);
        GlStateManager.matrixMode(5888);
        GlStateManager.loadIdentity();
        GlStateManager.translate(0.0F, 0.0F, -2000.0F);
        GlStateManager.viewport(0, 0, p_178038_1_, p_178038_2_);
        GlStateManager.enableTexture2D();
        GlStateManager.disableLighting();
        GlStateManager.disableAlpha();

        if (p_178038_3_)
        {
            GlStateManager.disableBlend();
            GlStateManager.enableColorMaterial();
        }

        GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
        this.bindFramebufferTexture();
        float f = (float)p_178038_1_;
        float f1 = (float)p_178038_2_;
        float f2 = (float)this.framebufferWidth / (float)this.framebufferTextureWidth;
        float f3 = (float)this.framebufferHeight / (float)this.framebufferTextureHeight;
        Tessellator tessellator = Tessellator.getInstance();
        WorldRenderer worldrenderer = tessellator.getWorldRenderer();
        worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
        worldrenderer.pos(0.0D, (double)f1, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex();
        worldrenderer.pos((double)f, (double)f1, 0.0D).tex((double)f2, 0.0D).color(255, 255, 255, 255).endVertex();
        worldrenderer.pos((double)f, 0.0D, 0.0D).tex((double)f2, (double)f3).color(255, 255, 255, 255).endVertex();
        worldrenderer.pos(0.0D, 0.0D, 0.0D).tex(0.0D, (double)f3).color(255, 255, 255, 255).endVertex();
        tessellator.draw();
        this.unbindFramebufferTexture();
        GlStateManager.depthMask(true);
        GlStateManager.colorMask(true, true, true, true);
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:44,代码来源:Framebuffer.java

示例7: drawSplashScreen

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
private void drawSplashScreen(TextureManager textureManagerInstance) throws LWJGLException
{
    ScaledResolution scaledresolution = new ScaledResolution(this);
    int i = scaledresolution.getScaleFactor();
    Framebuffer framebuffer = new Framebuffer(scaledresolution.getScaledWidth() * i, scaledresolution.getScaledHeight() * i, true);
    framebuffer.bindFramebuffer(false);
    GlStateManager.matrixMode(5889);
    GlStateManager.loadIdentity();
    GlStateManager.ortho(0.0D, (double)scaledresolution.getScaledWidth(), (double)scaledresolution.getScaledHeight(), 0.0D, 1000.0D, 3000.0D);
    GlStateManager.matrixMode(5888);
    GlStateManager.loadIdentity();
    GlStateManager.translate(0.0F, 0.0F, -2000.0F);
    GlStateManager.disableLighting();
    GlStateManager.disableFog();
    GlStateManager.disableDepth();
    GlStateManager.enableTexture2D();
    InputStream inputstream = null;

    try
    {
        inputstream = this.mcDefaultResourcePack.getInputStream(LOCATION_MOJANG_PNG);
        this.mojangLogo = textureManagerInstance.getDynamicTextureLocation("logo", new DynamicTexture(ImageIO.read(inputstream)));
        textureManagerInstance.bindTexture(this.mojangLogo);
    }
    catch (IOException ioexception)
    {
        LOGGER.error("Unable to load logo: {}", new Object[] {LOCATION_MOJANG_PNG, ioexception});
    }
    finally
    {
        IOUtils.closeQuietly(inputstream);
    }

    Tessellator tessellator = Tessellator.getInstance();
    VertexBuffer vertexbuffer = tessellator.getBuffer();
    vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
    vertexbuffer.pos(0.0D, (double)this.displayHeight, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex();
    vertexbuffer.pos((double)this.displayWidth, (double)this.displayHeight, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex();
    vertexbuffer.pos((double)this.displayWidth, 0.0D, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex();
    vertexbuffer.pos(0.0D, 0.0D, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex();
    tessellator.draw();
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    int j = 256;
    int k = 256;
    this.draw((scaledresolution.getScaledWidth() - 256) / 2, (scaledresolution.getScaledHeight() - 256) / 2, 0, 0, 256, 256, 255, 255, 255, 255);
    GlStateManager.disableLighting();
    GlStateManager.disableFog();
    framebuffer.unbindFramebuffer();
    framebuffer.framebufferRender(scaledresolution.getScaledWidth() * i, scaledresolution.getScaledHeight() * i);
    GlStateManager.enableAlpha();
    GlStateManager.alphaFunc(516, 0.1F);
    this.updateDisplay();
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:54,代码来源:Minecraft.java

示例8: drawSplashScreen

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
private void drawSplashScreen(TextureManager textureManagerInstance) throws LWJGLException
{
    ScaledResolution scaledresolution = new ScaledResolution(this);
    int i = scaledresolution.getScaleFactor();
    Framebuffer framebuffer = new Framebuffer(scaledresolution.getScaledWidth() * i, scaledresolution.getScaledHeight() * i, true);
    framebuffer.bindFramebuffer(false);
    GlStateManager.matrixMode(5889);
    GlStateManager.loadIdentity();
    GlStateManager.ortho(0.0D, (double)scaledresolution.getScaledWidth(), (double)scaledresolution.getScaledHeight(), 0.0D, 1000.0D, 3000.0D);
    GlStateManager.matrixMode(5888);
    GlStateManager.loadIdentity();
    GlStateManager.translate(0.0F, 0.0F, -2000.0F);
    GlStateManager.disableLighting();
    GlStateManager.disableFog();
    GlStateManager.disableDepth();
    GlStateManager.enableTexture2D();
    InputStream inputstream = null;

    try
    {
        inputstream = this.mcDefaultResourcePack.getInputStream(locationMojangPng);
        this.mojangLogo = textureManagerInstance.getDynamicTextureLocation("logo", new DynamicTexture(ImageIO.read(inputstream)));
        textureManagerInstance.bindTexture(this.mojangLogo);
    }
    catch (IOException ioexception)
    {
        logger.error((String)("Unable to load logo: " + locationMojangPng), (Throwable)ioexception);
    }
    finally
    {
        IOUtils.closeQuietly(inputstream);
    }

    Tessellator tessellator = Tessellator.getInstance();
    WorldRenderer worldrenderer = tessellator.getWorldRenderer();
    worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
    worldrenderer.pos(0.0D, (double)this.displayHeight, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex();
    worldrenderer.pos((double)this.displayWidth, (double)this.displayHeight, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex();
    worldrenderer.pos((double)this.displayWidth, 0.0D, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex();
    worldrenderer.pos(0.0D, 0.0D, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex();
    tessellator.draw();
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    int j = 256;
    int k = 256;
    this.func_181536_a((scaledresolution.getScaledWidth() - j) / 2, (scaledresolution.getScaledHeight() - k) / 2, 0, 0, j, k, 255, 255, 255, 255);
    GlStateManager.disableLighting();
    GlStateManager.disableFog();
    framebuffer.unbindFramebuffer();
    framebuffer.framebufferRender(scaledresolution.getScaledWidth() * i, scaledresolution.getScaledHeight() * i);
    GlStateManager.enableAlpha();
    GlStateManager.alphaFunc(516, 0.1F);
    this.updateDisplay();
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:54,代码来源:Minecraft.java

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

示例10: func_152922_k

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public void func_152922_k()
{
    if (this.broadcastController.isBroadcasting() && !this.broadcastController.isBroadcastPaused())
    {
        long i = System.nanoTime();
        long j = (long)(1000000000 / this.targetFPS);
        long k = i - this.field_152959_k;
        boolean flag = k >= j;

        if (flag)
        {
            FrameBuffer framebuffer = this.broadcastController.func_152822_N();
            Framebuffer framebuffer1 = this.mc.getFramebuffer();
            this.framebuffer.bindFramebuffer(true);
            GlStateManager.matrixMode(5889);
            GlStateManager.pushMatrix();
            GlStateManager.loadIdentity();
            GlStateManager.ortho(0.0D, (double)this.framebuffer.framebufferWidth, (double)this.framebuffer.framebufferHeight, 0.0D, 1000.0D, 3000.0D);
            GlStateManager.matrixMode(5888);
            GlStateManager.pushMatrix();
            GlStateManager.loadIdentity();
            GlStateManager.translate(0.0F, 0.0F, -2000.0F);
            GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
            GlStateManager.viewport(0, 0, this.framebuffer.framebufferWidth, this.framebuffer.framebufferHeight);
            GlStateManager.enableTexture2D();
            GlStateManager.disableAlpha();
            GlStateManager.disableBlend();
            float f = (float)this.framebuffer.framebufferWidth;
            float f1 = (float)this.framebuffer.framebufferHeight;
            float f2 = (float)framebuffer1.framebufferWidth / (float)framebuffer1.framebufferTextureWidth;
            float f3 = (float)framebuffer1.framebufferHeight / (float)framebuffer1.framebufferTextureHeight;
            framebuffer1.bindFramebufferTexture();
            GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, 9729.0F);
            GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, 9729.0F);
            Tessellator tessellator = Tessellator.getInstance();
            WorldRenderer worldrenderer = tessellator.getWorldRenderer();
            worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
            worldrenderer.pos(0.0D, (double)f1, 0.0D).tex(0.0D, (double)f3).endVertex();
            worldrenderer.pos((double)f, (double)f1, 0.0D).tex((double)f2, (double)f3).endVertex();
            worldrenderer.pos((double)f, 0.0D, 0.0D).tex((double)f2, 0.0D).endVertex();
            worldrenderer.pos(0.0D, 0.0D, 0.0D).tex(0.0D, 0.0D).endVertex();
            tessellator.draw();
            framebuffer1.unbindFramebufferTexture();
            GlStateManager.popMatrix();
            GlStateManager.matrixMode(5889);
            GlStateManager.popMatrix();
            GlStateManager.matrixMode(5888);
            this.broadcastController.captureFramebuffer(framebuffer);
            this.framebuffer.unbindFramebuffer();
            this.broadcastController.submitStreamFrame(framebuffer);
            this.field_152959_k = i;
        }
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:55,代码来源:TwitchStream.java

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

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

示例13: drawSplashScreen

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public void drawSplashScreen(TextureManager textureManagerInstance) throws LWJGLException
{
    ScaledResolution scaledresolution = new ScaledResolution(this);
    int i = scaledresolution.getScaleFactor();
    Framebuffer framebuffer = new Framebuffer(scaledresolution.getScaledWidth() * i, scaledresolution.getScaledHeight() * i, true);
    framebuffer.bindFramebuffer(false);
    GlStateManager.matrixMode(5889);
    GlStateManager.loadIdentity();
    GlStateManager.ortho(0.0D, (double)scaledresolution.getScaledWidth(), (double)scaledresolution.getScaledHeight(), 0.0D, 1000.0D, 3000.0D);
    GlStateManager.matrixMode(5888);
    GlStateManager.loadIdentity();
    GlStateManager.translate(0.0F, 0.0F, -2000.0F);
    GlStateManager.disableLighting();
    GlStateManager.disableFog();
    GlStateManager.disableDepth();
    GlStateManager.enableTexture2D();
    InputStream inputstream = null;

    try
    {
        inputstream = this.mcDefaultResourcePack.getInputStream(LOCATION_MOJANG_PNG);
        this.mojangLogo = textureManagerInstance.getDynamicTextureLocation("logo", new DynamicTexture(ImageIO.read(inputstream)));
        textureManagerInstance.bindTexture(this.mojangLogo);
    }
    catch (IOException ioexception)
    {
        LOGGER.error("Unable to load logo: {}", new Object[] {LOCATION_MOJANG_PNG, ioexception});
    }
    finally
    {
        IOUtils.closeQuietly(inputstream);
    }

    Tessellator tessellator = Tessellator.getInstance();
    VertexBuffer vertexbuffer = tessellator.getBuffer();
    vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
    vertexbuffer.pos(0.0D, (double)this.displayHeight, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex();
    vertexbuffer.pos((double)this.displayWidth, (double)this.displayHeight, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex();
    vertexbuffer.pos((double)this.displayWidth, 0.0D, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex();
    vertexbuffer.pos(0.0D, 0.0D, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex();
    tessellator.draw();
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    int j = 256;
    int k = 256;
    this.draw((scaledresolution.getScaledWidth() - 256) / 2, (scaledresolution.getScaledHeight() - 256) / 2, 0, 0, 256, 256, 255, 255, 255, 255);
    GlStateManager.disableLighting();
    GlStateManager.disableFog();
    framebuffer.unbindFramebuffer();
    framebuffer.framebufferRender(scaledresolution.getScaledWidth() * i, scaledresolution.getScaledHeight() * i);
    GlStateManager.enableAlpha();
    GlStateManager.alphaFunc(516, 0.1F);
    this.updateDisplay();
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:54,代码来源:Minecraft.java

示例14: drawSplashScreen

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
private void drawSplashScreen(TextureManager textureManagerInstance) throws LWJGLException {
	ScaledResolution scaledresolution = new ScaledResolution(this);
	int i = scaledresolution.getScaleFactor();
	Framebuffer framebuffer = new Framebuffer(scaledresolution.getScaledWidth() * i,
			scaledresolution.getScaledHeight() * i, true);
	framebuffer.bindFramebuffer(false);
	GlStateManager.matrixMode(5889);
	GlStateManager.loadIdentity();
	GlStateManager.ortho(0.0D, (double) scaledresolution.getScaledWidth(),
			(double) scaledresolution.getScaledHeight(), 0.0D, 1000.0D, 3000.0D);
	GlStateManager.matrixMode(5888);
	GlStateManager.loadIdentity();
	GlStateManager.translate(0.0F, 0.0F, -2000.0F);
	GlStateManager.disableLighting();
	GlStateManager.disableFog();
	GlStateManager.disableDepth();
	GlStateManager.enableTexture2D();
	InputStream inputstream = null;

	try {
		inputstream = this.mcDefaultResourcePack.getInputStream(locationMojangPng);
		this.mojangLogo = textureManagerInstance.getDynamicTextureLocation("logo",
				new DynamicTexture(ImageIO.read(inputstream)));
		textureManagerInstance.bindTexture(this.mojangLogo);
	} catch (IOException ioexception) {
		logger.error((String) ("Unable to load logo: " + locationMojangPng), (Throwable) ioexception);
	} finally {
		IOUtils.closeQuietly(inputstream);
	}

	Tessellator tessellator = Tessellator.getInstance();
	WorldRenderer worldrenderer = tessellator.getWorldRenderer();
	worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
	worldrenderer.pos(0.0D, (double) this.displayHeight, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255)
			.endVertex();
	worldrenderer.pos((double) this.displayWidth, (double) this.displayHeight, 0.0D).tex(0.0D, 0.0D)
			.color(255, 255, 255, 255).endVertex();
	worldrenderer.pos((double) this.displayWidth, 0.0D, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex();
	worldrenderer.pos(0.0D, 0.0D, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex();
	tessellator.draw();
	GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
	int j = 256;
	int k = 256;
	this.func_181536_a((scaledresolution.getScaledWidth() - j) / 2, (scaledresolution.getScaledHeight() - k) / 2, 0,
			0, j, k, 255, 255, 255, 255);
	GlStateManager.disableLighting();
	GlStateManager.disableFog();
	framebuffer.unbindFramebuffer();
	framebuffer.framebufferRender(scaledresolution.getScaledWidth() * i, scaledresolution.getScaledHeight() * i);
	GlStateManager.enableAlpha();
	GlStateManager.alphaFunc(516, 0.1F);
	this.updateDisplay();
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:54,代码来源:Minecraft.java


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