From: abd Date: Mon, 14 Nov 2005 08:11:29 +0000 (+0000) Subject: no message X-Git-Tag: V3_1_0a3~19 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=388097c648c1f959805d194fe2e1c9d9d32ce932;p=modules%2Fgui.git no message --- diff --git a/src/GLViewer/GLViewer_Drawer.cxx b/src/GLViewer/GLViewer_Drawer.cxx index 05cec9698..7f0cc9ba2 100644 --- a/src/GLViewer/GLViewer_Drawer.cxx +++ b/src/GLViewer/GLViewer_Drawer.cxx @@ -566,33 +566,35 @@ GLuint GLViewer_Drawer::loadTexture( const QString& fileName ) //======================================================================= void GLViewer_Drawer::drawTexture( GLuint texture, GLint size, GLfloat x, GLfloat y ) { - if( !texture ) - return; + float xScale = myXScale; + float yScale = myYScale; + + glColor4f( 1.0, 1.0, 1.0, 1.0 ); glEnable( GL_TEXTURE_2D ); - glTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE ); - bool hasAlpha = glIsEnabled( GL_ALPHA_TEST ); - glDisable( GL_ALPHA_TEST ); + glTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE ); + glAlphaFunc( GL_GREATER, 0.95F ); + glEnable( GL_ALPHA_TEST ); glBindTexture( GL_TEXTURE_2D, texture ); glBegin( GL_QUADS ); - + glTexCoord2f( 0.0, 0.0 ); - glVertex3f( x-size/2., y-size/2., 0.0 ); + glVertex3f( x-size/2./xScale, y-size/2./yScale, 0.0 ); glTexCoord2f( 0.0, 1.0 ); - glVertex3f( x-size/2., y+size/2., 0.0 ); + glVertex3f( x-size/2./xScale, y+size/2./yScale, 0.0 ); glTexCoord2f( 1.0, 1.0 ); - glVertex3f( x+size/2., y+size/2., 0.0 ); + glVertex3f( x+size/2./xScale, y+size/2./yScale, 0.0 ); glTexCoord2f( 1.0, 0.0 ); - glVertex3f( x+size/2., y-size/2., 0.0 ); + glVertex3f( x+size/2./xScale, y-size/2./yScale, 0.0 ); glEnd(); + glFlush(); - if ( hasAlpha ) - glEnable( GL_ALPHA_TEST ); + glDisable( GL_ALPHA_TEST ); glDisable( GL_TEXTURE_2D ); }