Ignore:
Timestamp:
Jun 11, 2012, 11:21:36 PM (7 years ago)
Author:
sam
Message:

gpu: first shot at a Shader::SetTexture() function.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gpu/shader.cpp

    r1389 r1452  
    515515    if (uni.vert)
    516516        cgGLSetMatrixParameterfc((CGparameter)uni.vert, &m[0][0]);
     517#endif
     518}
     519
     520void Shader::SetTexture(ShaderUniform const &uni, int id, int index)
     521{
     522    if (id == -1)
     523        return;
     524#if defined USE_D3D9 || defined _XBOX
     525    /* FIXME: unimplemented */
     526#elif !defined __CELLOS_LV2__
     527    glActiveTexture(GL_TEXTURE0 + index);
     528    //glEnable(GL_TEXTURE_2D);
     529    glBindTexture(GL_TEXTURE_2D, id);
     530    SetUniform(uni, index);
     531#else
     532    /* FIXME: unimplemented */
    517533#endif
    518534}
Note: See TracChangeset for help on using the changeset viewer.