List of usage examples for org.lwjgl.opengl GL20 glGetShaderi
@NativeType("void") public static int glGetShaderi(@NativeType("GLuint") int shader, @NativeType("GLenum") int pname)
From source file:eu.over9000.veya.rendering.Program.java
License:Open Source License
private static void checkCompilation(final int shaderID) { final int error = GL20.glGetShaderi(shaderID, GL20.GL_COMPILE_STATUS); if (error == GL11.GL_FALSE) { throw new OpenGLException( GL20.glGetShaderInfoLog(shaderID, GL20.glGetShaderi(shaderID, GL20.GL_INFO_LOG_LENGTH))); } else {/*w ww .j a v a 2s . c om*/ System.out.println("Shader Compilation OK"); } }
From source file:io.root.gfx.glutils.GL.java
License:Apache License
public static int glGetShaderi(int shader, int glCompileStatus) { return GL20.glGetShaderi(shader, glCompileStatus); }
From source file:me.thehutch.fusion.engine.render.opengl.gl20.OpenGL20Program.java
License:Open Source License
@Override public void attachShader(CharSequence source, int type) { ensureCreated("Program must be created to attach a shader."); // Generate a shader handle final int shaderId = GL20.glCreateShader(type); // Upload the shader's source to the GPU GL20.glShaderSource(shaderId, source); // Compile the shader GL20.glCompileShader(shaderId);//from ww w . ja v a 2 s. co m // Check for a shader compile error if (GL20.glGetShaderi(shaderId, GL_COMPILE_STATUS) == GL_FALSE) { // Get the shader info log length final int logLength = GL20.glGetShaderi(shaderId, GL20.GL_INFO_LOG_LENGTH); throw new IllegalStateException( "OpenGL Error: Could not compile shader\n" + GL20.glGetShaderInfoLog(shaderId, logLength)); } // Attach the shader GL20.glAttachShader(id, shaderId); // Add the shader to the program this.shaders.add(shaderId); // Check for errors RenderUtil.checkGLError(); }
From source file:net.smert.frameworkgl.opengl.helpers.ShaderHelper.java
License:Apache License
public boolean getCompileStatus(int shaderID) { return GL20.glGetShaderi(shaderID, GL20.GL_COMPILE_STATUS) != GL11.GL_FALSE; }
From source file:opengl.test.object.object.java
protected final void vertexShader(String file) { this.vertexID = GL20.glCreateShader(GL20.GL_VERTEX_SHADER); GL20.glShaderSource(this.vertexID, object.sourceLoader(file)); GL20.glCompileShader(this.vertexID); if (GL20.glGetShaderi(this.vertexID, GL20.GL_COMPILE_STATUS) != GL11.GL_TRUE) { throw new RuntimeException("Khong the compile vertexShader"); }/*from www. j ava 2 s . co m*/ GL20.glAttachShader(this.programID, this.vertexID); }
From source file:opengl.test.object.object.java
protected final void fragmentShader(String file) { this.fragmentID = GL20.glCreateShader(GL20.GL_FRAGMENT_SHADER); GL20.glShaderSource(this.fragmentID, object.sourceLoader(file)); GL20.glCompileShader(this.fragmentID); if (GL20.glGetShaderi(this.fragmentID, GL20.GL_COMPILE_STATUS) != GL11.GL_TRUE) { throw new RuntimeException("Khong the compile fragmentShader"); }//from w ww. j a v a 2s . c o m GL20.glAttachShader(this.programID, this.fragmentID); }
From source file:opengl.test.object.tree.testobject.leaf.java
private void vertexShader(String file) { this.vertexID = GL20.glCreateShader(GL20.GL_VERTEX_SHADER); GL20.glShaderSource(this.vertexID, leaf.sourceLoader(file)); GL20.glCompileShader(this.vertexID); if (GL20.glGetShaderi(this.vertexID, GL20.GL_COMPILE_STATUS) != GL11.GL_TRUE) { throw new RuntimeException("Khong the compile vertexShader"); }/*w w w. j a v a2 s. com*/ GL20.glAttachShader(this.programID, this.vertexID); }
From source file:opengl.test.object.tree.testobject.leaf.java
private void fragmentShader(String file) { this.fragmentID = GL20.glCreateShader(GL20.GL_FRAGMENT_SHADER); GL20.glShaderSource(this.fragmentID, leaf.sourceLoader(file)); GL20.glCompileShader(this.fragmentID); if (GL20.glGetShaderi(this.fragmentID, GL20.GL_COMPILE_STATUS) != GL11.GL_TRUE) { throw new RuntimeException("Khong the compile fragmentShader"); }/*from w w w .j a v a2s .co m*/ GL20.glAttachShader(this.programID, this.fragmentID); }
From source file:opengl.test.object.tree.testobject.traicay.java
private void vertexShader(String file) { this.vertexID = GL20.glCreateShader(GL20.GL_VERTEX_SHADER); GL20.glShaderSource(this.vertexID, traicay.sourceLoader(file)); GL20.glCompileShader(this.vertexID); if (GL20.glGetShaderi(this.vertexID, GL20.GL_COMPILE_STATUS) != GL11.GL_TRUE) { throw new RuntimeException("Khong the compile vertexShader"); }/* w w w . j ava2s . c om*/ GL20.glAttachShader(this.programID, this.vertexID); }
From source file:opengl.test.object.tree.testobject.traicay.java
private void fragmentShader(String file) { this.fragmentID = GL20.glCreateShader(GL20.GL_FRAGMENT_SHADER); GL20.glShaderSource(this.fragmentID, traicay.sourceLoader(file)); GL20.glCompileShader(this.fragmentID); if (GL20.glGetShaderi(this.fragmentID, GL20.GL_COMPILE_STATUS) != GL11.GL_TRUE) { throw new RuntimeException("Khong the compile fragmentShader"); }//from w w w .j a va 2 s. c om GL20.glAttachShader(this.programID, this.fragmentID); }