Changeset 675


Ignore:
Timestamp:
Feb 21, 2011, 12:01:21 PM (9 years ago)
Author:
sam
Message:

Fix the GLESv2 rendering.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/scene.cpp

    r674 r675  
    209209        }
    210210
    211 #if defined HAVE_GL_2X
     211#if defined HAVE_GL_2X || defined HAVE_GLES_2X
     212#   if !defined HAVE_GLES_2X
    212213        glBindVertexArray(data->vao);
     214#   endif
    213215        glEnableVertexAttribArray(attr_pos);
    214216        glEnableVertexAttribArray(attr_tex);
    215 #elif defined HAVE_GLES_2X
    216         glEnableVertexAttribArray(attr_pos);
    217         glEnableVertexAttribArray(attr_tex);
    218217#else
    219218        glEnableClientState(GL_VERTEX_ARRAY);
     
    221220#endif
    222221
    223 #if defined HAVE_GL_2X
     222#if defined HAVE_GL_2X || defined HAVE_GLES_2X
    224223        glBindBuffer(GL_ARRAY_BUFFER, data->bufs[buf]);
    225224        glBufferData(GL_ARRAY_BUFFER, 18 * (n - i) * sizeof(GLfloat),
    226225                     vertex, GL_STATIC_DRAW);
    227226        glVertexAttribPointer(attr_pos, 3, GL_FLOAT, GL_FALSE, 0, 0);
    228 #elif defined HAVE_GLES_2X
    229         glBindBuffer(GL_ARRAY_BUFFER, data->bufs[buf]);
    230         glVertexAttribPointer(attr_pos, 3, GL_FLOAT, GL_FALSE, 0, vertex);
    231227#elif defined HAVE_GL_1X
    232228        glBindBuffer(GL_ARRAY_BUFFER, data->bufs[buf]);
     
    238234#endif
    239235
    240 #if defined HAVE_GL_2X
     236#if defined HAVE_GL_2X || defined HAVE_GLES_2X
    241237        glBindBuffer(GL_ARRAY_BUFFER, data->bufs[buf + 1]);
    242238        glBufferData(GL_ARRAY_BUFFER, 12 * (n - i) * sizeof(GLfloat),
    243239                     texture, GL_STATIC_DRAW);
    244240        glVertexAttribPointer(attr_tex, 2, GL_FLOAT, GL_FALSE, 0, 0);
    245 #elif defined HAVE_GLES_2X
    246         glBindBuffer(GL_ARRAY_BUFFER, data->bufs[buf + 1]);
    247         glVertexAttribPointer(attr_tex, 2, GL_FLOAT, GL_FALSE, 0, texture);
    248241#elif defined HAVE_GL_1X
    249242        glBindBuffer(GL_ARRAY_BUFFER, data->bufs[buf + 1]);
     
    262255        glDrawArrays(GL_TRIANGLES, 0, (n - i) * 6);
    263256
    264 #if defined HAVE_GL_2X
     257#if defined HAVE_GL_2X || defined HAVE_GLES_2X
     258#   if !defined HAVE_GLES_2X
    265259        glBindVertexArray(0);
    266         glDisableVertexAttribArray(attr_pos);
    267         glDisableVertexAttribArray(attr_tex);
    268 #elif defined HAVE_GLES_2X
     260#   endif
    269261        glDisableVertexAttribArray(attr_pos);
    270262        glDisableVertexAttribArray(attr_tex);
  • trunk/src/video.cpp

    r674 r675  
    5454    "uniform sampler2D in_Texture;\n"
    5555    //"in vec3 pass_Color;\n"
    56     "out vec4 out_Color;\n"
     56    //"out vec4 out_Color;\n"
    5757    "\n"
    5858    "void main()\n"
Note: See TracChangeset for help on using the changeset viewer.