// Path: src/main/java/craftedcart/smblevelworkshop/exception/GLSLCompileException.java
// public class GLSLCompileException extends Exception {
// 
//     public GLSLCompileException(String message) {
//         super("\n" + message);
//     }
// 
// }
// 
// Path: src/main/java/craftedcart/smblevelworkshop/util/LogHelper.java
// public class LogHelper {
// 
//     public static List<LogEntry> log = new ArrayList<>();
// 
//     private static void log(Class clazz, Level logLevel, Object object) {
//         LogManager.getLogger(clazz).log(logLevel, object);
//         log.add(new LogEntry(clazz, logLevel, object));
//         if (log.size() > 1024) {
//             log.remove(0);
//         }
//     }
// 
//     public static void all(Class clazz, Object object) {
//         log(clazz, Level.ALL, object);
//     }
// 
//     public static void fatal(Class clazz, Object object) {
//         log(clazz, Level.FATAL, object);
//     }
// 
//     public static void error(Class clazz, Object object) {
//         log(clazz, Level.ERROR, object);
//     }
// 
//     public static void warn(Class clazz, Object object) {
//         log(clazz, Level.WARN, object);
//     }
// 
//     public static void info(Class clazz, Object object) {
//         log(clazz, Level.INFO, object);
//     }
// 
//     public static void debug(Class clazz, Object object) {
//         log(clazz, Level.DEBUG, object);
//     }
// 
//     public static void trace(Class clazz, Object object) {
//         log(clazz, Level.TRACE, object);
//     }
// 
//     public static void off(Class clazz, Object object) {
//         log(clazz, Level.OFF, object);
//     }
// 
//     public static String stackTraceToString(Throwable e) {
//         StringBuilder sb = new StringBuilder();
//         for (StackTraceElement element : e.getStackTrace()) {
//             sb.append("    at ");
//             sb.append(element.toString());
//             sb.append("\n");
//         }
//         return sb.toString();
//     }
// 
//     public static class LogEntry {
// 
//         public Class clazz;
//         public Level logLevel;
//         public Object object;
// 
//         public LogEntry(Class clazz, Level logLevel, Object object) {
//             this.clazz = clazz;
//             this.logLevel = logLevel;
//             this.object = object;
//         }
// 
//     }
// 
// }
// 
// Path: src/main/java/craftedcart/smblevelworkshop/Window.java
// public static SharedDrawable drawable;


import craftedcart.smblevelworkshop.exception.GLSLCompileException;
import craftedcart.smblevelworkshop.util.LogHelper;
import org.lwjgl.LWJGLException;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL20;
import java.io.*;
import static craftedcart.smblevelworkshop.Window.drawable;
package craftedcart.smblevelworkshop.resource;




/**
 * @author CraftedCart
 * Created on 06/04/2016 (DD/MM/YYYY)
 */
public class ResourceShader implements IResource {

    private int shaderID;

    /**
     * @param shaderType The OpenGL id for the type of shader ({@link GL20#GL_VERTEX_SHADER} or {@link GL20#GL_FRAGMENT_SHADER})
     * @param file the file where the shader is stored
     */
    public ResourceShader(int shaderType, File file) throws IOException, LWJGLException, GLSLCompileException {
// Path: src/main/java/craftedcart/smblevelworkshop/exception/GLSLCompileException.java
// public class GLSLCompileException extends Exception {
// 
//     public GLSLCompileException(String message) {
//         super("\n" + message);
//     }
// 
// }
// 
// Path: src/main/java/craftedcart/smblevelworkshop/util/LogHelper.java
// public class LogHelper {
// 
//     public static List<LogEntry> log = new ArrayList<>();
// 
//     private static void log(Class clazz, Level logLevel, Object object) {
//         LogManager.getLogger(clazz).log(logLevel, object);
//         log.add(new LogEntry(clazz, logLevel, object));
//         if (log.size() > 1024) {
//             log.remove(0);
//         }
//     }
// 
//     public static void all(Class clazz, Object object) {
//         log(clazz, Level.ALL, object);
//     }
// 
//     public static void fatal(Class clazz, Object object) {
//         log(clazz, Level.FATAL, object);
//     }
// 
//     public static void error(Class clazz, Object object) {
//         log(clazz, Level.ERROR, object);
//     }
// 
//     public static void warn(Class clazz, Object object) {
//         log(clazz, Level.WARN, object);
//     }
// 
//     public static void info(Class clazz, Object object) {
//         log(clazz, Level.INFO, object);
//     }
// 
//     public static void debug(Class clazz, Object object) {
//         log(clazz, Level.DEBUG, object);
//     }
// 
//     public static void trace(Class clazz, Object object) {
//         log(clazz, Level.TRACE, object);
//     }
// 
//     public static void off(Class clazz, Object object) {
//         log(clazz, Level.OFF, object);
//     }
// 
//     public static String stackTraceToString(Throwable e) {
//         StringBuilder sb = new StringBuilder();
//         for (StackTraceElement element : e.getStackTrace()) {
//             sb.append("    at ");
//             sb.append(element.toString());
//             sb.append("\n");
//         }
//         return sb.toString();
//     }
// 
//     public static class LogEntry {
// 
//         public Class clazz;
//         public Level logLevel;
//         public Object object;
// 
//         public LogEntry(Class clazz, Level logLevel, Object object) {
//             this.clazz = clazz;
//             this.logLevel = logLevel;
//             this.object = object;
//         }
// 
//     }
// 
// }
// 
// Path: src/main/java/craftedcart/smblevelworkshop/Window.java
// public static SharedDrawable drawable;


// Path: src/main/java/craftedcart/smblevelworkshop/resource/ResourceShader.java
import craftedcart.smblevelworkshop.exception.GLSLCompileException;
import craftedcart.smblevelworkshop.util.LogHelper;
import org.lwjgl.LWJGLException;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL20;
import java.io.*;
import static craftedcart.smblevelworkshop.Window.drawable;

package craftedcart.smblevelworkshop.resource;




/**
 * @author CraftedCart
 * Created on 06/04/2016 (DD/MM/YYYY)
 */
public class ResourceShader implements IResource {

    private int shaderID;

    /**
     * @param shaderType The OpenGL id for the type of shader ({@link GL20#GL_VERTEX_SHADER} or {@link GL20#GL_FRAGMENT_SHADER})
     * @param file the file where the shader is stored
     */
    public ResourceShader(int shaderType, File file) throws IOException, LWJGLException, GLSLCompileException {
        drawable.makeCurrent();