Roi Atalla avatar Roi Atalla committed 14b2c0b

Added getUniformLocation and getUniformBlockIndex to ShaderProgram, refactored every single tutorial example to use these methods for simplicity.

Comments (0)

Files changed (51)

src/com/ra4king/opengl/GLProgram.java

 package com.ra4king.opengl;
 
 import static org.lwjgl.opengl.GL11.*;
-import static org.lwjgl.util.glu.GLU.*;
 
 import org.lwjgl.input.Keyboard;
 import org.lwjgl.opengl.ContextAttribs;
 	}
 	
 	public final void run(int major, int minor, boolean core, PixelFormat format) {
-		run(format, new ContextAttribs(major, minor).withProfileCore(core));
+		run(format, core ? new ContextAttribs(major, minor).withProfileCore(core) : new ContextAttribs(major, minor));
 	}
 	
 	public final void run(PixelFormat format) {
 		try {
 			init();
 			
-			checkGLError("init");
+			Utils.checkGLError("init");
 			
 			resized();
 			
-			checkGLError("resized");
+			Utils.checkGLError("resized");
 			
 			long lastTime, lastFPS;
 			lastTime = lastFPS = System.nanoTime();
 				
 				update(deltaTime);
 				
-				checkGLError("update");
+				Utils.checkGLError("update");
 				
 				render();
 				
-				checkGLError("render");
+				Utils.checkGLError("render");
 				
 				Display.update();
 				
 		}
 	}
 	
-	public void checkGLError(String event) {
-		int error;
-		if((error = glGetError()) != GL_NO_ERROR)
-			throw new RuntimeException("OpenGL Error during " + event + ": " + gluErrorString(error));
-	}
-	
 	public int getWidth() {
 		return Display.getWidth();
 	}

