Skip to content
Permalink
Browse files

Adds testgles2

Source code copied from: https://github.com/fantasydr/sdl-2.0-gles (thanks!)

Minor fixes, configure script changes done by me.
  • Loading branch information
gabomdq committed Nov 19, 2013
1 parent fdfea4a commit 47139fb3eb63e83cba30521ad14dbb27ebf557fb
Showing with 713 additions and 1 deletion.
  1. +1 −1 android-project/jni/src/Android.mk
  2. +4 −0 test/Makefile.in
  3. +38 −0 test/configure
  4. +23 −0 test/configure.in
  5. +647 −0 test/testgles2.c
@@ -14,6 +14,6 @@ LOCAL_SRC_FILES := $(SDL_PATH)/src/main/android/SDL_android_main.c \

LOCAL_SHARED_LIBRARIES := SDL2

LOCAL_LDLIBS := -lGLESv1_CM -llog
LOCAL_LDLIBS := -lGLESv1_CM -lGLESv2 -llog

include $(BUILD_SHARED_LIBRARY)
@@ -21,6 +21,7 @@ TARGETS = \
testgesture$(EXE) \
testgl2$(EXE) \
testgles$(EXE) \
testgles2$(EXE) \
testhaptic$(EXE) \
testrumble$(EXE) \
testthread$(EXE) \
@@ -131,6 +132,9 @@ testgl2$(EXE): $(srcdir)/testgl2.c
testgles$(EXE): $(srcdir)/testgles.c
$(CC) -o $@ $^ $(CFLAGS) $(LIBS) @GLESLIB@ @MATHLIB@

testgles2$(EXE): $(srcdir)/testgles2.c
$(CC) -o $@ $^ $(CFLAGS) $(LIBS) @GLES2LIB@ @MATHLIB@

testhaptic$(EXE): $(srcdir)/testhaptic.c
$(CC) -o $@ $^ $(CFLAGS) $(LIBS)

@@ -587,6 +587,7 @@ LIBOBJS
SDL_TTF_LIB
XLIB
GLESLIB
GLES2LIB
GLLIB
CPP
XMKMF
@@ -3860,12 +3861,49 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_opengles" >&5
$as_echo "$have_opengles" >&6; }

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenGL ES2 support" >&5
$as_echo_n "checking for OpenGL ES2 support... " >&6; }
have_opengles2=no
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#if defined (__IPHONEOS__)
#include <OpenGLES/ES2/gl.h>
#include <OpenGLES/ES2/glext.h>
#else
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
#endif
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :

have_opengles2=yes

fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_opengles2" >&5
$as_echo "$have_opengles2" >&6; }

GLLIB=""
GLESLIB=""
GLES2LIB=""
if test x$have_opengles = xyes; then
CFLAGS="$CFLAGS -DHAVE_OPENGLES"
GLESLIB="$XPATH -lGLESv1_CM"
fi
if test x$have_opengles2 = xyes; then
CFLAGS="$CFLAGS -DHAVE_OPENGLES2"
GLES2LIB="$XPATH -lGLESv2"
fi
if test x$have_opengl = xyes; then
CFLAGS="$CFLAGS -DHAVE_OPENGL"
GLLIB="$XPATH $SYS_GL_LIBS"
@@ -135,19 +135,42 @@ have_opengles=yes
])
AC_MSG_RESULT($have_opengles)

dnl Check for OpenGL ES2
AC_MSG_CHECKING(for OpenGL ES2 support)
have_opengles2=no
AC_TRY_COMPILE([
#if defined (__IPHONEOS__)
#include <OpenGLES/ES2/gl.h>
#include <OpenGLES/ES2/glext.h>
#else
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
#endif
],[
],[
have_opengles2=yes
])
AC_MSG_RESULT($have_opengles2)

GLLIB=""
GLESLIB=""
GLES2LIB=""
if test x$have_opengles = xyes; then
CFLAGS="$CFLAGS -DHAVE_OPENGLES"
GLESLIB="$XPATH -lGLESv1_CM"
fi
if test x$have_opengles2 = xyes; then
CFLAGS="$CFLAGS -DHAVE_OPENGLES2"
GLES2LIB="$XPATH -lGLESv2"
fi
if test x$have_opengl = xyes; then
CFLAGS="$CFLAGS -DHAVE_OPENGL"
GLLIB="$XPATH $SYS_GL_LIBS"
fi

AC_SUBST(GLLIB)
AC_SUBST(GLESLIB)
AC_SUBST(GLES2LIB)
AC_SUBST(XLIB)

dnl Check for SDL_ttf

0 comments on commit 47139fb

Please sign in to comment.