private void addProgram(String text, int type) {
        int shader = glCreateShader(type);

        if (shader == 0) {
            Util.err("Shader creation failed: Could not find valid memory location when adding shader");
            System.exit(1);
        }

        glShaderSource(shader, text);
        glCompileShader(shader);

        if (glGetShader(shader, GL_COMPILE_STATUS) == 0) {
            Util.err(fileName + ": " + glGetShaderInfoLog(shader, 1024));
            System.exit(1);
        }

        glAttachShader(resource.getProgram(), shader);
    }