#endif
#include <msp/strings/format.h>
#include <msp/strings/utils.h>
+#include "device.h"
#include "error.h"
#include "extension.h"
#include "gl.h"
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"));
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);
/* 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");
}
}
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);