本文整理汇总了Java中net.minecraft.client.renderer.OpenGlHelper.glLinkProgram方法的典型用法代码示例。如果您正苦于以下问题:Java OpenGlHelper.glLinkProgram方法的具体用法?Java OpenGlHelper.glLinkProgram怎么用?Java OpenGlHelper.glLinkProgram使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.client.renderer.OpenGlHelper
的用法示例。
在下文中一共展示了OpenGlHelper.glLinkProgram方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: create
import net.minecraft.client.renderer.OpenGlHelper; //导入方法依赖的package包/类
public static int create(IResourceManager manager, @Nullable ResourceLocation vsh, @Nullable ResourceLocation fsh) {
int vshId = 0, fshId = 0, program = 0;
if(vsh != null) {
vshId = parse(manager, vsh, VERTEX);
}
if(fsh != null) {
fshId = parse(manager, fsh, FRAGMENT);
}
if(vsh != null || fsh != null) {
program = ARBShaderObjects.glCreateProgramObjectARB();
}
if(vsh != null) {
OpenGlHelper.glAttachShader(program, vshId);
}
if(fsh != null) {
OpenGlHelper.glAttachShader(program, fshId);
}
OpenGlHelper.glLinkProgram(program);
if(OpenGlHelper.glGetShaderi(program, ARBShaderObjects.GL_OBJECT_LINK_STATUS_ARB) == GL11.GL_FALSE) {
return 0;
}
if(OpenGlHelper.glGetShaderi(program, ARBShaderObjects.GL_OBJECT_VALIDATE_STATUS_ARB) == GL11.GL_FALSE) {
return 0;
}
return program;
}
示例2: loadProgram
import net.minecraft.client.renderer.OpenGlHelper; //导入方法依赖的package包/类
public int loadProgram(String vsh, String fsh) {
if (OpenGlHelper.shadersSupported) {
int vertexShader = createShader(vsh, OpenGlHelper.GL_VERTEX_SHADER);
int fragmentShader = createShader(fsh, OpenGlHelper.GL_FRAGMENT_SHADER);
int program = OpenGlHelper.glCreateProgram();
OpenGlHelper.glAttachShader(program, vertexShader);
OpenGlHelper.glAttachShader(program, fragmentShader);
OpenGlHelper.glLinkProgram(program);
return program;
}
return 0;
}
示例3: linkProgram
import net.minecraft.client.renderer.OpenGlHelper; //导入方法依赖的package包/类
public void linkProgram(ShaderManager manager) throws IOException
{
manager.getFragmentShaderLoader().attachShader(manager);
manager.getVertexShaderLoader().attachShader(manager);
OpenGlHelper.glLinkProgram(manager.getProgram());
int i = OpenGlHelper.glGetProgrami(manager.getProgram(), OpenGlHelper.GL_LINK_STATUS);
if (i == 0)
{
logger.warn("Error encountered when linking program containing VS " + manager.getVertexShaderLoader().getShaderFilename() + " and FS " + manager.getFragmentShaderLoader().getShaderFilename() + ". Log output:");
logger.warn(OpenGlHelper.glGetProgramInfoLog(manager.getProgram(), 32768));
}
}
示例4: linkProgram
import net.minecraft.client.renderer.OpenGlHelper; //导入方法依赖的package包/类
public void linkProgram(ShaderManager manager) throws IOException
{
manager.getFragmentShaderLoader().attachShader(manager);
manager.getVertexShaderLoader().attachShader(manager);
OpenGlHelper.glLinkProgram(manager.getProgram());
int i = OpenGlHelper.glGetProgrami(manager.getProgram(), OpenGlHelper.GL_LINK_STATUS);
if (i == 0)
{
LOGGER.warn("Error encountered when linking program containing VS {} and FS {}. Log output:", new Object[] {manager.getVertexShaderLoader().getShaderFilename(), manager.getFragmentShaderLoader().getShaderFilename()});
LOGGER.warn(OpenGlHelper.glGetProgramInfoLog(manager.getProgram(), 32768));
}
}