Fixes compilation on Mingw.
authorGabriel Jacobo <gabomdq@gmail.com>
Fri, 22 Nov 2013 14:19:52 -0300
changeset 80227396e3cc5337
parent 8021 f96e12e0ade9
child 8023 7e9b97eb8aa3
Fixes compilation on Mingw.
configure
configure.in
src/video/windows/SDL_windowsopengl.c
     1.1 --- a/configure	Fri Nov 22 13:24:53 2013 -0300
     1.2 +++ b/configure	Fri Nov 22 14:19:52 2013 -0300
     1.3 @@ -20703,6 +20703,84 @@
     1.4      fi
     1.5  }
     1.6  
     1.7 +CheckWINDOWSGLES()
     1.8 +{
     1.9 +    if test x$enable_video = xyes -a x$enable_video_opengles = xyes; then
    1.10 +
    1.11 +        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EGL support" >&5
    1.12 +$as_echo_n "checking for EGL support... " >&6; }
    1.13 +        video_opengl_egl=no
    1.14 +        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    1.15 +/* end confdefs.h.  */
    1.16 +
    1.17 +         #include <EGL/egl.h>
    1.18 +
    1.19 +int
    1.20 +main ()
    1.21 +{
    1.22 +
    1.23 +
    1.24 +  ;
    1.25 +  return 0;
    1.26 +}
    1.27 +_ACEOF
    1.28 +if ac_fn_c_try_compile "$LINENO"; then :
    1.29 +
    1.30 +        video_opengl_egl=yes
    1.31 +
    1.32 +fi
    1.33 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
    1.34 +        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $video_opengl_egl" >&5
    1.35 +$as_echo "$video_opengl_egl" >&6; }
    1.36 +        if test x$video_opengl_egl = xyes; then
    1.37 +
    1.38 +$as_echo "#define SDL_VIDEO_OPENGL 1" >>confdefs.h
    1.39 +
    1.40 +
    1.41 +$as_echo "#define SDL_VIDEO_OPENGL_EGL 1" >>confdefs.h
    1.42 +
    1.43 +        fi
    1.44 +
    1.45 +        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenGL ES v2 headers" >&5
    1.46 +$as_echo_n "checking for OpenGL ES v2 headers... " >&6; }
    1.47 +        video_opengles_v2=no
    1.48 +        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    1.49 +/* end confdefs.h.  */
    1.50 +
    1.51 +         #include <GLES2/gl2.h>
    1.52 +         #include <GLES2/gl2ext.h>
    1.53 +
    1.54 +int
    1.55 +main ()
    1.56 +{
    1.57 +
    1.58 +
    1.59 +  ;
    1.60 +  return 0;
    1.61 +}
    1.62 +_ACEOF
    1.63 +if ac_fn_c_try_compile "$LINENO"; then :
    1.64 +
    1.65 +        video_opengles_v2=yes
    1.66 +
    1.67 +fi
    1.68 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
    1.69 +        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $video_opengles_v2" >&5
    1.70 +$as_echo "$video_opengles_v2" >&6; }
    1.71 +        if test x$video_opengles_v2 = xyes; then
    1.72 +
    1.73 +$as_echo "#define SDL_VIDEO_OPENGL 1" >>confdefs.h
    1.74 +
    1.75 +
    1.76 +$as_echo "#define SDL_VIDEO_OPENGL_ES2 1" >>confdefs.h
    1.77 +
    1.78 +
    1.79 +$as_echo "#define SDL_VIDEO_RENDER_OGL_ES2 1" >>confdefs.h
    1.80 +
    1.81 +        fi
    1.82 +    fi
    1.83 +}
    1.84 +
    1.85  CheckHaikuGL()
    1.86  {
    1.87      if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
    1.88 @@ -22261,6 +22339,7 @@
    1.89          CheckDummyAudio
    1.90          CheckWINDOWS
    1.91          CheckWINDOWSGL
    1.92 +        CheckWINDOWSGLES
    1.93          CheckDIRECTX
    1.94  
    1.95          # Set up the core platform files
     2.1 --- a/configure.in	Fri Nov 22 13:24:53 2013 -0300
     2.2 +++ b/configure.in	Fri Nov 22 14:19:52 2013 -0300
     2.3 @@ -1738,6 +1738,43 @@
     2.4      fi
     2.5  }
     2.6  
     2.7 +dnl Check for Windows OpenGL
     2.8 +CheckWINDOWSGLES()
     2.9 +{
    2.10 +    if test x$enable_video = xyes -a x$enable_video_opengles = xyes; then
    2.11 +
    2.12 +        AC_MSG_CHECKING(for EGL support)
    2.13 +        video_opengl_egl=no
    2.14 +        AC_TRY_COMPILE([
    2.15 +         #include <EGL/egl.h>
    2.16 +        ],[
    2.17 +        ],[
    2.18 +        video_opengl_egl=yes
    2.19 +        ])
    2.20 +        AC_MSG_RESULT($video_opengl_egl)
    2.21 +        if test x$video_opengl_egl = xyes; then
    2.22 +            AC_DEFINE(SDL_VIDEO_OPENGL, 1, [ ])
    2.23 +            AC_DEFINE(SDL_VIDEO_OPENGL_EGL, 1, [ ])
    2.24 +        fi
    2.25 +       
    2.26 +        AC_MSG_CHECKING(for OpenGL ES v2 headers)
    2.27 +        video_opengles_v2=no
    2.28 +        AC_TRY_COMPILE([
    2.29 +         #include <GLES2/gl2.h>
    2.30 +         #include <GLES2/gl2ext.h>
    2.31 +        ],[
    2.32 +        ],[
    2.33 +        video_opengles_v2=yes
    2.34 +        ])
    2.35 +        AC_MSG_RESULT($video_opengles_v2)
    2.36 +        if test x$video_opengles_v2 = xyes; then
    2.37 +            AC_DEFINE(SDL_VIDEO_OPENGL, 1, [ ])
    2.38 +            AC_DEFINE(SDL_VIDEO_OPENGL_ES2, 1, [ ])
    2.39 +            AC_DEFINE(SDL_VIDEO_RENDER_OGL_ES2, 1, [ ])
    2.40 +        fi
    2.41 +    fi
    2.42 +}
    2.43 +
    2.44  dnl Check for Haiku OpenGL
    2.45  CheckHaikuGL()
    2.46  {
    2.47 @@ -2515,6 +2552,7 @@
    2.48          CheckDummyAudio
    2.49          CheckWINDOWS
    2.50          CheckWINDOWSGL
    2.51 +        CheckWINDOWSGLES
    2.52          CheckDIRECTX
    2.53  
    2.54          # Set up the core platform files
     3.1 --- a/src/video/windows/SDL_windowsopengl.c	Fri Nov 22 13:24:53 2013 -0300
     3.2 +++ b/src/video/windows/SDL_windowsopengl.c	Fri Nov 22 14:19:52 2013 -0300
     3.3 @@ -585,6 +585,7 @@
     3.4  
     3.5      if (_this->gl_config.profile_mask == SDL_GL_CONTEXT_PROFILE_ES &&
     3.6          !_this->gl_data->HAS_WGL_EXT_create_context_es2_profile) {
     3.7 +#if SDL_VIDEO_OPENGL_EGL        
     3.8          /* Switch to EGL based functions */
     3.9          WIN_GL_UnloadLibrary(_this);
    3.10          _this->GL_LoadLibrary = WIN_GLES_LoadLibrary;
    3.11 @@ -602,6 +603,9 @@
    3.12          }
    3.13          
    3.14          return WIN_GLES_CreateContext(_this, window);
    3.15 +#else
    3.16 +        return SDL_SetError("SDL not configured with EGL support");
    3.17 +#endif        
    3.18      }
    3.19  
    3.20      if (_this->gl_config.share_with_current_context) {