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


Java OpenGlHelper.glUniform1i方法代码示例

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


在下文中一共展示了OpenGlHelper.glUniform1i方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: useShader

import net.minecraft.client.renderer.OpenGlHelper; //导入方法依赖的package包/类
public void useShader()
{
    this.isDirty = false;
    staticShaderManager = this;
    this.field_148016_p.func_148109_a();

    if (this.program != currentProgram)
    {
        OpenGlHelper.glUseProgram(this.program);
        currentProgram = this.program;
    }

    if (this.useFaceCulling)
    {
        GlStateManager.enableCull();
    }
    else
    {
        GlStateManager.disableCull();
    }

    for (int i = 0; i < this.shaderSamplerLocations.size(); ++i)
    {
        if (this.shaderSamplers.get(this.samplerNames.get(i)) != null)
        {
            GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit + i);
            GlStateManager.enableTexture2D();
            Object object = this.shaderSamplers.get(this.samplerNames.get(i));
            int j = -1;

            if (object instanceof Framebuffer)
            {
                j = ((Framebuffer)object).framebufferTexture;
            }
            else if (object instanceof ITextureObject)
            {
                j = ((ITextureObject)object).getGlTextureId();
            }
            else if (object instanceof Integer)
            {
                j = ((Integer)object).intValue();
            }

            if (j != -1)
            {
                GlStateManager.bindTexture(j);
                OpenGlHelper.glUniform1i(OpenGlHelper.glGetUniformLocation(this.program, (CharSequence)this.samplerNames.get(i)), i);
            }
        }
    }

    for (ShaderUniform shaderuniform : this.shaderUniforms)
    {
        shaderuniform.upload();
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:57,代码来源:ShaderManager.java

示例2: useShader

import net.minecraft.client.renderer.OpenGlHelper; //导入方法依赖的package包/类
public void useShader()
{
    this.isDirty = false;
    staticShaderManager = this;
    this.blendingMode.apply();

    if (this.program != currentProgram)
    {
        OpenGlHelper.glUseProgram(this.program);
        currentProgram = this.program;
    }

    if (this.useFaceCulling)
    {
        GlStateManager.enableCull();
    }
    else
    {
        GlStateManager.disableCull();
    }

    for (int i = 0; i < this.shaderSamplerLocations.size(); ++i)
    {
        if (this.shaderSamplers.get(this.samplerNames.get(i)) != null)
        {
            GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit + i);
            GlStateManager.enableTexture2D();
            Object object = this.shaderSamplers.get(this.samplerNames.get(i));
            int j = -1;

            if (object instanceof Framebuffer)
            {
                j = ((Framebuffer)object).framebufferTexture;
            }
            else if (object instanceof ITextureObject)
            {
                j = ((ITextureObject)object).getGlTextureId();
            }
            else if (object instanceof Integer)
            {
                j = ((Integer)object).intValue();
            }

            if (j != -1)
            {
                GlStateManager.bindTexture(j);
                OpenGlHelper.glUniform1i(OpenGlHelper.glGetUniformLocation(this.program, (CharSequence)this.samplerNames.get(i)), i);
            }
        }
    }

    for (ShaderUniform shaderuniform : this.shaderUniforms)
    {
        shaderuniform.upload();
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:57,代码来源:ShaderManager.java


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