Ignore:
Timestamp:
Aug 17, 2011, 5:20:09 PM (10 years ago)
Author:
sam
Message:

shader: factor the uniform handling logic into platform-independent methods
for both OpenGL and the PS3.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/debug/quad.cpp

    r830 r832  
    191191    }
    192192
     193    /* Our default quad color */
     194    vec4 orange(0.8f, 0.5f, 0.2f, 1.0f);
     195
    193196    /* Cheap iterators */
    194197#if !defined __CELLOS_LV2__ && !defined ANDROID_NDK
     
    208211     */
    209212#if defined HAVE_GLBEGIN || defined USE_GLEW
    210     glColor3f(0.8f, 0.5f, 0.2f);
     213    glColor3f(orange.x, orange.y, orange.z);
    211214    glBegin(GL_TRIANGLES);
    212215        glVertex3f(data->aa.x, data->bb.y, 0.0f);
     
    429432     */
    430433#if !defined ANDROID_NDK
    431     glColor4f(0.8f, 0.5f, 0.2f, 1.0f);
     434    glColor4f(orange.x, orange.y, orange.z, orange.w);
    432435    glEnableClientState(GL_VERTEX_ARRAY);
    433436
     
    575578    }
    576579    shader[0]->Bind();
     580    shader[0]->SetUniform(uni[0], orange);
    577581    shader++;
    578 #if !defined __CELLOS_LV2__
    579     glUniform4f(uni[0], 0.8f, 0.5f, 0.2f, 1.0f);
    580 #else
    581     cgGLSetParameter4f((CGparameter)(intptr_t)uni[0], 0.8f, 0.5f, 0.2f, 1.0f);
    582 #endif
    583582    uni++;
    584583
     
    692691    }
    693692    shader[0]->Bind();
     693    shader[0]->SetUniform(uni[0], t2);
    694694    shader++;
    695 #if !defined __CELLOS_LV2__
    696     glUniformMatrix4fv(uni[0], 1, GL_FALSE, &t2[0][0]);
    697 #else
    698     cgGLSetMatrixParameterfc((CGparameter)(intptr_t)uni[0], &t2[0][0]);
    699 #endif
    700695    uni++;
    701696
Note: See TracChangeset for help on using the changeset viewer.