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