if(!init_done)
{
- if(const char *gl_ext = reinterpret_cast<const char *>(glGetString(GL_EXTENSIONS)))
+ if(get_gl_api()==OPENGL && get_gl_version()>=Version(3, 0))
{
- vector<string> exts = split(gl_ext);
- extensions.insert(exts.begin(), exts.end());
+ typedef GLubyte *(APIENTRY *FPtr_glGetStringi)(GLenum, GLuint);
+ FPtr_glGetStringi glGetStringi = reinterpret_cast<FPtr_glGetStringi>(get_proc_address("glGetStringi"));
+ int n_extensions;
+ glGetIntegerv(GL_NUM_EXTENSIONS, &n_extensions);
+ for(int i=0; i<n_extensions; ++i)
+ extensions.insert(reinterpret_cast<const char *>(glGetStringi(GL_EXTENSIONS, i)));
+ }
+ else
+ {
+ if(const char *gl_ext = reinterpret_cast<const char *>(glGetString(GL_EXTENSIONS)))
+ {
+ vector<string> exts = split(gl_ext);
+ extensions.insert(exts.begin(), exts.end());
+ }
}
if(const char *renderer_ptr = reinterpret_cast<const char *>(glGetString(GL_RENDERER)))