Java Code Examples for org.lwjgl.opengl.ARBShaderObjects#glDeleteObjectARB()
The following examples show how to use
org.lwjgl.opengl.ARBShaderObjects#glDeleteObjectARB() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Renderer.java From FEMultiplayer with GNU General Public License v3.0 | 6 votes |
private static int createShader(String filename, int shaderType) throws Exception { int shader = 0; try { shader = ARBShaderObjects.glCreateShaderObjectARB(shaderType); if(shader == 0) return 0; ARBShaderObjects.glShaderSourceARB(shader, readFileAsString(filename)); ARBShaderObjects.glCompileShaderARB(shader); if (ARBShaderObjects.glGetObjectParameteriARB(shader, ARBShaderObjects.GL_OBJECT_COMPILE_STATUS_ARB) == GL_FALSE) throw new RuntimeException("Error creating shader: " + getLogInfo(shader)); return shader; } catch(Exception exc) { ARBShaderObjects.glDeleteObjectARB(shader); throw exc; } }
Example 2
Source File: ShaderUtil.java From Cyberware with MIT License | 5 votes |
private static int createShader(String filename, int shaderType) { int shader = 0; try { shader = ARBShaderObjects.glCreateShaderObjectARB(shaderType); if(shader == 0) { return 0; } ARBShaderObjects.glShaderSourceARB(shader, readFileAsString(filename)); ARBShaderObjects.glCompileShaderARB(shader); if (ARBShaderObjects.glGetObjectParameteriARB(shader, ARBShaderObjects.GL_OBJECT_COMPILE_STATUS_ARB) == GL11.GL_FALSE) throw new RuntimeException("Error creating shader: " + getLogInfo(shader)); return shader; } catch(Exception e) { ARBShaderObjects.glDeleteObjectARB(shader); e.printStackTrace(); return -1; } }
Example 3
Source File: Renderer.java From FEMultiPlayer-V2 with GNU General Public License v3.0 | 5 votes |
/** * Creates the shader. * * @param filename the filename * @param shaderType the shader type * @return the int * @throws Exception the exception */ /* * With the exception of syntax, setting up vertex and fragment shaders * is the same. * @param the name and path to the vertex shader */ private static int createShader(String filename, int shaderType) throws Exception { int shader = 0; try { shader = ARBShaderObjects.glCreateShaderObjectARB(shaderType); if(shader == 0) return 0; ARBShaderObjects.glShaderSourceARB(shader, readFileAsString(filename)); ARBShaderObjects.glCompileShaderARB(shader); if (ARBShaderObjects.glGetObjectParameteriARB(shader, ARBShaderObjects.GL_OBJECT_COMPILE_STATUS_ARB) == GL_FALSE) throw new RuntimeException("Error creating shader: " + getLogInfo(shader)); return shader; } catch(Exception exc) { ARBShaderObjects.glDeleteObjectARB(shader); throw exc; } }
Example 4
Source File: ShaderHelper.java From OpenModsLib with MIT License | 4 votes |
@Override public void glDeleteProgram(int program) { ARBShaderObjects.glDeleteObjectARB(program); }
Example 5
Source File: ShaderHelper.java From OpenModsLib with MIT License | 4 votes |
@Override public void glDeleteShader(int shader) { ARBShaderObjects.glDeleteObjectARB(shader); }