public static int genShader(String code, boolean type){
        int vertShader = glCreateShader(type ? GL_VERTEX_SHADER : GL_FRAGMENT_SHADER);
        if(vertShader == 0){
            System.err.println("Shader creation failed.");
            return 0;
        }
        glShaderSource(vertShader, code);
        glCompileShader(vertShader);
        
        String log = glGetShaderInfoLog(vertShader, 2000);
        if (glGetShaderi(vertShader, GL_COMPILE_STATUS) == GL11.GL_FALSE) {
            System.err.println(log);
            vertShader = 0;
        }
        return vertShader;
    }