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

Try to fix GLES 2 rendering. No luck so far.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/scene.cpp

    r675 r683  
    155155
    156156#if defined HAVE_GL_2X || defined HAVE_GLES_2X
    157     GLuint uni, attr_pos, attr_tex;
    158     uni = stdshader->GetUniformLocation("model_matrix");
     157    GLuint uni_mat, uni_tex, attr_pos, attr_tex;
    159158    attr_pos = stdshader->GetAttribLocation("in_Position");
    160159    attr_tex = stdshader->GetAttribLocation("in_TexCoord");
    161160
    162161    stdshader->Bind();
    163     glUniformMatrix4fv(uni, 1, GL_FALSE, &model_matrix[0][0]);
     162    uni_mat = stdshader->GetUniformLocation("model_matrix");
     163    glUniformMatrix4fv(uni_mat, 1, GL_FALSE, &model_matrix[0][0]);
     164    uni_tex = stdshader->GetUniformLocation("in_Texture");
     165    glUniform1i(uni_tex, 0);
    164166
    165167    glEnable(GL_DEPTH_TEST);
     
    210212
    211213#if defined HAVE_GL_2X || defined HAVE_GLES_2X
     214        stdshader->Bind();
     215#endif
     216        glActiveTexture(GL_TEXTURE0);
     217        Tiler::Bind(data->tiles[i].code);
     218
     219#if defined HAVE_GL_2X || defined HAVE_GLES_2X
    212220#   if !defined HAVE_GLES_2X
    213221        glBindVertexArray(data->vao);
     
    248256#endif
    249257
    250 #if defined HAVE_GL_2X || defined HAVE_GLES_2X
    251         stdshader->Bind();
    252 #endif
    253 
    254         Tiler::Bind(data->tiles[i].code);
    255258        glDrawArrays(GL_TRIANGLES, 0, (n - i) * 6);
    256259
Note: See TracChangeset for help on using the changeset viewer.