本文整理汇总了Java中net.minecraft.client.renderer.OpenGlHelper.glUseProgram方法的典型用法代码示例。如果您正苦于以下问题:Java OpenGlHelper.glUseProgram方法的具体用法?Java OpenGlHelper.glUseProgram怎么用?Java OpenGlHelper.glUseProgram使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.client.renderer.OpenGlHelper
的用法示例。
在下文中一共展示了OpenGlHelper.glUseProgram方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: endShader
import net.minecraft.client.renderer.OpenGlHelper; //导入方法依赖的package包/类
public void endShader()
{
OpenGlHelper.glUseProgram(0);
currentProgram = -1;
staticShaderManager = null;
field_148000_e = true;
for (int i = 0; i < this.shaderSamplerLocations.size(); ++i)
{
if (this.shaderSamplers.get(this.samplerNames.get(i)) != null)
{
GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit + i);
GlStateManager.bindTexture(0);
}
}
}
示例2: endShader
import net.minecraft.client.renderer.OpenGlHelper; //导入方法依赖的package包/类
public void endShader()
{
OpenGlHelper.glUseProgram(0);
currentProgram = -1;
staticShaderManager = null;
lastCull = true;
for (int i = 0; i < this.shaderSamplerLocations.size(); ++i)
{
if (this.shaderSamplers.get(this.samplerNames.get(i)) != null)
{
GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit + i);
GlStateManager.bindTexture(0);
}
}
}
示例3: begin
import net.minecraft.client.renderer.OpenGlHelper; //导入方法依赖的package包/类
public boolean begin() {
if(program != 0 && !ShaderManager.isReloading()) {
OpenGlHelper.glUseProgram(program);
return true;
}
return false;
}
示例4: linkProgram
import net.minecraft.client.renderer.OpenGlHelper; //导入方法依赖的package包/类
public void linkProgram(int program) {
if (OpenGlHelper.shadersSupported) {
OpenGlHelper.glUseProgram(program);
}
}
示例5: 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();
}
}
示例6: end
import net.minecraft.client.renderer.OpenGlHelper; //导入方法依赖的package包/类
public void end() {
OpenGlHelper.glUseProgram(0);
}
示例7: 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();
}
}