Fixes testgles and testgl
authorGabriel Jacobo <gabomdq@gmail.com>
Wed, 09 Oct 2013 11:30:01 -0300
changeset 77947995e0920bf9
parent 7793 6463a850229d
child 7795 6acc7df4a175
Fixes testgles and testgl
test/Makefile.in
test/configure
test/configure.in
test/testgles.c
     1.1 --- a/test/Makefile.in	Wed Oct 09 10:29:01 2013 -0300
     1.2 +++ b/test/Makefile.in	Wed Oct 09 11:30:01 2013 -0300
     1.3 @@ -124,7 +124,7 @@
     1.4  	$(CC) -o $@ $^ $(CFLAGS) $(LIBS) @GLLIB@ @MATHLIB@
     1.5  
     1.6  testgles$(EXE): $(srcdir)/testgles.c
     1.7 -	$(CC) -o $@ $^ $(CFLAGS) $(LIBS) @GLLIB@ @MATHLIB@
     1.8 +	$(CC) -o $@ $^ $(CFLAGS) $(LIBS) @GLESLIB@ @MATHLIB@
     1.9  
    1.10  testhaptic$(EXE): $(srcdir)/testhaptic.c
    1.11  	$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
     2.1 --- a/test/configure	Wed Oct 09 10:29:01 2013 -0300
     2.2 +++ b/test/configure	Wed Oct 09 11:30:01 2013 -0300
     2.3 @@ -587,6 +587,7 @@
     2.4  SDL_TTF_LIB
     2.5  XLIB
     2.6  GLLIB
     2.7 +GLESLIB
     2.8  CPP
     2.9  XMKMF
    2.10  SDL_CONFIG
    2.11 @@ -3785,7 +3786,7 @@
    2.12  fi
    2.13  
    2.14  if test x$have_x = xyes; then
    2.15 -    if test x$ac_x_includes = xno || test "x$ac_x_includes" = xNone; then
    2.16 +    if test x$ac_x_includes = xno || test "x$ac_x_includes" = xNone || test "x$ac_x_includes" = x; then
    2.17          :
    2.18      else
    2.19          CFLAGS="$CFLAGS -I$ac_x_includes"
    2.20 @@ -3793,10 +3794,11 @@
    2.21      if test x$ac_x_libraries = xno || test "x$ac_x_libraries" = xNone; then
    2.22          :
    2.23      else
    2.24 -        XPATH="-L$ac_x_libraries"
    2.25          if test "x$ac_x_libraries" = x; then
    2.26 +            XPATH=""
    2.27              XLIB="-lX11"
    2.28          else
    2.29 +            XPATH="-L$ac_x_libraries"
    2.30              XLIB="-L$ac_x_libraries -lX11"
    2.31          fi
    2.32      fi
    2.33 @@ -3859,14 +3861,14 @@
    2.34  $as_echo "$have_opengles" >&6; }
    2.35  
    2.36  GLLIB=""
    2.37 +GLESLIB=""
    2.38  if test x$have_opengles = xyes; then
    2.39      CFLAGS="$CFLAGS -DHAVE_OPENGLES"
    2.40 -    GLLIB="$XPATH -lGLESv1_CM"
    2.41 -elif test x$have_opengl = xyes; then
    2.42 +    GLESLIB="$XPATH -lGLESv1_CM"
    2.43 +fi
    2.44 +if test x$have_opengl = xyes; then
    2.45      CFLAGS="$CFLAGS -DHAVE_OPENGL"
    2.46      GLLIB="$XPATH $SYS_GL_LIBS"
    2.47 -else
    2.48 -    GLLIB=""
    2.49  fi
    2.50  
    2.51  
     3.1 --- a/test/configure.in	Wed Oct 09 10:29:01 2013 -0300
     3.2 +++ b/test/configure.in	Wed Oct 09 11:30:01 2013 -0300
     3.3 @@ -91,7 +91,7 @@
     3.4  dnl Check for X11 path, needed for OpenGL on some systems
     3.5  AC_PATH_X
     3.6  if test x$have_x = xyes; then
     3.7 -    if test x$ac_x_includes = xno || test "x$ac_x_includes" = xNone; then
     3.8 +    if test x$ac_x_includes = xno || test "x$ac_x_includes" = xNone || test "x$ac_x_includes" = x; then
     3.9          :
    3.10      else
    3.11          CFLAGS="$CFLAGS -I$ac_x_includes"
    3.12 @@ -99,10 +99,11 @@
    3.13      if test x$ac_x_libraries = xno || test "x$ac_x_libraries" = xNone; then
    3.14          :
    3.15      else
    3.16 -        XPATH="-L$ac_x_libraries"
    3.17          if test "x$ac_x_libraries" = x; then
    3.18 +            XPATH=""
    3.19              XLIB="-lX11"
    3.20          else
    3.21 +            XPATH="-L$ac_x_libraries"
    3.22              XLIB="-L$ac_x_libraries -lX11"
    3.23          fi
    3.24      fi
    3.25 @@ -135,17 +136,18 @@
    3.26  AC_MSG_RESULT($have_opengles)
    3.27  
    3.28  GLLIB=""
    3.29 +GLESLIB=""
    3.30  if test x$have_opengles = xyes; then
    3.31      CFLAGS="$CFLAGS -DHAVE_OPENGLES"
    3.32 -    GLLIB="$XPATH -lGLESv1_CM"
    3.33 -elif test x$have_opengl = xyes; then
    3.34 +    GLESLIB="$XPATH -lGLESv1_CM"
    3.35 +fi
    3.36 +if test x$have_opengl = xyes; then
    3.37      CFLAGS="$CFLAGS -DHAVE_OPENGL"
    3.38      GLLIB="$XPATH $SYS_GL_LIBS"
    3.39 -else
    3.40 -    GLLIB=""
    3.41  fi
    3.42  
    3.43  AC_SUBST(GLLIB)
    3.44 +AC_SUBST(GLESLIB)
    3.45  AC_SUBST(XLIB)
    3.46  
    3.47  dnl Check for SDL_ttf
     4.1 --- a/test/testgles.c	Wed Oct 09 10:29:01 2013 -0300
     4.2 +++ b/test/testgles.c	Wed Oct 09 11:30:01 2013 -0300
     4.3 @@ -159,6 +159,8 @@
     4.4      state->gl_green_size = 5;
     4.5      state->gl_blue_size = 5;
     4.6      state->gl_depth_size = depth;
     4.7 +    state->gl_major_version = 1;
     4.8 +    state->gl_minor_version = 1;
     4.9      if (fsaa) {
    4.10          state->gl_multisamplebuffers=1;
    4.11          state->gl_multisamplesamples=fsaa;
    4.12 @@ -177,6 +179,8 @@
    4.13      }
    4.14  
    4.15      /* Create OpenGL ES contexts */
    4.16 +    SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES);
    4.17 +
    4.18      for (i = 0; i < state->num_windows; i++) {
    4.19          context[i] = SDL_GL_CreateContext(state->windows[i]);
    4.20          if (!context[i]) {