本文整理匯總了Java中org.lwjgl.opengl.GL20.glGetShaderInfoLog方法的典型用法代碼示例。如果您正苦於以下問題:Java GL20.glGetShaderInfoLog方法的具體用法?Java GL20.glGetShaderInfoLog怎麽用?Java GL20.glGetShaderInfoLog使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.lwjgl.opengl.GL20
的用法示例。
在下文中一共展示了GL20.glGetShaderInfoLog方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: printShaderLogInfo
import org.lwjgl.opengl.GL20; //導入方法依賴的package包/類
private static boolean printShaderLogInfo(int shader, String name)
{
IntBuffer intbuffer = BufferUtils.createIntBuffer(1);
int i = GL20.glGetShaderi(shader, 35716);
if (i > 1)
{
String s = GL20.glGetShaderInfoLog(shader, i);
SMCLog.info("Shader info log: " + name + "\n" + s);
return false;
}
else
{
return true;
}
}
示例2: Shader
import org.lwjgl.opengl.GL20; //導入方法依賴的package包/類
public Shader(String source, int type)
{
this.type = type;
this.handle = GL20.glCreateShader(this.type);
if (this.handle == 0)
{
throw new GLException("Unable to create main.shader!");
}
GL20.glShaderSource(this.handle, source);
GL20.glCompileShader(this.handle);
int status = GL20.glGetShaderi(this.handle, GL20.GL_COMPILE_STATUS);
if (status == GL11.GL_FALSE)
{
String infolog = GL20.glGetShaderInfoLog(this.handle);
GL20.glDeleteShader(this.handle);
this.handle = 0;
throw new GLException(infolog);
}
SHADERS.add(this);
}
示例3: printShaderLogInfo
import org.lwjgl.opengl.GL20; //導入方法依賴的package包/類
private static boolean printShaderLogInfo(int shader, String name, List<String> listFiles)
{
IntBuffer intbuffer = BufferUtils.createIntBuffer(1);
int i = GL20.glGetShaderi(shader, 35716);
if (i <= 1)
{
return true;
}
else
{
for (int j = 0; j < listFiles.size(); ++j)
{
String s = (String)listFiles.get(j);
SMCLog.info("File: " + (j + 1) + " = " + s);
}
String s1 = GL20.glGetShaderInfoLog(shader, i);
SMCLog.info("Shader info log: " + name + "\n" + s1);
return false;
}
}
示例4: createShader
import org.lwjgl.opengl.GL20; //導入方法依賴的package包/類
private int createShader(String resource, int type) {
int shader = GL20.glCreateShader(type);
GL20.glShaderSource(shader, resource);
GL20.glCompileShader(shader);
int compiled = GL20.glGetShaderi(shader, GL20.GL_COMPILE_STATUS);
String shaderLog = GL20.glGetShaderInfoLog(shader, GL20.glGetShaderi(shader, GL20.GL_INFO_LOG_LENGTH));
if (shaderLog.trim().length() > 0) {
System.err.println(shaderLog);
}
if (compiled == 0) {
throw new AssertionError("Could not compile shader");
}
return shader;
}
示例5: loadShader
import org.lwjgl.opengl.GL20; //導入方法依賴的package包/類
private static int loadShader(String file, int type) {
int shaderID = GL20.glCreateShader(type);
GL20.glShaderSource(shaderID, FileLoadUtils.loadFileSource(file));
GL20.glCompileShader(shaderID);
if (GL20.glGetShaderi(shaderID, GL20.GL_COMPILE_STATUS) == GL11.GL_FALSE) {
final String glGetShaderInfoLog = GL20.glGetShaderInfoLog(shaderID, 500);
LOGGER.error("Can not compile shader - {}", glGetShaderInfoLog);
throw new IllegalArgumentException("Can not compile shader - " + glGetShaderInfoLog);
}
return shaderID;
}
示例6: glGetShaderInfoLog
import org.lwjgl.opengl.GL20; //導入方法依賴的package包/類
public static String glGetShaderInfoLog(int shaderIn, int maxLength)
{
return arbShaders ? ARBShaderObjects.glGetInfoLogARB(shaderIn, maxLength) : GL20.glGetShaderInfoLog(shaderIn, maxLength);
}