src/com/ra4king/opengl/arcsynthesis/gl33/chapter10/example1/Example10_1.java

 	
 	private ProgramData loadLitShader(String vertFile, String fragFile) {
 		ProgramData data = new ProgramData(new ShaderProgram(readFromFile(vertFile), readFromFile(fragFile)));
-		data.modelToCameraMatrixUniform = glGetUniformLocation(data.program.getProgram(), "modelToCameraMatrix");
-		data.normalModelToCameraMatrixUniform = glGetUniformLocation(data.program.getProgram(), "normalModelToCameraMatrix");
-		data.lightPosUniform = glGetUniformLocation(data.program.getProgram(), "lightPos");
-		data.lightIntensityUniform = glGetUniformLocation(data.program.getProgram(), "lightIntensity");
-		data.ambientIntensityUniform = glGetUniformLocation(data.program.getProgram(), "ambientIntensity");
+		data.modelToCameraMatrixUniform = data.program.getUniformLocation("modelToCameraMatrix");
+		data.normalModelToCameraMatrixUniform = data.program.getUniformLocation("normalModelToCameraMatrix");
+		data.lightPosUniform = data.program.getUniformLocation("lightPos");
+		data.lightIntensityUniform = data.program.getUniformLocation("lightIntensity");
+		data.ambientIntensityUniform = data.program.getUniformLocation("ambientIntensity");
 		
-		int projectionBlock = glGetUniformBlockIndex(data.program.getProgram(), "Projection");
+		int projectionBlock = data.program.getUniformBlockIndex("Projection");
 		glUniformBlockBinding(data.program.getProgram(), projectionBlock, projectionBlockIndex);
 		
 		return data;
 	
 	private UnlitProgramData loadUnlitShader(String vertFile, String fragFile) {
 		UnlitProgramData data = new UnlitProgramData(new ShaderProgram(readFromFile(vertFile), readFromFile(fragFile)));
-		data.modelToCameraMatrixUniform = glGetUniformLocation(data.program.getProgram(), "modelToCameraMatrix");
-		data.objectColorUniform = glGetUniformLocation(data.program.getProgram(), "objectColor");
+		data.modelToCameraMatrixUniform = data.program.getUniformLocation("modelToCameraMatrix");
+		data.objectColorUniform = data.program.getUniformLocation("objectColor");
 		
-		int projectionBlock = glGetUniformBlockIndex(data.program.getProgram(), "Projection");
+		int projectionBlock = data.program.getUniformBlockIndex("Projection");
 		glUniformBlockBinding(data.program.getProgram(), projectionBlock, projectionBlockIndex);
 		
 		return data;

src/com/ra4king/opengl/arcsynthesis/gl33/chapter10/example2/Example10_2.java

 	
 	private ProgramData loadLitShader(String vertFile, String fragFile) {
 		ProgramData data = new ProgramData(new ShaderProgram(readFromFile(vertFile), readFromFile(fragFile)));
-		data.modelToCameraMatrixUniform = glGetUniformLocation(data.program.getProgram(), "modelToCameraMatrix");
-		data.modelSpaceLightPosUniform = glGetUniformLocation(data.program.getProgram(), "modelSpaceLightPos");
-		data.lightIntensityUniform = glGetUniformLocation(data.program.getProgram(), "lightIntensity");
-		data.ambientIntensityUniform = glGetUniformLocation(data.program.getProgram(), "ambientIntensity");
+		data.modelToCameraMatrixUniform = data.program.getUniformLocation("modelToCameraMatrix");
+		data.modelSpaceLightPosUniform = data.program.getUniformLocation("modelSpaceLightPos");
+		data.lightIntensityUniform = data.program.getUniformLocation("lightIntensity");
+		data.ambientIntensityUniform = data.program.getUniformLocation("ambientIntensity");
 		
-		int projectionBlock = glGetUniformBlockIndex(data.program.getProgram(), "Projection");
+		int projectionBlock = data.program.getUniformBlockIndex("Projection");
 		glUniformBlockBinding(data.program.getProgram(), projectionBlock, projectionBlockIndex);
 		
 		return data;
 	
 	private UnlitProgramData loadUnlitShader(String vertFile, String fragFile) {
 		UnlitProgramData data = new UnlitProgramData(new ShaderProgram(readFromFile(vertFile), readFromFile(fragFile)));
-		data.modelToCameraMatrixUniform = glGetUniformLocation(data.program.getProgram(), "modelToCameraMatrix");
-		data.objectColorUniform = glGetUniformLocation(data.program.getProgram(), "objectColor");
+		data.modelToCameraMatrixUniform = data.program.getUniformLocation("modelToCameraMatrix");
+		data.objectColorUniform = data.program.getUniformLocation("objectColor");
 		
-		int projectionBlock = glGetUniformBlockIndex(data.program.getProgram(), "Projection");
+		int projectionBlock = data.program.getUniformBlockIndex("Projection");
 		glUniformBlockBinding(data.program.getProgram(), projectionBlock, projectionBlockIndex);
 		
 		return data;

src/com/ra4king/opengl/arcsynthesis/gl33/chapter10/example3/Example10_3.java

 	
 	private ProgramData loadLitShader(String vertFile, String fragFile) {
 		ProgramData data = new ProgramData(new ShaderProgram(readFromFile(vertFile), readFromFile(fragFile)));
-		data.modelToCameraMatrixUniform = glGetUniformLocation(data.program.getProgram(), "modelToCameraMatrix");
-		data.lightIntensityUniform = glGetUniformLocation(data.program.getProgram(), "lightIntensity");
-		data.ambientIntensityUniform = glGetUniformLocation(data.program.getProgram(), "ambientIntensity");
-		data.normalModelToCameraMatrixUniform = glGetUniformLocation(data.program.getProgram(), "normalModelToCameraMatrix");
-		data.cameraSpaceLightPosUniform = glGetUniformLocation(data.program.getProgram(), "cameraSpaceLightPos");
-		data.lightAttenuationUniform = glGetUniformLocation(data.program.getProgram(), "lightAttenuation");
-		data.useRSquareUniform = glGetUniformLocation(data.program.getProgram(), "useRSquare");
+		data.modelToCameraMatrixUniform = data.program.getUniformLocation("modelToCameraMatrix");
+		data.lightIntensityUniform = data.program.getUniformLocation("lightIntensity");
+		data.ambientIntensityUniform = data.program.getUniformLocation("ambientIntensity");
+		data.normalModelToCameraMatrixUniform = data.program.getUniformLocation("normalModelToCameraMatrix");
+		data.cameraSpaceLightPosUniform = data.program.getUniformLocation("cameraSpaceLightPos");
+		data.lightAttenuationUniform = data.program.getUniformLocation("lightAttenuation");
+		data.useRSquareUniform = data.program.getUniformLocation("useRSquare");
 		
-		int projectionBlock = glGetUniformBlockIndex(data.program.getProgram(), "Projection");
+		int projectionBlock = data.program.getUniformBlockIndex("Projection");
 		glUniformBlockBinding(data.program.getProgram(), projectionBlock, projectionBlockIndex);
-		int unprojectionBlock = glGetUniformBlockIndex(data.program.getProgram(), "UnProjection");
+		int unprojectionBlock = data.program.getUniformBlockIndex("UnProjection");
 		glUniformBlockBinding(data.program.getProgram(), unprojectionBlock, unprojectionBlockIndex);
 		
 		return data;
 	
 	private UnlitProgramData loadUnlitShader(String vertFile, String fragFile) {
 		UnlitProgramData data = new UnlitProgramData(new ShaderProgram(readFromFile(vertFile), readFromFile(fragFile)));
-		data.modelToCameraMatrixUniform = glGetUniformLocation(data.program.getProgram(), "modelToCameraMatrix");
-		data.objectColorUniform = glGetUniformLocation(data.program.getProgram(), "objectColor");
+		data.modelToCameraMatrixUniform = data.program.getUniformLocation("modelToCameraMatrix");
+		data.objectColorUniform = data.program.getUniformLocation("objectColor");
 		
-		int projectionBlock = glGetUniformBlockIndex(data.program.getProgram(), "Projection");
+		int projectionBlock = data.program.getUniformBlockIndex("Projection");
 		glUniformBlockBinding(data.program.getProgram(), projectionBlock, projectionBlockIndex);
 		
 		return data;

src/com/ra4king/opengl/arcsynthesis/gl33/chapter11/example1/Example11_1.java

 	
 	private ProgramData loadLitProgram(String vertFile, String fragFile) {
 		ProgramData data = new ProgramData(new ShaderProgram(readFromFile(vertFile), readFromFile(fragFile)));
-		data.modelToCameraMatrixUniform = glGetUniformLocation(data.program.getProgram(), "modelToCameraMatrix");
-		data.lightIntensityUniform = glGetUniformLocation(data.program.getProgram(), "lightIntensity");
-		data.ambientIntensityUniform = glGetUniformLocation(data.program.getProgram(), "ambientIntensity");
+		data.modelToCameraMatrixUniform = data.program.getUniformLocation("modelToCameraMatrix");
+		data.lightIntensityUniform = data.program.getUniformLocation("lightIntensity");
+		data.ambientIntensityUniform = data.program.getUniformLocation("ambientIntensity");
 		
-		data.normalModelToCameraMatrixUniform = glGetUniformLocation(data.program.getProgram(), "normalModelToCameraMatrix");
-		data.cameraSpaceLightPosUniform = glGetUniformLocation(data.program.getProgram(), "cameraSpaceLightPos");
-		data.lightAttenuationUniform = glGetUniformLocation(data.program.getProgram(), "lightAttenuation");
-		data.shininessFactorUniform = glGetUniformLocation(data.program.getProgram(), "shininessFactor");
-		data.baseDiffuseColorUniform = glGetUniformLocation(data.program.getProgram(), "baseDiffuseColor");
+		data.normalModelToCameraMatrixUniform = data.program.getUniformLocation("normalModelToCameraMatrix");
+		data.cameraSpaceLightPosUniform = data.program.getUniformLocation("cameraSpaceLightPos");
+		data.lightAttenuationUniform = data.program.getUniformLocation("lightAttenuation");
+		data.shininessFactorUniform = data.program.getUniformLocation("shininessFactor");
+		data.baseDiffuseColorUniform = data.program.getUniformLocation("baseDiffuseColor");
 		
-		int projectionBlock = glGetUniformBlockIndex(data.program.getProgram(), "Projection");
+		int projectionBlock = data.program.getUniformBlockIndex("Projection");
 		glUniformBlockBinding(data.program.getProgram(), projectionBlock, projectionBlockIndex);
 		
 		return data;
 	
 	private UnlitProgramData loadUnlitProgram(String vertFile, String fragFile) {
 		UnlitProgramData data = new UnlitProgramData(new ShaderProgram(readFromFile(vertFile), readFromFile(fragFile)));
-		data.modelToCameraMatrixUniform = glGetUniformLocation(data.program.getProgram(), "modelToCameraMatrix");
-		data.objectColorUniform = glGetUniformLocation(data.program.getProgram(), "objectColor");
+		data.modelToCameraMatrixUniform = data.program.getUniformLocation("modelToCameraMatrix");
+		data.objectColorUniform = data.program.getUniformLocation("objectColor");
 		
-		int projectionBlock = glGetUniformBlockIndex(data.program.getProgram(), "Projection");
+		int projectionBlock = data.program.getUniformBlockIndex("Projection");
 		glUniformBlockBinding(data.program.getProgram(), projectionBlock, projectionBlockIndex);
 		
 		return data;

src/com/ra4king/opengl/arcsynthesis/gl33/chapter11/example2/Example11_2.java

 	
 	private ProgramData loadLitProgram(String vertexFile, String fragmentFile) {
 		ProgramData data = new ProgramData(new ShaderProgram(readFromFile(vertexFile), readFromFile(fragmentFile)));
-		data.modelToCameraMatrixUniform = glGetUniformLocation(data.program.getProgram(), "modelToCameraMatrix");
-		data.lightIntensityUniform = glGetUniformLocation(data.program.getProgram(), "lightIntensity");
-		data.ambientIntensityUniform = glGetUniformLocation(data.program.getProgram(), "ambientIntensity");
+		data.modelToCameraMatrixUniform = data.program.getUniformLocation("modelToCameraMatrix");
+		data.lightIntensityUniform = data.program.getUniformLocation("lightIntensity");
+		data.ambientIntensityUniform = data.program.getUniformLocation("ambientIntensity");
 		
-		data.normalModelToCameraMatrixUniform = glGetUniformLocation(data.program.getProgram(), "normalModelToCameraMatrix");
-		data.cameraSpaceLightPositionUniform = glGetUniformLocation(data.program.getProgram(), "cameraSpaceLightPos");
-		data.lightAttenuationUniform = glGetUniformLocation(data.program.getProgram(), "lightAttenuation");
-		data.shininessFactorUniform = glGetUniformLocation(data.program.getProgram(), "shininessFactor");
-		data.baseDiffuseColorUniform = glGetUniformLocation(data.program.getProgram(), "baseDiffuseColor");
+		data.normalModelToCameraMatrixUniform = data.program.getUniformLocation("normalModelToCameraMatrix");
+		data.cameraSpaceLightPositionUniform = data.program.getUniformLocation("cameraSpaceLightPos");
+		data.lightAttenuationUniform = data.program.getUniformLocation("lightAttenuation");
+		data.shininessFactorUniform = data.program.getUniformLocation("shininessFactor");
+		data.baseDiffuseColorUniform = data.program.getUniformLocation("baseDiffuseColor");
 		
-		int projectionBlock = glGetUniformBlockIndex(data.program.getProgram(), "Projection");
+		int projectionBlock = data.program.getUniformBlockIndex("Projection");
 		glUniformBlockBinding(data.program.getProgram(), projectionBlock, projectionBlockIndex);
 		
 		return data;
 	
 	private UnlitProgramData loadUnlitProgramData(String vertexFile, String fragmentFile) {
 		UnlitProgramData data = new UnlitProgramData(new ShaderProgram(readFromFile(vertexFile), readFromFile(fragmentFile)));
-		data.modelToCameraMatrixUniform = glGetUniformLocation(data.program.getProgram(), "modelToCameraMatrix");
-		data.objectColorUniform = glGetUniformLocation(data.program.getProgram(), "objectColor");
+		data.modelToCameraMatrixUniform = data.program.getUniformLocation("modelToCameraMatrix");
+		data.objectColorUniform = data.program.getUniformLocation("objectColor");
 		
-		int projectionBlock = glGetUniformBlockIndex(data.program.getProgram(), "Projection");
+		int projectionBlock = data.program.getUniformBlockIndex("Projection");
 		glUniformBlockBinding(data.program.getProgram(), projectionBlock, projectionBlockIndex);
 		
 		return data;

src/com/ra4king/opengl/arcsynthesis/gl33/chapter11/example3/Example11_3.java

 	
 	private ProgramData loadLitProgram(String vertexFile, String fragmentFile) {
 		ProgramData data = new ProgramData(new ShaderProgram(readFromFile(vertexFile), readFromFile(fragmentFile)));
-		data.modelToCameraMatrixUniform = glGetUniformLocation(data.program.getProgram(), "modelToCameraMatrix");
-		data.lightIntensityUniform = glGetUniformLocation(data.program.getProgram(), "lightIntensity");
-		data.ambientIntensityUniform = glGetUniformLocation(data.program.getProgram(), "ambientIntensity");
+		data.modelToCameraMatrixUniform = data.program.getUniformLocation("modelToCameraMatrix");
+		data.lightIntensityUniform = data.program.getUniformLocation("lightIntensity");
+		data.ambientIntensityUniform = data.program.getUniformLocation("ambientIntensity");
 		
-		data.normalModelToCameraMatrixUniform = glGetUniformLocation(data.program.getProgram(), "normalModelToCameraMatrix");
-		data.cameraSpaceLightPositionUniform = glGetUniformLocation(data.program.getProgram(), "cameraSpaceLightPos");
-		data.lightAttenuationUniform = glGetUniformLocation(data.program.getProgram(), "lightAttenuation");
-		data.shininessFactorUniform = glGetUniformLocation(data.program.getProgram(), "shininessFactor");
-		data.baseDiffuseColorUniform = glGetUniformLocation(data.program.getProgram(), "baseDiffuseColor");
+		data.normalModelToCameraMatrixUniform = data.program.getUniformLocation("normalModelToCameraMatrix");
+		data.cameraSpaceLightPositionUniform = data.program.getUniformLocation("cameraSpaceLightPos");
+		data.lightAttenuationUniform = data.program.getUniformLocation("lightAttenuation");
+		data.shininessFactorUniform = data.program.getUniformLocation("shininessFactor");
+		data.baseDiffuseColorUniform = data.program.getUniformLocation("baseDiffuseColor");
 		
-		int projectionBlock = glGetUniformBlockIndex(data.program.getProgram(), "Projection");
+		int projectionBlock = data.program.getUniformBlockIndex("Projection");
 		glUniformBlockBinding(data.program.getProgram(), projectionBlock, projectionBlockIndex);
 		
 		return data;
 	
 	private UnlitProgramData loadUnlitProgramData(String vertexFile, String fragmentFile) {
 		UnlitProgramData data = new UnlitProgramData(new ShaderProgram(readFromFile(vertexFile), readFromFile(fragmentFile)));
-		data.modelToCameraMatrixUniform = glGetUniformLocation(data.program.getProgram(), "modelToCameraMatrix");
-		data.objectColorUniform = glGetUniformLocation(data.program.getProgram(), "objectColor");
+		data.modelToCameraMatrixUniform = data.program.getUniformLocation("modelToCameraMatrix");
+		data.objectColorUniform = data.program.getUniformLocation("objectColor");
 		
-		int projectionBlock = glGetUniformBlockIndex(data.program.getProgram(), "Projection");
+		int projectionBlock = data.program.getUniformBlockIndex("Projection");
 		glUniformBlockBinding(data.program.getProgram(), projectionBlock, projectionBlockIndex);
 		
 		return data;

src/com/ra4king/opengl/arcsynthesis/gl33/chapter12/example1/Example12_1.java

 	
 	private ProgramData loadLitProgram(String vertexShader, String fragmentShader) {
 		ProgramData data = new ProgramData(new ShaderProgram(readFromFile(vertexShader), readFromFile(fragmentShader)));
-		data.modelToCameraMatrixUniform = glGetUniformLocation(data.program.getProgram(), "modelToCameraMatrix");
-		data.normalModelTocameraMatrixUniform = glGetUniformLocation(data.program.getProgram(), "normalModelToCameraMatrix");
+		data.modelToCameraMatrixUniform = data.program.getUniformLocation("modelToCameraMatrix");
+		data.normalModelTocameraMatrixUniform = data.program.getUniformLocation("normalModelToCameraMatrix");
 		
-		int materialBlock = glGetUniformBlockIndex(data.program.getProgram(), "Material");
-		int lightBlock = glGetUniformBlockIndex(data.program.getProgram(), "Light");
-		int projectionBlock = glGetUniformBlockIndex(data.program.getProgram(), "Projection");
+		int materialBlock = data.program.getUniformBlockIndex("Material");
+		int lightBlock = data.program.getUniformBlockIndex("Light");
+		int projectionBlock = data.program.getUniformBlockIndex("Projection");
 		
 		if(materialBlock != GL_INVALID_INDEX)
 			glUniformBlockBinding(data.program.getProgram(), materialBlock, materialBlockIndex);
 	
 	private UnlitProgramData loadUnlitProgram(String vertexShader, String fragmentShader) {
 		UnlitProgramData data = new UnlitProgramData(new ShaderProgram(readFromFile(vertexShader), readFromFile(fragmentShader)));
-		data.modelToCameraMatrixUniform = glGetUniformLocation(data.program.getProgram(), "modelToCameraMatrix");
-		data.objectColorUniform = glGetUniformLocation(data.program.getProgram(), "objectColor");
+		data.modelToCameraMatrixUniform = data.program.getUniformLocation("modelToCameraMatrix");
+		data.objectColorUniform = data.program.getUniformLocation("objectColor");
 		
-		int projectionBlock = glGetUniformBlockIndex(data.program.getProgram(), "Projection");
+		int projectionBlock = data.program.getUniformBlockIndex("Projection");
 		glUniformBlockBinding(data.program.getProgram(), projectionBlock, projectionBlockIndex);
 		
 		return data;

src/com/ra4king/opengl/arcsynthesis/gl33/chapter12/example2/Example12_2.java

 	
 	private ProgramData loadLitProgram(String vertexShader, String fragmentShader) {
 		ProgramData data = new ProgramData(new ShaderProgram(readFromFile(vertexShader), readFromFile(fragmentShader)));
-		data.modelToCameraMatrixUniform = glGetUniformLocation(data.program.getProgram(), "modelToCameraMatrix");
-		data.normalModelTocameraMatrixUniform = glGetUniformLocation(data.program.getProgram(), "normalModelToCameraMatrix");
+		data.modelToCameraMatrixUniform = data.program.getUniformLocation("modelToCameraMatrix");
+		data.normalModelTocameraMatrixUniform = data.program.getUniformLocation("normalModelToCameraMatrix");
 		
-		int materialBlock = glGetUniformBlockIndex(data.program.getProgram(), "Material");
-		int lightBlock = glGetUniformBlockIndex(data.program.getProgram(), "Light");
-		int projectionBlock = glGetUniformBlockIndex(data.program.getProgram(), "Projection");
+		int materialBlock = data.program.getUniformBlockIndex("Material");
+		int lightBlock = data.program.getUniformBlockIndex("Light");
+		int projectionBlock = data.program.getUniformBlockIndex("Projection");
 		
 		if(materialBlock != GL_INVALID_INDEX)
 			glUniformBlockBinding(data.program.getProgram(), materialBlock, materialBlockIndex);
 	
 	private UnlitProgramData loadUnlitProgram(String vertexShader, String fragmentShader) {
 		UnlitProgramData data = new UnlitProgramData(new ShaderProgram(readFromFile(vertexShader), readFromFile(fragmentShader)));
-		data.modelToCameraMatrixUniform = glGetUniformLocation(data.program.getProgram(), "modelToCameraMatrix");
-		data.objectColorUniform = glGetUniformLocation(data.program.getProgram(), "objectColor");
+		data.modelToCameraMatrixUniform = data.program.getUniformLocation("modelToCameraMatrix");
+		data.objectColorUniform = data.program.getUniformLocation("objectColor");
 		
-		int projectionBlock = glGetUniformBlockIndex(data.program.getProgram(), "Projection");
+		int projectionBlock = data.program.getUniformBlockIndex("Projection");
 		glUniformBlockBinding(data.program.getProgram(), projectionBlock, projectionBlockIndex);
 		
 		return data;

src/com/ra4king/opengl/arcsynthesis/gl33/chapter12/example3/Example12_3.java

 	
 	private ProgramData loadLitProgram(String vertexShader, String fragmentShader) {
 		ProgramData data = new ProgramData(new ShaderProgram(readFromFile(vertexShader), readFromFile(fragmentShader)));
-		data.modelToCameraMatrixUniform = glGetUniformLocation(data.program.getProgram(), "modelToCameraMatrix");
-		data.normalModelTocameraMatrixUniform = glGetUniformLocation(data.program.getProgram(), "normalModelToCameraMatrix");
+		data.modelToCameraMatrixUniform = data.program.getUniformLocation("modelToCameraMatrix");
+		data.normalModelTocameraMatrixUniform = data.program.getUniformLocation("normalModelToCameraMatrix");
 		
-		int materialBlock = glGetUniformBlockIndex(data.program.getProgram(), "Material");
-		int lightBlock = glGetUniformBlockIndex(data.program.getProgram(), "Light");
-		int projectionBlock = glGetUniformBlockIndex(data.program.getProgram(), "Projection");
+		int materialBlock = data.program.getUniformBlockIndex("Material");
+		int lightBlock = data.program.getUniformBlockIndex("Light");
+		int projectionBlock = data.program.getUniformBlockIndex("Projection");
 		
 		if(materialBlock != GL_INVALID_INDEX)
 			glUniformBlockBinding(data.program.getProgram(), materialBlock, materialBlockIndex);
 	
 	private UnlitProgramData loadUnlitProgram(String vertexShader, String fragmentShader) {
 		UnlitProgramData data = new UnlitProgramData(new ShaderProgram(readFromFile(vertexShader), readFromFile(fragmentShader)));
-		data.modelToCameraMatrixUniform = glGetUniformLocation(data.program.getProgram(), "modelToCameraMatrix");
-		data.objectColorUniform = glGetUniformLocation(data.program.getProgram(), "objectColor");
+		data.modelToCameraMatrixUniform = data.program.getUniformLocation("modelToCameraMatrix");
+		data.objectColorUniform = data.program.getUniformLocation("objectColor");
 		
-		int projectionBlock = glGetUniformBlockIndex(data.program.getProgram(), "Projection");
+		int projectionBlock = data.program.getUniformBlockIndex("Projection");
 		glUniformBlockBinding(data.program.getProgram(), projectionBlock, projectionBlockIndex);
 		
 		return data;

src/com/ra4king/opengl/arcsynthesis/gl33/chapter13/example1/Example13_1.java

 	
 	private UnlitProgramData loadUnlitProgram(String vertexShader, String fragmentShader) {
 		UnlitProgramData data = new UnlitProgramData(new ShaderProgram(readFromFile(vertexShader), readFromFile(fragmentShader)));
-		data.modelToCameraMatrixUniform = glGetUniformLocation(data.program.getProgram(), "modelToCameraMatrix");
-		data.objectColorUniform = glGetUniformLocation(data.program.getProgram(), "objectColor");
+		data.modelToCameraMatrixUniform = data.program.getUniformLocation("modelToCameraMatrix");
+		data.objectColorUniform = data.program.getUniformLocation("objectColor");
 		
-		int projectionBlock = glGetUniformBlockIndex(data.program.getProgram(), "Projection");
+		int projectionBlock = data.program.getUniformBlockIndex("Projection");
 		glUniformBlockBinding(data.program.getProgram(), projectionBlock, projectionBlockIndex);
 		
 		return data;
 	
 	private ProgramMeshData loadLitMeshProgram(String vertexShader, String fragmentShader) {
 		ProgramMeshData data = new ProgramMeshData(new ShaderProgram(readFromFile(vertexShader), readFromFile(fragmentShader)));
-		data.modelToCameraMatrixUniform = glGetUniformLocation(data.program.getProgram(), "modelToCameraMatrix");
-		data.normalModelToCameraMatrixUniform = glGetUniformLocation(data.program.getProgram(), "normalModelToCameraMatrix");
+		data.modelToCameraMatrixUniform = data.program.getUniformLocation("modelToCameraMatrix");
+		data.normalModelToCameraMatrixUniform = data.program.getUniformLocation("normalModelToCameraMatrix");
 		
-		int materialBlock = glGetUniformBlockIndex(data.program.getProgram(), "Material");
-		int lightBlockBlock = glGetUniformBlockIndex(data.program.getProgram(), "Light");
-		int projectionBlock = glGetUniformBlockIndex(data.program.getProgram(), "Projection");
+		int materialBlock = data.program.getUniformBlockIndex("Material");
+		int lightBlockBlock = data.program.getUniformBlockIndex("Light");
+		int projectionBlock = data.program.getUniformBlockIndex("Projection");
 		
 		glUniformBlockBinding(data.program.getProgram(), materialBlock, materialBlockIndex);
 		glUniformBlockBinding(data.program.getProgram(), lightBlockBlock, lightBlockIndex);
 	
 	private ProgramImposData loadLitImposProgram(String vertexShader, String fragmentShader) {
 		ProgramImposData data = new ProgramImposData(new ShaderProgram(readFromFile(vertexShader), readFromFile(fragmentShader)));
-		data.sphereRadiusUniform = glGetUniformLocation(data.program.getProgram(), "sphereRadius");
-		data.cameraSpherePosUniform = glGetUniformLocation(data.program.getProgram(), "cameraSpherePos");
+		data.sphereRadiusUniform = data.program.getUniformLocation("sphereRadius");
+		data.cameraSpherePosUniform = data.program.getUniformLocation("cameraSpherePos");
 		
-		int materialBlock = glGetUniformBlockIndex(data.program.getProgram(), "Material");
-		int lightBlockBlock = glGetUniformBlockIndex(data.program.getProgram(), "Light");
-		int projectionBlock = glGetUniformBlockIndex(data.program.getProgram(), "Projection");
+		int materialBlock = data.program.getUniformBlockIndex("Material");
+		int lightBlockBlock = data.program.getUniformBlockIndex("Light");
+		int projectionBlock = data.program.getUniformBlockIndex("Projection");
 		
 		glUniformBlockBinding(data.program.getProgram(), materialBlock, materialBlockIndex);
 		glUniformBlockBinding(data.program.getProgram(), lightBlockBlock, lightBlockIndex);

src/com/ra4king/opengl/arcsynthesis/gl33/chapter13/example2/Example13_2.java

 	
 	private ProgramMeshData loadLitMeshProgram(String vertexShader, String fragmentShader) {
 		ProgramMeshData data = new ProgramMeshData(new ShaderProgram(readFromFile(vertexShader), readFromFile(fragmentShader)));
-		data.modelToCameraMatrix = glGetUniformLocation(data.program.getProgram(), "modelToCameraMatrix");
-		data.normalModelToCameraMatrix = glGetUniformLocation(data.program.getProgram(), "normalModelToCameraMatrix");
+		data.modelToCameraMatrix = data.program.getUniformLocation("modelToCameraMatrix");
+		data.normalModelToCameraMatrix = data.program.getUniformLocation("normalModelToCameraMatrix");
 		
-		int materialBlock = glGetUniformBlockIndex(data.program.getProgram(), "Material");
-		int lightBlock = glGetUniformBlockIndex(data.program.getProgram(), "Light");
-		int projectionBlock = glGetUniformBlockIndex(data.program.getProgram(), "Projection");
+		int materialBlock = data.program.getUniformBlockIndex("Material");
+		int lightBlock = data.program.getUniformBlockIndex("Light");
+		int projectionBlock = data.program.getUniformBlockIndex("Projection");
 		
 		glUniformBlockBinding(data.program.getProgram(), materialBlock, materialBlockIndex);
 		glUniformBlockBinding(data.program.getProgram(), lightBlock, lightBlockIndex);
 	private ProgramImposData loadLitImposProgram(String vertexShader, String geometryShader, String fragmentShader) {
 		ProgramImposData data = new ProgramImposData(new ShaderProgram(readFromFile(vertexShader), readFromFile(geometryShader), readFromFile(fragmentShader)));
 		
-		int materialBlock = glGetUniformBlockIndex(data.program.getProgram(), "Material");
-		int lightBlock = glGetUniformBlockIndex(data.program.getProgram(), "Light");
-		int projectionBlock = glGetUniformBlockIndex(data.program.getProgram(), "Projection");
+		int materialBlock = data.program.getUniformBlockIndex("Material");
+		int lightBlock = data.program.getUniformBlockIndex("Light");
+		int projectionBlock = data.program.getUniformBlockIndex("Projection");
 		
 		glUniformBlockBinding(data.program.getProgram(), materialBlock, materialBlockIndex);
 		glUniformBlockBinding(data.program.getProgram(), lightBlock, lightBlockIndex);
 	
 	private UnlitProgramData loadUnlitProgram(String vertexShader, String fragmentShader) {
 		UnlitProgramData data = new UnlitProgramData(new ShaderProgram(readFromFile(vertexShader), readFromFile(fragmentShader)));
-		data.modelToCameraMatrixUniform = glGetUniformLocation(data.program.getProgram(), "modelToCameraMatrix");
-		data.objectColorUniform = glGetUniformLocation(data.program.getProgram(), "objectColor");
+		data.modelToCameraMatrixUniform = data.program.getUniformLocation("modelToCameraMatrix");
+		data.objectColorUniform = data.program.getUniformLocation("objectColor");
 		
-		int projectionBlock = glGetUniformBlockIndex(data.program.getProgram(), "Projection");
+		int projectionBlock = data.program.getUniformBlockIndex("Projection");
 		glUniformBlockBinding(data.program.getProgram(), projectionBlock, projectionBlockIndex);
 		
 		return data;

src/com/ra4king/opengl/arcsynthesis/gl33/chapter14/example1/Example14_1.java

 	
 	private ProgramData loadStandardProgram(String vertexShader, String fragmentShader) {
 		ProgramData data = new ProgramData(new ShaderProgram(readFromFile(vertexShader), readFromFile(fragmentShader)));
-		data.modelToCameraMatrixUniform = glGetUniformLocation(data.program.getProgram(), "modelToCameraMatrix");
-		data.normalModelToCameraMatrixUniform = glGetUniformLocation(data.program.getProgram(), "normalModelToCameraMatrix");
+		data.modelToCameraMatrixUniform = data.program.getUniformLocation("modelToCameraMatrix");
+		data.normalModelToCameraMatrixUniform = data.program.getUniformLocation("normalModelToCameraMatrix");
 		
-		int materialBlock = glGetUniformBlockIndex(data.program.getProgram(), "Material");
-		int lightBlock = glGetUniformBlockIndex(data.program.getProgram(), "Light");
-		int projectionBlock = glGetUniformBlockIndex(data.program.getProgram(), "Projection");
+		int materialBlock = data.program.getUniformBlockIndex("Material");
+		int lightBlock = data.program.getUniformBlockIndex("Light");
+		int projectionBlock = data.program.getUniformBlockIndex("Projection");
 		
 		glUniformBlockBinding(data.program.getProgram(), materialBlock, materialBlockIndex);
 		glUniformBlockBinding(data.program.getProgram(), lightBlock, lightBlockIndex);
 		glUniformBlockBinding(data.program.getProgram(), projectionBlock, projectionBlockIndex);
 		
-		int gaussianTextureUniform = glGetUniformLocation(data.program.getProgram(), "gaussianTexture");
+		int gaussianTextureUniform = data.program.getUniformLocation("gaussianTexture");
 		data.program.begin();
 		glUniform1i(gaussianTextureUniform, gaussTexUnit);
 		data.program.end();
 	
 	private UnlitProgramData loadUnlitProgram(String vertexShader, String fragmentShader) {
 		UnlitProgramData data = new UnlitProgramData(new ShaderProgram(readFromFile(vertexShader), readFromFile(fragmentShader)));
-		data.modelToCameraMatrixUniform = glGetUniformLocation(data.program.getProgram(), "modelToCameraMatrix");
-		data.objectColorUniform = glGetUniformLocation(data.program.getProgram(), "objectColor");
+		data.modelToCameraMatrixUniform = data.program.getUniformLocation("modelToCameraMatrix");
+		data.objectColorUniform = data.program.getUniformLocation("objectColor");
 		
-		int projectionBlock = glGetUniformBlockIndex(data.program.getProgram(), "Projection");
+		int projectionBlock = data.program.getUniformBlockIndex("Projection");
 		glUniformBlockBinding(data.program.getProgram(), projectionBlock, projectionBlockIndex);
 		
 		return data;

src/com/ra4king/opengl/arcsynthesis/gl33/chapter14/example2/Example14_2.java

 	
 	private ProgramData loadProgram(String vertex, String fragment) {
 		ProgramData data = new ProgramData(new ShaderProgram(readFromFile(vertex), readFromFile(fragment)));
-		data.cameraToClipMatrixUniform = glGetUniformLocation(data.program.getProgram(), "cameraToClipMatrix");
+		data.cameraToClipMatrixUniform = data.program.getUniformLocation("cameraToClipMatrix");
 		
 		return data;
 	}

src/com/ra4king/opengl/arcsynthesis/gl33/chapter14/example3/Example14_3.java

 	
 	private ProgramData loadStandardProgram(String vertexShader, String fragmentShader) {
 		ProgramData data = new ProgramData(new ShaderProgram(readFromFile(vertexShader), readFromFile(fragmentShader)));
-		data.modelToCameraMatrixUniform = glGetUniformLocation(data.program.getProgram(), "modelToCameraMatrix");
-		data.normalModelToCameraMatrixUniform = glGetUniformLocation(data.program.getProgram(), "normalModelToCameraMatrix");
+		data.modelToCameraMatrixUniform = data.program.getUniformLocation("modelToCameraMatrix");
+		data.normalModelToCameraMatrixUniform = data.program.getUniformLocation("normalModelToCameraMatrix");
 		
-		int materialBlock = glGetUniformBlockIndex(data.program.getProgram(), "Material");
-		int lightBlock = glGetUniformBlockIndex(data.program.getProgram(), "Light");
-		int projectionBlock = glGetUniformBlockIndex(data.program.getProgram(), "Projection");
+		int materialBlock = data.program.getUniformBlockIndex("Material");
+		int lightBlock = data.program.getUniformBlockIndex("Light");
+		int projectionBlock = data.program.getUniformBlockIndex("Projection");
 		
 		glUniformBlockBinding(data.program.getProgram(), materialBlock, materialBlockIndex);
 		glUniformBlockBinding(data.program.getProgram(), lightBlock, lightBlockIndex);
 		glUniformBlockBinding(data.program.getProgram(), projectionBlock, projectionBlockIndex);
 		
-		int gaussianTextureUniform = glGetUniformLocation(data.program.getProgram(), "gaussianTexture");
-		int shininessTextureUniform = glGetUniformLocation(data.program.getProgram(), "shininessTexture");
+		int gaussianTextureUniform = data.program.getUniformLocation("gaussianTexture");
+		int shininessTextureUniform = data.program.getUniformLocation("shininessTexture");
 		
 		data.program.begin();
 		glUniform1i(gaussianTextureUniform, gaussTexUnit);
 	
 	private UnlitProgramData loadUnlitProgram(String vertexShader, String fragmentShader) {
 		UnlitProgramData data = new UnlitProgramData(new ShaderProgram(readFromFile(vertexShader), readFromFile(fragmentShader)));
-		data.modelToCameraMatrixUniform = glGetUniformLocation(data.program.getProgram(), "modelToCameraMatrix");
-		data.objectColorUniform = glGetUniformLocation(data.program.getProgram(), "objectColor");
+		data.modelToCameraMatrixUniform = data.program.getUniformLocation("modelToCameraMatrix");
+		data.objectColorUniform = data.program.getUniformLocation("objectColor");
 		
-		int projectionBlock = glGetUniformBlockIndex(data.program.getProgram(), "Projection");
+		int projectionBlock = data.program.getUniformBlockIndex("Projection");
 		glUniformBlockBinding(data.program.getProgram(), projectionBlock, projectionBlockIndex);
 		
 		return data;

src/com/ra4king/opengl/arcsynthesis/gl33/chapter15/Example15_1.java

 	
 	private ProgramData loadProgram(String vertexShader, String fragmentShader) {
 		ProgramData data = new ProgramData(new ShaderProgram(readFromFile(vertexShader), readFromFile(fragmentShader)));
-		data.modelToCameraMatrixUniform = glGetUniformLocation(data.program.getProgram(), "modelToCameraMatrix");
+		data.modelToCameraMatrixUniform = data.program.getUniformLocation("modelToCameraMatrix");
 		
-		int projectionBlock = glGetUniformBlockIndex(data.program.getProgram(), "Projection");
+		int projectionBlock = data.program.getUniformBlockIndex("Projection");
 		
 		glUniformBlockBinding(data.program.getProgram(), projectionBlock, projectionBlockIndex);
 		
-		int colorTextureUniform = glGetUniformLocation(data.program.getProgram(), "colorTexture");
+		int colorTextureUniform = data.program.getUniformLocation("colorTexture");
 		data.program.begin();
 		glUniform1i(colorTextureUniform, colorTexUnit);
 		data.program.end();

src/com/ra4king/opengl/arcsynthesis/gl33/chapter16/example1/Example16_1.java

 		String vertexShader = readFromFile("example16.1.ScreenCoords.vert");
 		noGammaProgram = new ShaderProgram(vertexShader, readFromFile("example16.1.TextureNoGamma.frag"));
 		
-		int projectionBlock = glGetUniformBlockIndex(noGammaProgram.getProgram(), "Projection");
+		int projectionBlock = noGammaProgram.getUniformBlockIndex("Projection");
 		glUniformBlockBinding(noGammaProgram.getProgram(), projectionBlock, projectionBlockIndex);
 		
-		int colorTextureUniform = glGetUniformLocation(noGammaProgram.getProgram(), "colorTexture");
+		int colorTextureUniform = noGammaProgram.getUniformLocation("colorTexture");
 		noGammaProgram.begin();
 		glUniform1i(colorTextureUniform, gammaRampTextureUnit);
 		noGammaProgram.end();
 		
 		gammaProgram = new ShaderProgram(vertexShader, readFromFile("example16.1.TextureGamma.frag"));
-		projectionBlock = glGetUniformBlockIndex(gammaProgram.getProgram(), "Projection");
+		projectionBlock = gammaProgram.getUniformBlockIndex("Projection");
 		glUniformBlockBinding(gammaProgram.getProgram(), projectionBlock, projectionBlockIndex);
 		
-		colorTextureUniform = glGetUniformLocation(gammaProgram.getProgram(), "colorTexture");
+		colorTextureUniform = gammaProgram.getUniformLocation("colorTexture");
 		gammaProgram.begin();
 		glUniform1i(colorTextureUniform, gammaRampTextureUnit);
 		gammaProgram.end();

src/com/ra4king/opengl/arcsynthesis/gl33/chapter16/example2/Example16_2.java

 	
 	private ProgramData loadProgram(String vertexShader, String fragmentShader) {
 		ProgramData data = new ProgramData(new ShaderProgram(readFromFile(vertexShader), readFromFile(fragmentShader)));
-		data.modelToCameraMatrixUniform = glGetUniformLocation(data.program.getProgram(), "modelToCameraMatrix");
+		data.modelToCameraMatrixUniform = data.program.getUniformLocation("modelToCameraMatrix");
 		
-		int projectionBlock = glGetUniformBlockIndex(data.program.getProgram(), "Projection");
+		int projectionBlock = data.program.getUniformBlockIndex("Projection");
 		
 		glUniformBlockBinding(data.program.getProgram(), projectionBlock, projectionBlockIndex);
 		
-		int colorTextureUniform = glGetUniformLocation(data.program.getProgram(), "colorTexture");
+		int colorTextureUniform = data.program.getUniformLocation("colorTexture");
 		data.program.begin();
 		glUniform1i(colorTextureUniform, colorTexUnit);
 		data.program.end();

src/com/ra4king/opengl/arcsynthesis/gl33/chapter16/example3/Example16_3.java

 	
 	private ProgramData loadProgram(String vertexShader, String fragmentShader) {
 		ProgramData data = new ProgramData(new ShaderProgram(readFromFile(vertexShader), readFromFile(fragmentShader)));
-		data.modelToCameraMatrixUniform = glGetUniformLocation(data.program.getProgram(), "modelToCameraMatrix");
-		data.numberOfLightsUniform = glGetUniformLocation(data.program.getProgram(), "numberOfLights");
+		data.modelToCameraMatrixUniform = data.program.getUniformLocation("modelToCameraMatrix");
+		data.numberOfLightsUniform = data.program.getUniformLocation("numberOfLights");
 		
-		int projectionBlock = glGetUniformBlockIndex(data.program.getProgram(), "Projection");
+		int projectionBlock = data.program.getUniformBlockIndex("Projection");
 		glUniformBlockBinding(data.program.getProgram(), projectionBlock, projectionBlockIndex);
 		
-		int lightBlock = glGetUniformBlockIndex(data.program.getProgram(), "Light");
+		int lightBlock = data.program.getUniformBlockIndex("Light");
 		glUniformBlockBinding(data.program.getProgram(), lightBlock, lightBlockIndex);
 		
-		int colorTextureUniform = glGetUniformLocation(data.program.getProgram(), "diffuseColorTex");
+		int colorTextureUniform = data.program.getUniformLocation("diffuseColorTex");
 		data.program.begin();
 		glUniform1i(colorTextureUniform, colorTexUnit);
 		data.program.end();
 	
 	private UnlitProgramData loadUnlitProgram(String vertexShader, String fragmentShader) {
 		UnlitProgramData data = new UnlitProgramData(new ShaderProgram(readFromFile(vertexShader), readFromFile(fragmentShader)));
-		data.modelToCameraMatrixUniform = glGetUniformLocation(data.program.getProgram(), "modelToCameraMatrix");
-		data.objectColorUniform = glGetUniformLocation(data.program.getProgram(), "objectColor");
+		data.modelToCameraMatrixUniform = data.program.getUniformLocation("modelToCameraMatrix");
+		data.objectColorUniform = data.program.getUniformLocation("objectColor");
 		
-		int projectionBlock = glGetUniformBlockIndex(data.program.getProgram(), "Projection");
+		int projectionBlock = data.program.getUniformBlockIndex("Projection");
 		glUniformBlockBinding(data.program.getProgram(), projectionBlock, projectionBlockIndex);
 		
 		return data;

src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example1/Example17_1.java

 		spinBarOrient = nodes.get(3).getOrient();
 		
 		unlit = scene.findProgram("p_unlit");
-		unlitModelToCameraMatrixUniform = glGetUniformLocation(unlit.getProgram(), "modelToCameraMatrix");
-		unlitObjectColorUniform = glGetUniformLocation(unlit.getProgram(), "objectColor");
+		unlitModelToCameraMatrixUniform = unlit.getUniformLocation("modelToCameraMatrix");
+		unlitObjectColorUniform = unlit.getUniformLocation("objectColor");
 	}
 	
 	@Override

src/com/ra4king/opengl/arcsynthesis/gl33/chapter17/example3/Example17_3.java

 		spinBarOrient = nodes.get(3).getOrient();
 		
 		unlit = scene.findProgram("p_unlit");
-		unlitModelToCameraMatrixUniform = glGetUniformLocation(unlit.getProgram(), "modelToCameraMatrix");
-		unlitObjectColorUniform = glGetUniformLocation(unlit.getProgram(), "objectColor");
+		unlitModelToCameraMatrixUniform = unlit.getUniformLocation("modelToCameraMatrix");
+		unlitObjectColorUniform = unlit.getUniformLocation("objectColor");
 		
 		colored = scene.findProgram("p_colored");
-		coloredModelToCameraMatrixUniform = glGetUniformLocation(colored.getProgram(), "modelToCameraMatrix");
+		coloredModelToCameraMatrixUniform = colored.getUniformLocation("modelToCameraMatrix");
 		
 		sphereMesh = scene.findMesh("m_sphere");
 		axesMesh = scene.findMesh("m_axes");

src/com/ra4king/opengl/arcsynthesis/gl33/chapter3/example2/Example3_2.java

 		glClearColor(0, 0, 0, 0);
 		
 		program = new ShaderProgram(readFromFile("example3.2.vert"), readFromFile("example3.2.frag"));
-		offsetLocation = glGetUniformLocation(program.getProgram(), "offset");
+		offsetLocation = program.getUniformLocation("offset");
 		
 		vbo = glGenBuffers();
 		

src/com/ra4king/opengl/arcsynthesis/gl33/chapter3/example3/Example3_3.java

 		glClearColor(0, 0, 0, 0);
 		
 		program = new ShaderProgram(readFromFile("example3.3.vert"), readFromFile("example3.3.frag"));
-		timeLocation = glGetUniformLocation(program.getProgram(), "time");
+		timeLocation = program.getUniformLocation("time");
 		
-		int loopDurationLocation = glGetUniformLocation(program.getProgram(), "loopDuration");
+		int loopDurationLocation = program.getUniformLocation("loopDuration");
 		program.begin();
 		glUniform1f(loopDurationLocation, 5);
 		program.end();

src/com/ra4king/opengl/arcsynthesis/gl33/chapter3/example4/Example3_4.java

 		glClearColor(0, 0, 0, 0);
 		
 		program = new ShaderProgram(readFromFile("example3.4.vert"), readFromFile("example3.4.frag"));
-		timeLocation = glGetUniformLocation(program.getProgram(), "time");
+		timeLocation = program.getUniformLocation("time");
 		
-		int loopDurationLocation = glGetUniformLocation(program.getProgram(), "loopDuration");
-		int fragLoopDuration = glGetUniformLocation(program.getProgram(), "fragLoopDuration");
+		int loopDurationLocation = program.getUniformLocation("loopDuration");
+		int fragLoopDuration = program.getUniformLocation("fragLoopDuration");
 		program.begin();
 		glUniform1f(loopDurationLocation, 5);
 		glUniform1f(fragLoopDuration, 10);

src/com/ra4king/opengl/arcsynthesis/gl33/chapter4/example1/Example4_1.java

 		
 		program = new ShaderProgram(readFromFile("example4.1.vert"), readFromFile("example4.1.frag"));
 		
-		offsetUniform = glGetUniformLocation(program.getProgram(), "offset");
+		offsetUniform = program.getUniformLocation("offset");
 		
 		vbo = glGenBuffers();
 		

src/com/ra4king/opengl/arcsynthesis/gl33/chapter4/example2/Example4_2.java

 		
 		program = new ShaderProgram(readFromFile("example4.2.vert"), readFromFile("example4.2.frag"));
 		
-		offsetUniform = glGetUniformLocation(program.getProgram(), "offset");
+		offsetUniform = program.getUniformLocation("offset");
 		
-		int frustumScaleUniform = glGetUniformLocation(program.getProgram(), "frustumScale");
-		int zNearUniform = glGetUniformLocation(program.getProgram(), "zNear");
-		int zFarUniform = glGetUniformLocation(program.getProgram(), "zFar");
+		int frustumScaleUniform = program.getUniformLocation("frustumScale");
+		int zNearUniform = program.getUniformLocation("zNear");
+		int zFarUniform = program.getUniformLocation("zFar");
 		
 		program.begin();
 		glUniform1f(frustumScaleUniform, 1);

src/com/ra4king/opengl/arcsynthesis/gl33/chapter4/example3/Example4_3.java

 		
 		program = new ShaderProgram(readFromFile("example4.3.vert"), readFromFile("example4.3.frag"));
 		
-		offsetUniform = glGetUniformLocation(program.getProgram(), "offset");
+		offsetUniform = program.getUniformLocation("offset");
 		
-		int perspectiveMatrixUniform = glGetUniformLocation(program.getProgram(), "perspectiveMatrix");
+		int perspectiveMatrixUniform = program.getUniformLocation("perspectiveMatrix");
 		
 		float frustumScale = 1, zNear = 0.5f, zFar = 3;
 		FloatBuffer perspectiveMatrix = BufferUtils.createFloatBuffer(16);

src/com/ra4king/opengl/arcsynthesis/gl33/chapter4/example4/Example4_4.java

 		
 		program = new ShaderProgram(readFromFile("example4.4.vert"), readFromFile("example4.4.frag"));
 		
-		offsetUniform = glGetUniformLocation(program.getProgram(), "offset");
+		offsetUniform = program.getUniformLocation("offset");
 		
-		perspectiveMatrixUniform = glGetUniformLocation(program.getProgram(), "perspectiveMatrix");
+		perspectiveMatrixUniform = program.getUniformLocation("perspectiveMatrix");
 		
 		float zNear = 0.5f, zFar = 3;
 		perspectiveMatrix = BufferUtils.createFloatBuffer(16);

src/com/ra4king/opengl/arcsynthesis/gl33/chapter5/example1/Example5_1.java

 		
 		program = new ShaderProgram(readFromFile("example5.1.vert"), readFromFile("example5.1.frag"));
 		
-		offsetUniform = glGetUniformLocation(program.getProgram(), "offset");
+		offsetUniform = program.getUniformLocation("offset");
 		
-		perspectiveMatrixUniform = glGetUniformLocation(program.getProgram(), "perspectiveMatrix");
+		perspectiveMatrixUniform = program.getUniformLocation("perspectiveMatrix");
 		
 		float zNear = 0.5f, zFar = 3;
 		perspectiveMatrix = BufferUtils.createFloatBuffer(16);

src/com/ra4king/opengl/arcsynthesis/gl33/chapter5/example2/Example5_2.java

 		
 		program = new ShaderProgram(readFromFile("example5.2.vert"), readFromFile("example5.2.frag"));
 		
-		offsetUniform = glGetUniformLocation(program.getProgram(), "offset");
+		offsetUniform = program.getUniformLocation("offset");
 		
-		perspectiveMatrixUniform = glGetUniformLocation(program.getProgram(), "perspectiveMatrix");
+		perspectiveMatrixUniform = program.getUniformLocation("perspectiveMatrix");
 		
 		float zNear = 1, zFar = 3;
 		perspectiveMatrix = BufferUtils.createFloatBuffer(16);

src/com/ra4king/opengl/arcsynthesis/gl33/chapter5/example3/Example5_3.java

 		
 		program = new ShaderProgram(readFromFile("example5.3.vert"), readFromFile("example5.3.frag"));
 		
-		offsetUniform = glGetUniformLocation(program.getProgram(), "offset");
+		offsetUniform = program.getUniformLocation("offset");
 		
-		perspectiveMatrixUniform = glGetUniformLocation(program.getProgram(), "perspectiveMatrix");
+		perspectiveMatrixUniform = program.getUniformLocation("perspectiveMatrix");
 		
 		float zNear = 1, zFar = 3;
 		perspectiveMatrix = BufferUtils.createFloatBuffer(16);

src/com/ra4king/opengl/arcsynthesis/gl33/chapter5/example4/Example5_4.java

 		
 		program = new ShaderProgram(readFromFile("example5.4.vert"), readFromFile("example5.4.frag"));
 		
-		offsetUniform = glGetUniformLocation(program.getProgram(), "offset");
+		offsetUniform = program.getUniformLocation("offset");
 		
-		perspectiveMatrixUniform = glGetUniformLocation(program.getProgram(), "perspectiveMatrix");
+		perspectiveMatrixUniform = program.getUniformLocation("perspectiveMatrix");
 		
 		float zNear = 1, zFar = 3;
 		perspectiveMatrix = BufferUtils.createFloatBuffer(16);

src/com/ra4king/opengl/arcsynthesis/gl33/chapter5/example5/Example5_5.java

 		
 		program = new ShaderProgram(readFromFile("example5.5.vert"), readFromFile("example5.5.frag"));
 		
-		offsetUniform = glGetUniformLocation(program.getProgram(), "offset");
+		offsetUniform = program.getUniformLocation("offset");
 		
-		perspectiveMatrixUniform = glGetUniformLocation(program.getProgram(), "perspectiveMatrix");
+		perspectiveMatrixUniform = program.getUniformLocation("perspectiveMatrix");
 		
 		float zNear = 1, zFar = 3;
 		perspectiveMatrix = BufferUtils.createFloatBuffer(16);

src/com/ra4king/opengl/arcsynthesis/gl33/chapter6/example1/Example6_1.java

 		
 		program = new ShaderProgram(readFromFile("example6.1.vert"), readFromFile("example6.1.frag"));
 		
-		modelToCameraMatrixUniform = glGetUniformLocation(program.getProgram(), "modelToCameraMatrix");
-		cameraToClipMatrixUniform = glGetUniformLocation(program.getProgram(), "cameraToClipMatrix");
+		modelToCameraMatrixUniform = program.getUniformLocation("modelToCameraMatrix");
+		cameraToClipMatrixUniform = program.getUniformLocation("cameraToClipMatrix");
 		
 		modelToCameraMatrices = new Matrix4[3];
 		for(int a = 0; a < modelToCameraMatrices.length; a++)

src/com/ra4king/opengl/arcsynthesis/gl33/chapter6/example2/Example6_2.java

 		
 		program = new ShaderProgram(readFromFile("example6.2.vert"), readFromFile("example6.2.frag"));
 		
-		modelToCameraMatrixUniform = glGetUniformLocation(program.getProgram(), "modelToCameraMatrix");
-		cameraToClipMatrixUniform = glGetUniformLocation(program.getProgram(), "cameraToClipMatrix");
+		modelToCameraMatrixUniform = program.getUniformLocation("modelToCameraMatrix");
+		cameraToClipMatrixUniform = program.getUniformLocation("cameraToClipMatrix");
 		
 		modelToCameraMatrices = new Matrix4[5];
 		for(int a = 0; a < modelToCameraMatrices.length; a++)

src/com/ra4king/opengl/arcsynthesis/gl33/chapter6/example3/Example6_3.java

 		
 		program = new ShaderProgram(readFromFile("example6.3.vert"), readFromFile("example6.3.frag"));
 		
-		modelToCameraMatrixUniform = glGetUniformLocation(program.getProgram(), "modelToCameraMatrix");
-		cameraToClipMatrixUniform = glGetUniformLocation(program.getProgram(), "cameraToClipMatrix");
+		modelToCameraMatrixUniform = program.getUniformLocation("modelToCameraMatrix");
+		cameraToClipMatrixUniform = program.getUniformLocation("cameraToClipMatrix");
 		
 		modelToCameraMatrices = new Matrix4[5];
 		for(int a = 0; a < modelToCameraMatrices.length; a++)

src/com/ra4king/opengl/arcsynthesis/gl33/chapter6/example4/Example6_4.java

 		
 		program = new ShaderProgram(readFromFile("example6.4.vert"), readFromFile("example6.4.frag"));
 		
-		modelToCameraMatrixUniform = glGetUniformLocation(program.getProgram(), "modelToCameraMatrix");
-		cameraToClipMatrixUniform = glGetUniformLocation(program.getProgram(), "cameraToClipMatrix");
+		modelToCameraMatrixUniform = program.getUniformLocation("modelToCameraMatrix");
+		cameraToClipMatrixUniform = program.getUniformLocation("cameraToClipMatrix");
 		
 		hierarchy = new Hierarchy();
 		cameraToClipMatrix = new Matrix4().clearToPerspective(45 * (float)Math.PI / 180, getWidth(), getHeight(), 1, 100);

src/com/ra4king/opengl/arcsynthesis/gl33/chapter7/example1/Example7_1.java

 	
 	private ProgramData loadProgram(String vs, String fs) {
 		ProgramData data = new ProgramData(new ShaderProgram(readFromFile(vs), readFromFile(fs)));
-		data.modelToWorldMatrixUniform = glGetUniformLocation(data.program.getProgram(), "modelToWorldMatrix");
-		data.worldToCameraMatrixUniform = glGetUniformLocation(data.program.getProgram(), "worldToCameraMatrix");
-		data.cameraToClipMatrixUniform = glGetUniformLocation(data.program.getProgram(), "cameraToClipMatrix");
-		data.baseColorUniform = glGetUniformLocation(data.program.getProgram(), "baseColor");
+		data.modelToWorldMatrixUniform = data.program.getUniformLocation("modelToWorldMatrix");
+		data.worldToCameraMatrixUniform = data.program.getUniformLocation("worldToCameraMatrix");
+		data.cameraToClipMatrixUniform = data.program.getUniformLocation("cameraToClipMatrix");
+		data.baseColorUniform = data.program.getUniformLocation("baseColor");
 		return data;
 	}
 	

src/com/ra4king/opengl/arcsynthesis/gl33/chapter7/example2/Example7_2.java

 	
 	private ProgramData loadProgram(String vs, String fs) {
 		ProgramData data = new ProgramData(new ShaderProgram(readFromFile(vs), readFromFile(fs)));
-		data.modelToWorldMatrixUniform = glGetUniformLocation(data.program.getProgram(), "modelToWorldMatrix");
-		data.globalUniformBlockIndex = glGetUniformBlockIndex(data.program.getProgram(), "GlobalMatrices");
-		data.baseColorUniform = glGetUniformLocation(data.program.getProgram(), "baseColor");
+		data.modelToWorldMatrixUniform = data.program.getUniformLocation("modelToWorldMatrix");
+		data.globalUniformBlockIndex = data.program.getUniformBlockIndex("GlobalMatrices");
+		data.baseColorUniform = data.program.getUniformLocation("baseColor");
 		
 		glUniformBlockBinding(data.program.getProgram(), data.globalUniformBlockIndex, globalMatricesBindingIndex);
 		

src/com/ra4king/opengl/arcsynthesis/gl33/chapter8/example1/Example8_1.java

 		
 		program = new ShaderProgram(readFromFile("example8.1.vert"), readFromFile("example8.1.frag"));
 		
-		modelToCameraMatrixUniform = glGetUniformLocation(program.getProgram(), "modelToCameraMatrix");
-		cameraToClipMatrixUniform = glGetUniformLocation(program.getProgram(), "cameraToClipMatrix");
-		baseColorUniform = glGetUniformLocation(program.getProgram(), "baseColor");
+		modelToCameraMatrixUniform = program.getUniformLocation("modelToCameraMatrix");
+		cameraToClipMatrixUniform = program.getUniformLocation("cameraToClipMatrix");
+		baseColorUniform = program.getUniformLocation("baseColor");
 		
 		cameraToClipMatrix = new Matrix4();
 		

src/com/ra4king/opengl/arcsynthesis/gl33/chapter8/example2/Example8_2.java

 		
 		program = new ShaderProgram(readFromFile("example8.2.vert"), readFromFile("example8.2.frag"));
 		
-		modelToClipMatrixUniform = glGetUniformLocation(program.getProgram(), "modelToCameraMatrix");
-		cameraToClipMatrixUniform = glGetUniformLocation(program.getProgram(), "cameraToClipMatrix");
-		baseColorUniform = glGetUniformLocation(program.getProgram(), "baseColor");
+		modelToClipMatrixUniform = program.getUniformLocation("modelToCameraMatrix");
+		cameraToClipMatrixUniform = program.getUniformLocation("cameraToClipMatrix");
+		baseColorUniform = program.getUniformLocation("baseColor");
 		
 		try {
 			ship = new Mesh(getClass().getResource("example8.2.Ship.xml"));

src/com/ra4king/opengl/arcsynthesis/gl33/chapter8/example3/Example8_3.java

 		
 		program = new ShaderProgram(readFromFile("example8.3.vert"), readFromFile("example8.3.frag"));
 		
-		modelToCameraMatrixUniform = glGetUniformLocation(program.getProgram(), "modelToCameraMatrix");
-		cameraToClipMatrixUniform = glGetUniformLocation(program.getProgram(), "cameraToClipMatrix");
-		baseColorUniform = glGetUniformLocation(program.getProgram(), "baseColor");
+		modelToCameraMatrixUniform = program.getUniformLocation("modelToCameraMatrix");
+		cameraToClipMatrixUniform = program.getUniformLocation("cameraToClipMatrix");
+		baseColorUniform = program.getUniformLocation("baseColor");
 		
 		try {
 			ship = new Mesh(getClass().getResource("example8.3.Ship.xml"));

src/com/ra4king/opengl/arcsynthesis/gl33/chapter8/example4/Example8_4.java

 		
 		program = new ShaderProgram(readFromFile("example8.4.vert"), readFromFile("example8.4.frag"));
 		
-		modelToCameraMatrixUniform = glGetUniformLocation(program.getProgram(), "modelToCameraMatrix");
-		cameraToClipMatrixUniform = glGetUniformLocation(program.getProgram(), "cameraToClipMatrix");
-		baseColorUniform = glGetUniformLocation(program.getProgram(), "baseColor");
+		modelToCameraMatrixUniform = program.getUniformLocation("modelToCameraMatrix");
+		cameraToClipMatrixUniform = program.getUniformLocation("cameraToClipMatrix");
+		baseColorUniform = program.getUniformLocation("baseColor");
 		
 		try {
 			ship = new Mesh(getClass().getResource("example8.4.Ship.xml"));

src/com/ra4king/opengl/arcsynthesis/gl33/chapter9/example1/Example9_1.java

 	
 	private ProgramData loadShader(String vertFile, String fragFile) {
 		ProgramData data = new ProgramData(new ShaderProgram(readFromFile(vertFile), readFromFile(fragFile)));
-		data.modelToCameraMatrixUniform = glGetUniformLocation(data.program.getProgram(), "modelToCameraMatrix");
-		data.normalModelToCameraMatrixUniform = glGetUniformLocation(data.program.getProgram(), "normalModelToCameraMatrix");
-		data.dirTolightUniform = glGetUniformLocation(data.program.getProgram(), "dirToLight");
-		data.lightIntensityUniform = glGetUniformLocation(data.program.getProgram(), "lightIntensity");
+		data.modelToCameraMatrixUniform = data.program.getUniformLocation("modelToCameraMatrix");
+		data.normalModelToCameraMatrixUniform = data.program.getUniformLocation("normalModelToCameraMatrix");
+		data.dirTolightUniform = data.program.getUniformLocation("dirToLight");
+		data.lightIntensityUniform = data.program.getUniformLocation("lightIntensity");
 		
-		int projectionBlock = glGetUniformBlockIndex(data.program.getProgram(), "Projection");
+		int projectionBlock = data.program.getUniformBlockIndex("Projection");
 		glUniformBlockBinding(data.program.getProgram(), projectionBlock, projectionBlockIndex);
 		
 		return data;

src/com/ra4king/opengl/arcsynthesis/gl33/chapter9/example2/Example9_2.java

 	
 	private ProgramData loadShader(String vertFile, String fragFile) {
 		ProgramData data = new ProgramData(new ShaderProgram(readFromFile(vertFile), readFromFile(fragFile)));
-		data.modelToCameraMatrixUniform = glGetUniformLocation(data.program.getProgram(), "modelToCameraMatrix");
-		data.normalModelToCameraMatrixUniform = glGetUniformLocation(data.program.getProgram(), "normalModelToCameraMatrix");
-		data.dirTolightUniform = glGetUniformLocation(data.program.getProgram(), "dirToLight");
-		data.lightIntensityUniform = glGetUniformLocation(data.program.getProgram(), "lightIntensity");
+		data.modelToCameraMatrixUniform = data.program.getUniformLocation("modelToCameraMatrix");
+		data.normalModelToCameraMatrixUniform = data.program.getUniformLocation("normalModelToCameraMatrix");
+		data.dirTolightUniform = data.program.getUniformLocation("dirToLight");
+		data.lightIntensityUniform = data.program.getUniformLocation("lightIntensity");
 		
-		int projectionBlock = glGetUniformBlockIndex(data.program.getProgram(), "Projection");
+		int projectionBlock = data.program.getUniformBlockIndex("Projection");
 		glUniformBlockBinding(data.program.getProgram(), projectionBlock, projectionBlockIndex);
 		
 		return data;

src/com/ra4king/opengl/arcsynthesis/gl33/chapter9/example3/Example9_3.java

 	
 	private ProgramData loadShader(String vertFile, String fragFile) {
 		ProgramData data = new ProgramData(new ShaderProgram(readFromFile(vertFile), readFromFile(fragFile)));
-		data.modelToCameraMatrixUniform = glGetUniformLocation(data.program.getProgram(), "modelToCameraMatrix");
-		data.normalModelToCameraMatrixUniform = glGetUniformLocation(data.program.getProgram(), "normalModelToCameraMatrix");
-		data.dirTolightUniform = glGetUniformLocation(data.program.getProgram(), "dirToLight");
-		data.lightIntensityUniform = glGetUniformLocation(data.program.getProgram(), "lightIntensity");
-		data.ambientIntensityUniform = glGetUniformLocation(data.program.getProgram(), "ambientIntensity");
+		data.modelToCameraMatrixUniform = data.program.getUniformLocation("modelToCameraMatrix");
+		data.normalModelToCameraMatrixUniform = data.program.getUniformLocation("normalModelToCameraMatrix");
+		data.dirTolightUniform = data.program.getUniformLocation("dirToLight");
+		data.lightIntensityUniform = data.program.getUniformLocation("lightIntensity");
+		data.ambientIntensityUniform = data.program.getUniformLocation("ambientIntensity");
 		
-		int projectionBlock = glGetUniformBlockIndex(data.program.getProgram(), "Projection");
+		int projectionBlock = data.program.getUniformBlockIndex("Projection");
 		glUniformBlockBinding(data.program.getProgram(), projectionBlock, projectionBlockIndex);
 		
 		return data;

src/com/ra4king/opengl/superbible/osb5/chapter2/example3/Example2_3.java

 		glClear(GL_COLOR_BUFFER_BIT);
 		glEnableClientState(GL_VERTEX_ARRAY);
 		program.begin();
-		glUniform4f(glGetUniformLocation(program.getProgram(), "color"), 1, 0, 0, 1); // red
+		glUniform4f(program.getUniformLocation("color"), 1, 0, 0, 1); // red
 		glBindBuffer(GL_ARRAY_BUFFER, vbo);
 		glEnableVertexAttribArray(0);
 		glVertexAttribPointer(0, 4, GL_FLOAT, false, 0, 0);

src/com/ra4king/opengl/test/Test.java

 		
 		program = new ShaderProgram(readFromFile("test.vert"), readFromFile("test.frag"));
 		
-		perspectiveMatrixUniform = glGetUniformLocation(program.getProgram(), "perspectiveMatrix");
-		modelViewMatrixUniform = glGetUniformLocation(program.getProgram(), "modelViewMatrix");
+		perspectiveMatrixUniform = program.getUniformLocation("perspectiveMatrix");
+		modelViewMatrixUniform = program.getUniformLocation("modelViewMatrix");
 		
 		perspectiveMatrix = new Matrix4();
 		modelViewMatrix = new Matrix4();

src/com/ra4king/opengl/util/ShaderProgram.java

 
 import static org.lwjgl.opengl.GL11.*;
 import static org.lwjgl.opengl.GL20.*;
+import static org.lwjgl.opengl.GL31.*;
 import static org.lwjgl.opengl.GL32.*;
 
 import java.util.Map;
 		return program;
 	}
 	
+	public int getUniformLocation(String name) {
+		return glGetUniformLocation(program, name);
+	}
+	
+	public int getUniformBlockIndex(String name) {
+		return glGetUniformBlockIndex(program, name);
+	}
+	
 	public void begin() {
 		glUseProgram(program);
 	}

src/com/ra4king/opengl/util/Utils.java

 package com.ra4king.opengl.util;
 
+import static org.lwjgl.opengl.GL11.*;
+import static org.lwjgl.util.glu.GLU.*;
+
 import java.io.BufferedReader;
 import java.io.InputStream;
 import java.io.InputStreamReader;
 import com.ra4king.opengl.util.math.Vector4;
 
 public class Utils {
+	public static void checkGLError(String event) {
+		int error;
+		if((error = glGetError()) != GL_NO_ERROR)
+			throw new RuntimeException("OpenGL Error during " + event + ": " + gluErrorString(error));
+	}
+	
 	public static Quaternion angleAxisDeg(float angle, Vector3 vec) {
 		return new Quaternion((float)Math.toRadians(angle), vec);
 	}
 	}
 	
 	public static void updateMousePoles(ViewPole viewPole, ObjectPole objectPole) {
-		updateMousePoles(new ViewPole[] { viewPole }, new ObjectPole[] { objectPole });
+		updateMousePoles(viewPole == null ? null : new ViewPole[] { viewPole }, objectPole == null ? null : new ObjectPole[] { objectPole });
 	}
 	
 	public static void updateMousePoles(ViewPole[] viewPoles, ObjectPole[] objectPoles) {

src/com/ra4king/opengl/util/scene/Scene.java

 					throw new IllegalArgumentException("Invalid shaders for program " + id, exc);
 				}
 				
-				int matrixLocation = glGetUniformLocation(program.getProgram(), modelMatrix);
+				int matrixLocation = program.getUniformLocation(modelMatrix);
 				if(matrixLocation == -1)
 					throw new IllegalArgumentException("Program shader '" + id + "' does not have a matrix uniform.");
 				
 				int normalMatrixLocation = -1;
 				if(normalModelMatrix != null) {
-					normalMatrixLocation = glGetUniformLocation(program.getProgram(), normalModelMatrix);
+					normalMatrixLocation = program.getUniformLocation(normalModelMatrix);
 					if(normalMatrixLocation == -1)
 						throw new IllegalArgumentException("Program shader '" + id + "' does not have a normal matrix uniform.");
 				}
 				
 				int invNormalMatrixLocation = -1;
 				if(invNormalModelMatrix != null) {
-					invNormalMatrixLocation = glGetUniformLocation(program.getProgram(), invNormalModelMatrix);
+					invNormalMatrixLocation = program.getUniformLocation(invNormalModelMatrix);
 					if(normalMatrixLocation == -1)
 						throw new IllegalArgumentException("Program shader '" + id + "' does not have a inverse normal matrix uniform.");
 				}
 							
 							blocks.add(name);
 							
-							int blockIndex = glGetUniformBlockIndex(program.getProgram(), name);
+							int blockIndex = program.getUniformBlockIndex(name);
 							if(blockIndex == GL_INVALID_INDEX)
 								throw new IllegalArgumentException("Block '" + name + "' cannot be found in program '" + id + "'.");
 							
 							
 							samplers.add(name);
 							
-							int samplerLocation = glGetUniformLocation(program.getProgram(), name);
+							int samplerLocation = program.getUniformLocation(name);
 							if(samplerLocation == -1)
 								throw new IllegalArgumentException("Sampler '" + name + "' cannot be found in program '" + id + "'.");
 							
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.