]> git.tdb.fi Git - libs/gl.git/blobdiff - source/backends/opengl/extension.cpp
Move backend information into Device
[libs/gl.git] / source / backends / opengl / extension.cpp
index a55da9bac1c7b30ab965b6ce70e20390eafda6d1..84f8bd0a32d0789eb7dd340411b4b92ec73e701a 100644 (file)
@@ -10,6 +10,7 @@
 #endif
 #include <msp/strings/format.h>
 #include <msp/strings/utils.h>
+#include "device.h"
 #include "error.h"
 #include "extension.h"
 #include "gl.h"
@@ -64,7 +65,8 @@ bool is_supported(const string &ext)
 
        if(!init_done)
        {
-               if(get_backend_api()==OPENGL && get_backend_version()>=Version(3, 0))
+               const DeviceInfo &dev_info = Device::get_current().get_info();
+               if(dev_info.api==OPENGL && dev_info.api_version>=Version(3, 0))
                {
                        typedef GLubyte *(APIENTRY *FPtr_glGetStringi)(GLenum, GLuint);
                        FPtr_glGetStringi glGetStringi = reinterpret_cast<FPtr_glGetStringi>(get_proc_address("glGetStringi"));
@@ -90,7 +92,7 @@ bool is_supported(const string &ext)
 
 bool is_supported(const Version &core_version, const Version &deprecated_version)
 {
-       const Version &version = get_backend_version();
+       const Version &version = Device::get_current().get_info().api_version;
        if(deprecated_version && version>=deprecated_version && get_gl_profile()==CORE_PROFILE)
                return false;
        return (version>=core_version);
@@ -119,7 +121,7 @@ bool is_disabled(const string &ext)
 
                                /* AMD's uniform buffer objects only work with the core version of
                                shaders. */
-                               if(get_backend_version()<Version(2, 0))
+                               if(Device::get_current().get_info().api_version<Version(2, 0))
                                        disabled_exts.insert("GL_ARB_uniform_buffer_object");
                        }
                }
@@ -132,7 +134,8 @@ bool is_disabled(const string &ext)
 
 inline GLProfile _get_gl_profile()
 {
-       if(get_backend_api()==OPENGL && get_backend_version()>=Version(3, 0))
+       const DeviceInfo &dev_info = Device::get_current().get_info();
+       if(dev_info.api==OPENGL && dev_info.api_version>=Version(3, 0))
        {
                int mask;
                glGetIntegerv(GL_CONTEXT_PROFILE_MASK, &mask);