summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSam Lantinga <slouken@libsdl.org>2012-01-08 02:23:37 -0500
committerSam Lantinga <slouken@libsdl.org>2012-01-08 02:23:37 -0500
commit1a3aea918d55d61bf5a989f8e155a0de19c9bc62 (patch)
tree6dd60fb63f54b853ce67218450922bff77acea60 /test
parent5c11f42ec31d7f52e112829c20ee8fe308b493c0 (diff)
Fixed bug 1242 - PATCH: Improve support for OpenGL ES under X11
Scott Percival 2011-07-03 06:41:51 PDT This submission is aimed at making life easier for OpenGL ES capable devices running a X11 stack (e.g. Maemo, Meego, TrimSlice, other ARM SoC boards not running Android). SDL's Pandora support already has the neccesary GLES-to-X11 glue code, however it's all ghetto'd off in Makefile.pandora and not very flexible. The patch: - adds an awesome --enable-video-opengles option to configure - re-modifies the opengles and opengles2 SDL_renderers to use function pointers - no idea why this was removed? - for SDL_Renderers, links in libGLESv1_CM, libGLES_CM (for PowerVR fans) or libGLESv2 at runtime - links in libEGL.so at runtime - the old code made an assumption that eglFunctions could be pulled from the active GLES library, PowerVR for one doesn't let you do that with their libGLESv2 - allows you to pick which of GLES v1 or v2 to load via SDL_GL_CONTEXT_MAJOR_VERSION So far I've tested this on a Nokia N900 (OMAP 3430/SGX 530 running Maemo 5) and a Toshiba AC100 (Tegra 2 running Ubuntu 10.10). I haven't tested it on... well, everything that isn't those two, such as a Pandora, iOS or Android device. The Pandora specific code should be kept intact (fingers crossed), and nothing painfully drastic has been added to the SDL_renderers. The library loading sequence in SDL_x11opengles has been updated to accomodate both NVIDIA's propensity to let developers get away with murder and PowerVR's alternative of punishing every missed step. The test apps work okay with GLES or GLES2 as the renderer. For some reason alpha blending doesn't seem to work on the Tegra 2; last week NVIDIA pushed out a new set of X11 GLES drivers, so I'll try and investigate once I upgrade those. Also, this patch adds things to configure.in, include/SDL_config.h.in and test/configure.in. I didn't know what the policy was re. committing generated spaghetti from autotools, so ./autogen.sh has to be run again. Sorry. I think that's about everything, let me know if there's anything I've overlooked.
Diffstat (limited to 'test')
-rwxr-xr-xtest/configure15
-rw-r--r--test/configure.in15
2 files changed, 14 insertions, 16 deletions
diff --git a/test/configure b/test/configure
index 2c723905..ce85af5b 100755
--- a/test/configure
+++ b/test/configure
@@ -3764,12 +3764,10 @@ cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
- #if defined (__QNXNTO__)
- #include <GLES/gl.h>
- #elif defined (__IPHONEOS__)
+ #if defined (__IPHONEOS__)
#include <OpenGLES/ES1/gl.h>
#else
- #error "No OpenGL ES support"
+ #include <GLES/gl.h>
#endif /* __QNXNTO__ */
int
@@ -3812,11 +3810,12 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
{ echo "$as_me:$LINENO: result: $have_opengles" >&5
echo "${ECHO_T}$have_opengles" >&6; }
-if test x$have_opengl = xyes; then
- CFLAGS="$CFLAGS -DHAVE_OPENGL"
- GLLIB="$XPATH $SYS_GL_LIBS"
-elif test x$have_opengles = xyes; then
+GLLIB=""
+if test x$have_opengles = xyes; then
CFLAGS="$CFLAGS -DHAVE_OPENGLES"
+ GLLIB="$XPATH -lGLESv1_CM"
+elif test x$have_opengl = xyes; then
+ CFLAGS="$CFLAGS -DHAVE_OPENGL"
GLLIB="$XPATH $SYS_GL_LIBS"
else
GLLIB=""
diff --git a/test/configure.in b/test/configure.in
index b24b6a6f..a808d664 100644
--- a/test/configure.in
+++ b/test/configure.in
@@ -103,12 +103,10 @@ dnl Check for OpenGL ES
AC_MSG_CHECKING(for OpenGL ES support)
have_opengles=no
AC_TRY_COMPILE([
- #if defined (__QNXNTO__)
- #include <GLES/gl.h>
- #elif defined (__IPHONEOS__)
+ #if defined (__IPHONEOS__)
#include <OpenGLES/ES1/gl.h>
#else
- #error "No OpenGL ES support"
+ #include <GLES/gl.h>
#endif /* __QNXNTO__ */
],[
],[
@@ -116,11 +114,12 @@ have_opengles=yes
])
AC_MSG_RESULT($have_opengles)
-if test x$have_opengl = xyes; then
- CFLAGS="$CFLAGS -DHAVE_OPENGL"
- GLLIB="$XPATH $SYS_GL_LIBS"
-elif test x$have_opengles = xyes; then
+GLLIB=""
+if test x$have_opengles = xyes; then
CFLAGS="$CFLAGS -DHAVE_OPENGLES"
+ GLLIB="$XPATH -lGLESv1_CM"
+elif test x$have_opengl = xyes; then
+ CFLAGS="$CFLAGS -DHAVE_OPENGL"
GLLIB="$XPATH $SYS_GL_LIBS"
else
GLLIB=""