]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/qgl.cpp
- Fixed "jumping" texcoords when switching to a shader with different size
[xonotic/netradiant.git] / radiant / qgl.cpp
index 5a6477d1d2b46a37b94a55b23e3ee30fae27fd19..18fe053260e8d9b25312ac4fdba7634b75d1ceca 100644 (file)
@@ -700,6 +700,13 @@ inline void extension_not_implemented(const char* extension)
   globalErrorStream() << "WARNING: OpenGL driver reports support for " << extension << " but does not implement it\n";
 }
 
+float g_maxTextureAnisotropy;
+
+float QGL_maxTextureAnisotropy()
+{
+  return g_maxTextureAnisotropy;
+}
+
 void QGL_sharedContextCreated(OpenGLBinding& table)
 {
   QGL_InitVersion();
@@ -1583,6 +1590,16 @@ void QGL_sharedContextCreated(OpenGLBinding& table)
 
   table.support_ARB_fragment_shader = QGL_ExtensionSupported("GL_ARB_fragment_shader");
   table.support_ARB_shading_language_100 = QGL_ExtensionSupported("GL_ARB_shading_language_100");
+
+  if(QGL_ExtensionSupported("GL_EXT_texture_filter_anisotropic"))
+  {
+    glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &g_maxTextureAnisotropy);
+    globalOutputStream() << "Anisotropic filtering possible (max " << g_maxTextureAnisotropy << "x)\n";
+  }
+  else
+  {
+    globalOutputStream() << "No Anisotropic filtering available\n";
+  }
 }
 
 void QGL_sharedContextDestroyed(OpenGLBinding& table)