GLuint glTexture ;
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
glEnable( GL_TEXTURE_2D );
glEnable(GL_COLOR_MATERIAL);
glGenTextures( 1, &glTexture );
glBindTexture( GL_TEXTURE_2D, glTexture );
glColorMaterial( GL_FRONT, GL_AMBIENT_AND_DIFFUSE );
glTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT );
glColor4f( float( ( float )g_nRedSlider / 10 ), float( ( float )g_nGreenSlider/ 10 ), float( ( float )g_nBlueSlider / 10 ), float( ( float )g_nAlphaSlider / 10 ));
glTexImage2D( GL_TEXTURE_2D, 0, GL_INTENSITY, WIDTH, HEIGHT, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, m_pbyImageData );
glEnable( GL_TEXTURE_2D );
glBindTexture( GL_TEXTURE_2D, glTexture );
glBegin( GL_QUADS );
glTexCoord2d( 0.0,0.0 );
glVertex2f( -0.8f, -0.8f );
glTexCoord2d( 1.0,0.0 );
glVertex2f( 0.8f, -0.8f );
glTexCoord2d( 1.0,1.0 );
glVertex2f( 0.8f, 0.8f );
glTexCoord2d( 0.0,1.0 );
glVertex2f( -0.8f, 0.8f );
glEnd();
SwapBuffers( m_hDeviceContextDC );
glDisable( GL_TEXTURE_2D );
glDisable( GL_COLOR_MATERIAL );