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


Java GL20.glValidateProgram方法代码示例

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


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

示例1: ShaderProgram

import org.lwjgl.opengl.GL20; //导入方法依赖的package包/类
/**
 * @param shaders list of shaders to use in program
 */
public ShaderProgram(Shader ... shaders) {
	id = GL20.glCreateProgram();
	this.shaders = shaders;
	
	// Attach shaders
	for (Shader shader : shaders) {
		GL20.glAttachShader(id, shader.id);
	}
	
	// Link
	GL20.glLinkProgram(id);
	if (GL20.glGetProgrami(id, GL20.GL_LINK_STATUS) == GL11.GL_FALSE) {
		throw new Error("Failed to link shader program.");
	}
		   
	// Validate
	GL20.glValidateProgram(id);
	if (GL20.glGetProgrami(id, GL20.GL_VALIDATE_STATUS) == GL11.GL_FALSE) {
		throw new Error("Failed to validate shader program.");
	}
}
 
开发者ID:tacocat,项目名称:lambda,代码行数:25,代码来源:ShaderProgram.java

示例2: validate

import org.lwjgl.opengl.GL20; //导入方法依赖的package包/类
public Program validate()
{
	GL20.glValidateProgram(this.handle);

	int status = GL20.glGetProgrami(this.handle, GL20.GL_VALIDATE_STATUS);
	if (status == GL11.GL_FALSE)
	{
		String infoLog = GL20.glGetProgramInfoLog(this.handle);
		GL20.glDeleteProgram(this.handle);
		this.handle = 0;

		throw new GLException(infoLog);
	}

	return this;
}
 
开发者ID:andykuo1,项目名称:candlelight,代码行数:17,代码来源:Program.java

示例3: ShaderProgram

import org.lwjgl.opengl.GL20; //导入方法依赖的package包/类
public ShaderProgram(String vertexFile, String fragmentFile) {
	vertexShaderID = loadShader(vertexFile, GL20.GL_VERTEX_SHADER);
	fragmentShaderID = loadShader(fragmentFile, GL20.GL_FRAGMENT_SHADER);
	programID = GL20.glCreateProgram();
	GL20.glAttachShader(programID, vertexShaderID);
	GL20.glAttachShader(programID, fragmentShaderID);
	bindAttributes();
	GL20.glLinkProgram(programID);
	GL20.glValidateProgram(programID);
	getAllUniformLocations();
}
 
开发者ID:marcioz98,项目名称:MRCEngine,代码行数:12,代码来源:ShaderProgram.java

示例4: Shader

import org.lwjgl.opengl.GL20; //导入方法依赖的package包/类
/**
    * Creates a shader with the specified file name.
    * @param name The filename of the shader as found in the specified PATH with the specified extensions
    */
   public Shader(String name) throws IOException {
// Create the program id
pid = GL20.glCreateProgram();

// Instantiate the uniform lookup
uniforms = new HashMap<String, Integer>();

// Add the vertex shader to the program
String vertSource = addShader(GL20.GL_VERTEX_SHADER, path + name + "." + vertexExtension);
// Add the fragment shader to the program
String fragSource = addShader(GL20.GL_FRAGMENT_SHADER, path + name + "." + fragmentExtension);

// Link the program
GL20.glLinkProgram(pid);
// Check if linking was successful
closeIfProgramError(GL20.glGetProgrami(pid, GL20.GL_LINK_STATUS) == 0, pid);

// Validate the program
GL20.glValidateProgram(pid);
// Check if validation was successful
closeIfProgramError(GL20.glGetProgrami(pid, GL20.GL_VALIDATE_STATUS) == 0, pid);

// Bind the shader
bind();

// Automatically add uniforms
autoAddUniforms(vertSource);
autoAddUniforms(fragSource);
   }
 
开发者ID:camilne,项目名称:open-world,代码行数:34,代码来源:Shader.java

示例5: ShaderProgram

