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


Java GlStateManager.deleteTextures方法代碼示例

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


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

示例1: uninit

import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
public static void uninit()
{
    if (isShaderPackInitialized)
    {
        checkGLError("Shaders.uninit pre");

        for (int i = 0; i < 33; ++i)
        {
            if (programsRef[i] != 0)
            {
                ARBShaderObjects.glDeleteObjectARB(programsRef[i]);
                checkGLError("del programRef");
            }

            programsRef[i] = 0;
            programsID[i] = 0;
            programsDrawBufSettings[i] = null;
            programsDrawBuffers[i] = null;
            programsCompositeMipmapSetting[i] = 0;
        }

        if (dfb != 0)
        {
            EXTFramebufferObject.glDeleteFramebuffersEXT(dfb);
            dfb = 0;
            checkGLError("del dfb");
        }

        if (sfb != 0)
        {
            EXTFramebufferObject.glDeleteFramebuffersEXT(sfb);
            sfb = 0;
            checkGLError("del sfb");
        }

        if (dfbDepthTextures != null)
        {
            GlStateManager.deleteTextures(dfbDepthTextures);
            fillIntBufferZero(dfbDepthTextures);
            checkGLError("del dfbDepthTextures");
        }

        if (dfbColorTextures != null)
        {
            GlStateManager.deleteTextures(dfbColorTextures);
            fillIntBufferZero(dfbColorTextures);
            checkGLError("del dfbTextures");
        }

        if (sfbDepthTextures != null)
        {
            GlStateManager.deleteTextures(sfbDepthTextures);
            fillIntBufferZero(sfbDepthTextures);
            checkGLError("del shadow depth");
        }

        if (sfbColorTextures != null)
        {
            GlStateManager.deleteTextures(sfbColorTextures);
            fillIntBufferZero(sfbColorTextures);
            checkGLError("del shadow color");
        }

        if (dfbDrawBuffers != null)
        {
            fillIntBufferZero(dfbDrawBuffers);
        }

        if (noiseTexture != null)
        {
            noiseTexture.destroy();
            noiseTexture = null;
        }

        SMCLog.info("Uninit");
        shadowPassInterval = 0;
        shouldSkipDefaultShadow = false;
        isShaderPackInitialized = false;
        checkGLError("Shaders.uninit");
    }
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:82,代碼來源:Shaders.java

示例2: setupShadowFrameBuffer

import net.minecraft.client.renderer.GlStateManager; //導入方法依賴的package包/類
private static void setupShadowFrameBuffer()
{
    if (usedShadowDepthBuffers != 0)
    {
        if (sfb != 0)
        {
            EXTFramebufferObject.glDeleteFramebuffersEXT(sfb);
            GlStateManager.deleteTextures(sfbDepthTextures);
            GlStateManager.deleteTextures(sfbColorTextures);
        }

        sfb = EXTFramebufferObject.glGenFramebuffersEXT();
        EXTFramebufferObject.glBindFramebufferEXT(36160, sfb);
        GL11.glDrawBuffer(0);
        GL11.glReadBuffer(0);
        GL11.glGenTextures((IntBuffer)sfbDepthTextures.clear().limit(usedShadowDepthBuffers));
        GL11.glGenTextures((IntBuffer)sfbColorTextures.clear().limit(usedShadowColorBuffers));
        sfbDepthTextures.position(0);
        sfbColorTextures.position(0);

        for (int i = 0; i < usedShadowDepthBuffers; ++i)
        {
            GlStateManager.bindTexture(sfbDepthTextures.get(i));
            GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, 10496.0F);
            GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, 10496.0F);
            int j = shadowFilterNearest[i] ? 9728 : 9729;
            GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, j);
            GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, j);

            if (shadowHardwareFilteringEnabled[i])
            {
                GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL14.GL_TEXTURE_COMPARE_MODE, GL14.GL_COMPARE_R_TO_TEXTURE);
            }

            GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_DEPTH_COMPONENT, shadowMapWidth, shadowMapHeight, 0, GL11.GL_DEPTH_COMPONENT, GL11.GL_FLOAT, (FloatBuffer)((FloatBuffer)null));
        }

        EXTFramebufferObject.glFramebufferTexture2DEXT(36160, 36096, 3553, sfbDepthTextures.get(0), 0);
        checkGLError("FT sd");

        for (int k = 0; k < usedShadowColorBuffers; ++k)
        {
            GlStateManager.bindTexture(sfbColorTextures.get(k));
            GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, 10496.0F);
            GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, 10496.0F);
            int i1 = shadowColorFilterNearest[k] ? 9728 : 9729;
            GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, i1);
            GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, i1);
            GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGBA, shadowMapWidth, shadowMapHeight, 0, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, (ByteBuffer)((ByteBuffer)null));
            EXTFramebufferObject.glFramebufferTexture2DEXT(36160, 36064 + k, 3553, sfbColorTextures.get(k), 0);
            checkGLError("FT sc");
        }

        GlStateManager.bindTexture(0);

        if (usedShadowColorBuffers > 0)
        {
            GL20.glDrawBuffers(sfbDrawBuffers);
        }

        int l = EXTFramebufferObject.glCheckFramebufferStatusEXT(36160);

        if (l != 36053)
        {
            printChatAndLogError("[Shaders] Error: Failed creating shadow framebuffer! (Status " + l + ")");
        }
        else
        {
            SMCLog.info("Shadow framebuffer created.");
        }
    }
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:73,代碼來源:Shaders.java


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