Skip to content

Commit

Permalink
Fixes testgles and testgl
Browse files Browse the repository at this point in the history
  • Loading branch information
gabomdq committed Oct 9, 2013
1 parent 24f2377 commit eaa4300
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 13 deletions.
2 changes: 1 addition & 1 deletion test/Makefile.in
Expand Up @@ -124,7 +124,7 @@ testgl2$(EXE): $(srcdir)/testgl2.c
$(CC) -o $@ $^ $(CFLAGS) $(LIBS) @GLLIB@ @MATHLIB@

testgles$(EXE): $(srcdir)/testgles.c
$(CC) -o $@ $^ $(CFLAGS) $(LIBS) @GLLIB@ @MATHLIB@
$(CC) -o $@ $^ $(CFLAGS) $(LIBS) @GLESLIB@ @MATHLIB@

testhaptic$(EXE): $(srcdir)/testhaptic.c
$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
Expand Down
14 changes: 8 additions & 6 deletions test/configure
Expand Up @@ -587,6 +587,7 @@ LIBOBJS
SDL_TTF_LIB
XLIB
GLLIB
GLESLIB
CPP
XMKMF
SDL_CONFIG
Expand Down Expand Up @@ -3785,18 +3786,19 @@ $as_echo "libraries $x_libraries, headers $x_includes" >&6; }
fi

if test x$have_x = xyes; then
if test x$ac_x_includes = xno || test "x$ac_x_includes" = xNone; then
if test x$ac_x_includes = xno || test "x$ac_x_includes" = xNone || test "x$ac_x_includes" = x; then
:
else
CFLAGS="$CFLAGS -I$ac_x_includes"
fi
if test x$ac_x_libraries = xno || test "x$ac_x_libraries" = xNone; then
:
else
XPATH="-L$ac_x_libraries"
if test "x$ac_x_libraries" = x; then
XPATH=""
XLIB="-lX11"
else
XPATH="-L$ac_x_libraries"
XLIB="-L$ac_x_libraries -lX11"
fi
fi
Expand Down Expand Up @@ -3859,14 +3861,14 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
$as_echo "$have_opengles" >&6; }

GLLIB=""
GLESLIB=""
if test x$have_opengles = xyes; then
CFLAGS="$CFLAGS -DHAVE_OPENGLES"
GLLIB="$XPATH -lGLESv1_CM"
elif test x$have_opengl = xyes; then
GLESLIB="$XPATH -lGLESv1_CM"
fi
if test x$have_opengl = xyes; then
CFLAGS="$CFLAGS -DHAVE_OPENGL"
GLLIB="$XPATH $SYS_GL_LIBS"
else
GLLIB=""
fi


Expand Down
14 changes: 8 additions & 6 deletions test/configure.in
Expand Up @@ -91,18 +91,19 @@ LIBS="$LIBS $SDL_LIBS -lSDL2_test"
dnl Check for X11 path, needed for OpenGL on some systems
AC_PATH_X
if test x$have_x = xyes; then
if test x$ac_x_includes = xno || test "x$ac_x_includes" = xNone; then
if test x$ac_x_includes = xno || test "x$ac_x_includes" = xNone || test "x$ac_x_includes" = x; then
:
else
CFLAGS="$CFLAGS -I$ac_x_includes"
fi
if test x$ac_x_libraries = xno || test "x$ac_x_libraries" = xNone; then
:
else
XPATH="-L$ac_x_libraries"
if test "x$ac_x_libraries" = x; then
XPATH=""
XLIB="-lX11"
else
XPATH="-L$ac_x_libraries"
XLIB="-L$ac_x_libraries -lX11"
fi
fi
Expand Down Expand Up @@ -135,17 +136,18 @@ have_opengles=yes
AC_MSG_RESULT($have_opengles)

GLLIB=""
GLESLIB=""
if test x$have_opengles = xyes; then
CFLAGS="$CFLAGS -DHAVE_OPENGLES"
GLLIB="$XPATH -lGLESv1_CM"
elif test x$have_opengl = xyes; then
GLESLIB="$XPATH -lGLESv1_CM"
fi
if test x$have_opengl = xyes; then
CFLAGS="$CFLAGS -DHAVE_OPENGL"
GLLIB="$XPATH $SYS_GL_LIBS"
else
GLLIB=""
fi

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

dnl Check for SDL_ttf
Expand Down
4 changes: 4 additions & 0 deletions test/testgles.c
Expand Up @@ -159,6 +159,8 @@ main(int argc, char *argv[])
state->gl_green_size = 5;
state->gl_blue_size = 5;
state->gl_depth_size = depth;
state->gl_major_version = 1;
state->gl_minor_version = 1;
if (fsaa) {
state->gl_multisamplebuffers=1;
state->gl_multisamplesamples=fsaa;
Expand All @@ -177,6 +179,8 @@ main(int argc, char *argv[])
}

/* Create OpenGL ES contexts */
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES);

for (i = 0; i < state->num_windows; i++) {
context[i] = SDL_GL_CreateContext(state->windows[i]);
if (!context[i]) {
Expand Down

0 comments on commit eaa4300

Please sign in to comment.