#include <GL/gl.h>
#include <stdlib.h>
#include <dlfcn.h>

typedef const GLubyte* (*realglGetString)(GLenum name);

const GLubyte* glGetString(GLenum name) {
    static void* handle = NULL;
    static realglGetString _real = NULL;
    
    switch (name) {
        case GL_VERSION:
            return (const GLubyte*)"4.1";
        case GL_SHADING_LANGUAGE_VERSION:
            return (const GLubyte*)"4.10";
        default:
            if (handle == NULL) {
                handle = dlopen("libGL.so.1", RTLD_LAZY);
                _real = dlsym(handle, "glGetString");
            }
            return _real(name);
    }
}
