esac
+AC_SEARCH_LIBS(glutGetModifiers, [ glut glut32 freeglut ], have_glut=yes, have_glut=no)
+AM_CONDITIONAL(HAVE_GLUT, test "x$have_glut" = "xyes")
+
opengl_LIBS="$LIBS"
LIBS="$base_LIBS"
shader.cpp \
win32-printer.h
-INCLUDES = -I$(top_srcdir) -DGLX_GLXEXT_PROTOTYPES
+if HAVE_GLUT
+noinst_PROGRAMS = TestRenderTexture
+
+TestRenderTexture_SOURCES = TestRenderTexture.cpp
+
+TestRenderTexture_LDADD = \
+ $(top_builddir)/simgear/screen/libsgscreen.a \
+ $(top_builddir)/simgear/debug/libsgdebug.a \
+ $(opengl_LIBS)
+endif
+
+INCLUDES = -I$(top_srcdir) -I$(top_builddir) -DGLX_GLXEXT_PROTOTYPES
PrintExtensionError("GL_NV_texture_rectangle");
return false;
}
- if (_bFloat && !(SGIsOpenGLExtensionSupported( "GL_NV_float_buffer" ) || SGSearchExtensionsString( wglExtensionsString.c_str(), "WGL_ATI_pixel_format_float" )))
+ if (_bFloat && !(SGIsOpenGLExtensionSupported( "GL_NV_float_buffer" ) ||
+ SGSearchExtensionsString( wglExtensionsString.c_str(), "WGL_ATI_pixel_format_float" )))
{
PrintExtensionError("GL_NV_float_buffer or GL_ATI_pixel_format_float");
return false;
}
#elif defined( __APPLE__ )
#else
+ Display* dpy = glXGetCurrentDisplay();
+ int minor = 0, major = 0;
+ if (!glXQueryVersion(dpy, &major, &minor))
+ return false;
+
+ int screen = DefaultScreen(dpy);
+ const char* extString = glXQueryExtensionsString(dpy, screen);
+ if (!SGSearchExtensionsString(extString, "GLX_SGIX_fbconfig") ||
+ !SGSearchExtensionsString(extString, "GLX_SGIX_pbuffer"))
+ return false;
// First try the glX version 1.3 functions.
glXChooseFBConfigPtr = (glXChooseFBConfigProc)SGLookupFunction("glXChooseFBConfig");
glXDestroyPbufferPtr = (glXDestroyPbufferProc)SGLookupFunction("glXDestroyPbuffer");
glXQueryDrawablePtr = (glXQueryDrawableProc)SGLookupFunction("glXQueryDrawable");
- if (glXChooseFBConfigPtr &&
+ if (((1 <= major && 3 <= minor) || 2 <= major) &&
+ glXChooseFBConfigPtr &&
glXCreatePbufferPtr &&
glXGetVisualFromFBConfigPtr &&
glXCreateContextPtr &&