buffer. */
extensions.erase("GL_NV_primitive_restart");
+ if(const char *disable_ptr = getenv("MSPGL_DISABLE_EXTENSIONS"))
+ {
+ vector<string> disable = split(disable_ptr);
+ for(vector<string>::const_iterator i=disable.begin(); i!=disable.end(); ++i)
+ extensions.erase(*i);
+ }
+
init_done = true;
}
inline Version _get_gl_version()
{
string gl_ver = reinterpret_cast<const char *>(glGetString(GL_VERSION));
- return Version(gl_ver.substr(0, gl_ver.find(' ')));
+ Version ver(gl_ver.substr(0, gl_ver.find(' ')));
+
+ if(const char *force_ver_ptr = getenv("MSPGL_FORCE_VERSION"))
+ {
+ Version force_ver(force_ver_ptr);
+ if(!(force_ver>=ver))
+ ver = force_ver;
+ }
+
+ return ver;
}
const Version &get_gl_version()
inline Version _get_glsl_version()
{
string glsl_ver = reinterpret_cast<const char *>(glGetString(GL_SHADING_LANGUAGE_VERSION));
- return Version(glsl_ver.substr(0, glsl_ver.find(' ')));
+ Version ver(glsl_ver.substr(0, glsl_ver.find(' ')));
+
+ if(const char *force_ver_ptr = getenv("MSPGL_FORCE_GLSL_VERSION"))
+ {
+ Version force_ver(force_ver_ptr);
+ if(!(force_ver>=ver))
+ ver = force_ver;
+ }
+
+ return ver;
}
const Version &get_glsl_version()