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


Java ARBShaderObjects.glCreateProgramObjectARB方法代码示例

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


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

示例1: create

import org.lwjgl.opengl.ARBShaderObjects; //导入方法依赖的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;
}
 
开发者ID:ArekkuusuJerii,项目名称:Solar,代码行数:27,代码来源:ShaderManager.java

示例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();
}
 
开发者ID:SerenityEnterprises,项目名称:SerenityCE,代码行数:30,代码来源:Shader.java

示例3: glCreateProgram

import org.lwjgl.opengl.ARBShaderObjects; //导入方法依赖的package包/类
public static int glCreateProgram()
{
    return arbShaders ? ARBShaderObjects.glCreateProgramObjectARB() : GL20.glCreateProgram();
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:5,代码来源:OpenGlHelper.java


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