11 GraphicsApi get_backend_api()
13 #ifdef GL_ES_VERSION_2_0
20 inline Version get_gl_version()
22 const char *gl_ver_ptr = reinterpret_cast<const char *>(glGetString(GL_VERSION));
24 throw runtime_error("OpenGL version not available");
26 string gl_ver = gl_ver_ptr;
27 if(!gl_ver.compare(0, 10, "OpenGL ES "))
30 Version ver(gl_ver.substr(0, gl_ver.find(' ')));
32 if(const char *force_ver_ptr = getenv("MSPGL_FORCE_VERSION"))
34 Version force_ver(force_ver_ptr);
42 const Version &get_backend_version()
44 static Version version = get_gl_version();