private static int loadShader(String path, int type)
    {
        StringBuilder source = new StringBuilder();
        try
        {
            BufferedReader reader = new BufferedReader(new FileReader(path));
            String line;
            while ((line = reader.readLine()) != null)
            {
                source.append(line).append("\n");
            }
            reader.close();
            System.out.println(source);
        }
        catch (FileNotFoundException ex)
        {
            System.err.printf("Shader source not found: %s\n", path);
            System.exit(-1);
        }
        catch (IOException ex)
        {
            System.err.printf("Could not read shader source: %s\n", path);
            System.exit(-1);
        }
        
        int shaderID = glCreateShader(type);
        glShaderSource(shaderID, source);
        glCompileShader(shaderID);
        return shaderID;
    }