本文整理汇总了Java中org.lwjgl.opengl.ARBShaderObjects.glLinkProgramARB方法的典型用法代码示例。如果您正苦于以下问题:Java ARBShaderObjects.glLinkProgramARB方法的具体用法?Java ARBShaderObjects.glLinkProgramARB怎么用?Java ARBShaderObjects.glLinkProgramARB使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.lwjgl.opengl.ARBShaderObjects
的用法示例。
在下文中一共展示了ARBShaderObjects.glLinkProgramARB方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: glLinkProgram
import org.lwjgl.opengl.ARBShaderObjects; //导入方法依赖的package包/类
public static void glLinkProgram(int program)
{
if (arbShaders)
{
ARBShaderObjects.glLinkProgramARB(program);
}
else
{
GL20.glLinkProgram(program);
}
}
示例2: Shader
import org.lwjgl.opengl.ARBShaderObjects; //导入方法依赖的package包/类
public Shader(Asset vertex, Asset fragment){
// Creates the vertex shader from the asset.
this.vertex = ShaderHelper.INSTANCE.create(vertex, ShaderType.VERTEX);
// Creates the fragment shader from the asset.
this.fragment = ShaderHelper.INSTANCE.create(fragment, ShaderType.FRAGMENT);
// Throws an exception if the shader programs didn't compile correctly.
if(this.vertex == 0 || this.fragment == 0)
throw new RuntimeException(String.format("Invalid shader compile. Vertex: %s, Fragment: %s, error: (%s)\n (%s).", vertex, fragment, getLogInfo(this.vertex), getLogInfo(this.fragment)));
// Creates the combined shader.
this.combined = ARBShaderObjects.glCreateProgramObjectARB();
// Attaches the vertex shader to the combined shader.
ARBShaderObjects.glAttachObjectARB(this.combined, this.vertex);
// Attaches the fragment shader to the combined shader.
ARBShaderObjects.glAttachObjectARB(this.combined, this.fragment);
// Links the combined shader.
ARBShaderObjects.glLinkProgramARB(this.combined);
// Validates the combined shader program to check for errors.
ARBShaderObjects.glValidateProgramARB(this.combined);
// Unbinds the shader.
unbind();
}