From e9ffbcc1b0aa771ca627a26acb6565b6b5e85555 Mon Sep 17 00:00:00 2001
From: "Alexander \"Ace\" Olofsson" <ace@haxalot.com>
Date: Thu, 30 Jul 2015 11:45:10 +0200
Subject: [PATCH] OSG 3.3.3 moves GL extensions out of osg::Texture

---
 components/resource/texturemanager.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/components/resource/texturemanager.cpp b/components/resource/texturemanager.cpp
index 4bd712ea5..252456fb1 100644
--- a/components/resource/texturemanager.cpp
+++ b/components/resource/texturemanager.cpp
@@ -118,10 +118,17 @@ namespace Resource
             case(GL_COMPRESSED_RGBA_S3TC_DXT3_EXT):
             case(GL_COMPRESSED_RGBA_S3TC_DXT5_EXT):
             {
+#if OSG_MIN_VERSION_REQUIRED(3, 3, 3)
+                osg::GLExtensions* exts = osg::GLExtensions::Get(0, false);
+                if (exts && !exts->isTextureCompressionS3TCSupported
+                        // This one works too. Should it be included in isTextureCompressionS3TCSupported()? Submitted as a patch to OSG.
+                        && !osg::isGLExtensionSupported(0, "GL_S3_s3tc"))
+#else
                 osg::Texture::Extensions* exts = osg::Texture::getExtensions(0, false);
                 if (exts && !exts->isTextureCompressionS3TCSupported()
                         // This one works too. Should it be included in isTextureCompressionS3TCSupported()? Submitted as a patch to OSG.
                         && !osg::isGLExtensionSupported(0, "GL_S3_s3tc"))
+#endif
                 {
                     std::cerr << "Error loading " << filename << ": no S3TC texture compression support installed" << std::endl;
                     return false;