Changeset 682


Ignore:
Timestamp:
Feb 22, 2011, 2:17:45 AM (9 years ago)
Author:
sam
Message:

Add preliminary support for EGL applications.

Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/configure.ac

    r680 r682  
    131131
    132132
     133dnl Use EGL?
     134ac_cv_my_have_egl="no"
     135PKG_CHECK_MODULES(EGL, egl, [ac_cv_my_have_egl="yes"], [:])
     136if test "${ac_cv_my_have_egl}" != "no"; then
     137  AC_DEFINE(USE_EGL, 1, Define to 1 to use libegl)
     138  EGL_LIBS="${EGL_LIBS} -lX11"
     139fi
     140AM_CONDITIONAL(USE_EGL, test "${ac_cv_my_have_egl}" != "no")
     141
     142
    133143dnl Use libcaca? (required for font generation)
    134144ac_cv_my_have_caca="no"
     
    165175
    166176# How to use the Lol Engine inside this tree
    167 LOL_CFLAGS="$LOL_CFLAGS -I \$(top_srcdir)/src $SDL_CFLAGS"
    168 LOL_LIBS="$LOL_LIBS $SDL_LIBS"
     177LOL_CFLAGS="$LOL_CFLAGS -I \$(top_srcdir)/src $SDL_CFLAGS $EGL_CFLAGS"
     178LOL_LIBS="$LOL_LIBS $SDL_LIBS $EGL_LIBS"
    169179
    170180AC_SUBST(MATH_LIBS)
  • trunk/src/Makefile.am

    r680 r682  
    1414    sdlapp.cpp sdlapp.h sdlinput.cpp sdlinput.h \
    1515    \
     16    eglapp.cpp eglapp.h \
     17    \
    1618    debugfps.cpp debugfps.h debugsphere.cpp debugsphere.h \
    1719    debugrecord.cpp debugrecord.h debugstats.cpp debugstats.h
  • trunk/src/video.cpp

    r681 r682  
    3131#if defined HAVE_GL_2X || defined HAVE_GLES_2X
    3232static char const *vertexshader =
     33#if defined HAVE_GLES_2X
     34    "attribute vec3 in_Position;\n"
     35    "attribute vec2 in_TexCoord;\n"
     36    "varying vec2 pass_TexCoord;\n"
     37#else
    3338    "#version 130\n"
    3439    "\n"
    3540    "in vec3 in_Position;\n"
     41    "in vec2 in_TexCoord;\n"
     42#endif
    3643    //"in vec3 in_Color;\n"
    37     "in vec2 in_TexCoord;\n"
    3844    //"out vec3 pass_Color;\n"
    3945    "uniform mat4 proj_matrix;\n"
     
    4551    "    gl_Position = proj_matrix * view_matrix * model_matrix"
    4652    "                * vec4(in_Position, 1.0f);\n"
     53    //"    pass_Color = in_Color;\n"
     54#if defined HAVE_GLES_2X
     55    "    pass_TexCoord = in_TexCoord;\n"
     56#else
    4757    "    gl_TexCoord[0] = vec4(in_TexCoord, 0.0, 0.0);\n"
    48     //"    pass_Color = in_Color;\n"
     58#endif
    4959    "}\n";
    5060
     
    5565    //"in vec3 pass_Color;\n"
    5666    //"out vec4 out_Color;\n"
     67#if defined HAVE_GLES_2X
     68    "varying vec2 pass_TexCoord;\n"
     69#endif
    5770    "\n"
    5871    "void main()\n"
     
    6073    //"    gl_FragColor = 0.5 * (texture2D(in_Texture, vec2(gl_TexCoord[0]))\n"
    6174    //"                           + vec4(pass_Color, 1.0));\n"
     75#if defined HAVE_GLES_2X
     76    "    gl_FragColor = vec4(0.5, 1.0, 0.0, 0.5);\n"
     77#else
    6278    "    gl_FragColor = texture2D(in_Texture, vec2(gl_TexCoord[0]));\n"
    63     //"    gl_FragColor = vec4(0.5, 1.0, 0.0, 0.5);\n"
     79#endif
     80    //"    gl_FragColor = texture2D(in_Texture, pass_TexCoord);\n"
    6481    "}\n";
    6582#endif
Note: See TracChangeset for help on using the changeset viewer.