So, i have a question.
I want be able to draw an image with alpha on the screen.
I want the color fusion to be done with the current color on the buffer.
For this i fo it:
// enable SRC_OVER
glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA);
// bind a translucent color for our quad
glColor4f(0f,0f,0f,0f);
// draw our quad with the alpha image
glEnable(GL.GL_TEXTURE_2D );
glBindTexture(GL.GL_TEXTURE_2D, ctx.getTexture().getTextureId() );
glBegin(GL.GL_QUADS);
glTexCoord2f( textureBounds[0].getX() , textureBounds[0].getY() );
glVertex2f ( x , y );
glTexCoord2f( textureBounds[1].getX() , textureBounds[1].getY() );
glVertex2f( x + img.getWidth() , y );
glTexCoord2f( textureBounds[2].getX() , textureBounds[2].getY() );
glVertex2f( x + img.getWidth() , y + img.getHeight() );
glTexCoord2f( textureBounds[3].getX() , textureBounds[3].getY() );
glVertex2f(x, y + img.getHeight() );
glEnd();
glBindTexture( GL.GL_TEXTURE_2D , 0 );
// restore previous color
With this sequence, it draw nothing. It le me thinks that the translucent color disable the quad to be visible ?
PS: with an opaque image, it’s the same… i don’t undestand what it do…