import org.lwjgl.opengl.GL20; //导入方法依赖的package包/类
public ShaderProgram(final String vertexFile, final String fragmentFle) {
    LOGGER.debug("Initializing shader program for vertex - {} and fragment - {}", vertexFile, fragmentFle);
    vertShaderId = loadShader(vertexFile, GL20.GL_VERTEX_SHADER);
    fragShaderId = loadShader(fragmentFle, GL20.GL_FRAGMENT_SHADER);
    programId = GL20.glCreateProgram();
    GL20.glAttachShader(programId, vertShaderId);
    GL20.glAttachShader(programId, fragShaderId);
    bindAttributes();
    GL20.glLinkProgram(programId);
    GL20.glValidateProgram(programId);
    LOGGER.debug("Initialized shader - {} vertex - {} fragment - {}", programId, vertShaderId, fragShaderId);
    getAllUniformLocations();
}
 
开发者ID:Biacode,项目名称:bia-engine,代码行数:14,代码来源:ShaderProgram.java

示例6: ShaderProgram

import org.lwjgl.opengl.GL20; //导入方法依赖的package包/类
/**
 * Loads shader files and binds them the this program.
 * @param vertexFile - Vertex Shader location
 * @param fragmentFile - Fragment Shader location
 */
public ShaderProgram(String vertexFile, String fragmentFile) {
    vertexShaderID = loadShader(vertexFile, GL20.GL_VERTEX_SHADER);
    fragmentShaderID = loadShader(fragmentFile, GL20.GL_FRAGMENT_SHADER);

    programID = GL20.glCreateProgram();
    GL20.glAttachShader(programID, vertexShaderID);
    GL20.glAttachShader(programID, fragmentShaderID);
    bindAttributes();
    GL20.glLinkProgram(programID);
    GL20.glValidateProgram(programID);
    initUniforms();
}
 
开发者ID:Essentria,项目名称:Elgin-Plant-Game,代码行数:18,代码来源:ShaderProgram.java

示例7: storeAllUniformLocations

import org.lwjgl.opengl.GL20; //导入方法依赖的package包/类
protected void storeAllUniformLocations(Uniform... uniforms){
	for(Uniform uniform : uniforms){
		uniform.storeUniformLocation(programID);
	}
	GL20.glValidateProgram(programID);
}
 
开发者ID:TheThinMatrix,项目名称:LowPolyWater,代码行数:7,代码来源:ShaderProgram.java

示例8: validateProgram

import org.lwjgl.opengl.GL20; //导入方法依赖的package包/类
protected void validateProgram(){
	GL20.glValidateProgram(programID);
}
 
开发者ID:TheThinMatrix,项目名称:LowPolyWater,代码行数:4,代码来源:ShaderProgram.java

示例9: linkAndValidate

import org.lwjgl.opengl.GL20; //导入方法依赖的package包/类
public void linkAndValidate() {
	GL20.glLinkProgram(program);
	GL20.glValidateProgram(program);
}
 
开发者ID:ComunityEngine,项目名称:CommunityEngine-Java,代码行数:5,代码来源:Shader.java

示例10: storeAllUniformLocations

import org.lwjgl.opengl.GL20; //导入方法依赖的package包/类
protected void storeAllUniformLocations(Uniform... uniforms) {
    for (Uniform uniform : uniforms) {
        uniform.storeUniformLocation(programID);
    }
    GL20.glValidateProgram(programID);
}
 
开发者ID:GryPLOfficial,项目名称:EcoSystem-Official,代码行数:7,代码来源:ShaderProgram.java

示例11: validateProgram

import org.lwjgl.opengl.GL20; //导入方法依赖的package包/类
protected void validateProgram() {
    GL20.glValidateProgram(programID);
}
 
开发者ID:GryPLOfficial,项目名称:EcoSystem-Official,代码行数:4,代码来源:ShaderProgram.java


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