tests/cuda2.2/tests/PostProcessGL/main.cpp
void displayImage()
{
    // render a screen sized quad
    glDisable(GL_DEPTH_TEST);
    glDisable(GL_LIGHTING);
    glEnable(GL_TEXTURE_2D);
    glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);

    glMatrixMode(GL_PROJECTION);
    glPushMatrix();
    glLoadIdentity();
    glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0);

    glMatrixMode( GL_MODELVIEW);
    glLoadIdentity();

    glViewport(0, 0, window_width, window_height);

#if USE_FLOAT_SHADER
    // fragment program is required to display floating point texture
    glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, shader);
    glEnable(GL_FRAGMENT_PROGRAM_ARB);
    glDisable(GL_DEPTH_TEST);
#endif

    glBegin(GL_QUADS);
    glTexCoord2f(0.0, 0.0); glVertex3f(-1.0, -1.0, 0.5);
    glTexCoord2f(1.0, 0.0); glVertex3f(1.0, -1.0, 0.5);
    glTexCoord2f(1.0, 1.0); glVertex3f(1.0, 1.0, 0.5);
    glTexCoord2f(0.0, 1.0); glVertex3f(-1.0, 1.0, 0.5);
    glEnd();

    glMatrixMode(GL_PROJECTION);
    glPopMatrix();

    glDisable(GL_TEXTURE_2D);

    CUT_CHECK_ERROR_GL();
}
// display image to the screen as textured quad
display image to the screen as textured quad
display image to the screen as textured quad
void displayImage()
{
    glDisable(GL_DEPTH_TEST);
    glDisable(GL_LIGHTING);
    glEnable(GL_TEXTURE_2D);
    glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
    glMatrixMode(GL_PROJECTION);
    glPushMatrix();
    glLoadIdentity();
    glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0);
    glMatrixMode( GL_MODELVIEW);
    glLoadIdentity();
    glViewport(0, 0, window_width, window_height);
#if USE_FLOAT_SHADER
    glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, shader);
    glEnable(GL_FRAGMENT_PROGRAM_ARB);
    glDisable(GL_DEPTH_TEST);
#endif
    glBegin(GL_QUADS);
    glTexCoord2f(0.0, 0.0); glVertex3f(-1.0, -1.0, 0.5);
    glTexCoord2f(1.0, 0.0); glVertex3f(1.0, -1.0, 0.5);
    glTexCoord2f(1.0, 1.0); glVertex3f(1.0, 1.0, 0.5);
    glTexCoord2f(0.0, 1.0); glVertex3f(-1.0, 1.0, 0.5);
    glEnd();
    glMatrixMode(GL_PROJECTION);
    glPopMatrix();
    glDisable(GL_TEXTURE_2D);
    CUT_CHECK_ERROR_GL();
}
void displayImage ( ) { glDisable ( GL_DEPTH_TEST ) ; glDisable ( GL_LIGHTING ) ; glEnable ( GL_TEXTURE_2D ) ; glTexEnvf ( GL_TEXTURE_ENV , GL_TEXTURE_ENV_MODE , GL_REPLACE ) ; glMatrixMode ( GL_PROJECTION ) ; glPushMatrix ( ) ; glLoadIdentity ( ) ; glOrtho ( -1.0 , 1.0 , -1.0 , 1.0 , -1.0 , 1.0 ) ; glMatrixMode ( GL_MODELVIEW ) ; glLoadIdentity ( ) ; glViewport ( 0 , 0 , window_width , window_height ) ; #if USE_FLOAT_SHADER glBindProgramARB ( GL_FRAGMENT_PROGRAM_ARB , shader ) ; glEnable ( GL_FRAGMENT_PROGRAM_ARB ) ; glDisable ( GL_DEPTH_TEST ) ; #endif glBegin ( GL_QUADS ) ; glTexCoord2f ( 0.0 , 0.0 ) ; glVertex3f ( -1.0 , -1.0 , 0.5 ) ; glTexCoord2f ( 1.0 , 0.0 ) ; glVertex3f ( 1.0 , -1.0 , 0.5 ) ; glTexCoord2f ( 1.0 , 1.0 ) ; glVertex3f ( 1.0 , 1.0 , 0.5 ) ; glTexCoord2f ( 0.0 , 1.0 ) ; glVertex3f ( -1.0 , 1.0 , 0.5 ) ; glEnd ( ) ; glMatrixMode ( GL_PROJECTION ) ; glPopMatrix ( ) ; glDisable ( GL_TEXTURE_2D ) ; CUT_CHECK_ERROR_GL ( ) ; }
display image to the screen as textured quad
display image to the screen as textured quad
// render a screen sized quad // fragment program is required to display floating point texture