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

Add preliminary support for EGL applications.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.