hey folks im having a spot of bother im blitting a 2d image on my screen and that goes fine but when i try to mask the image as the backgrounds black using gls alpha funcs the image looks washed out heres what im trying
sub blit_image( texture as GLuint , byval x as double , byval y as double , byval gfx_width as integer , byval gfx_height as integer )
glenable GL_TEXTURE_2D
glBindTexture GL_TEXTURE_2D,texture
GLENABLE GL_BLEND
'GLENABLE GL_ALPHA_TEST
'GLALPHAFUNC GL_LESS, 1
glBlendFunc( GL_SRC_COLOR , GL_ONE_MINUS_SRC_ALPHA )
'glDisable GL_LIGHTING
glDisable GL_DEPTH_TEST
glMatrixMode GL_PROJECTION
glPushMatrix
glLoadIdentity
glOrtho 0, sWIDTH, 0, sHEIGHT,-1, 1
glMatrixMode GL_MODELVIEW
glPushMatrix
glLoadIdentity
glBegin GL_QUADS
glcolor4ub 255,255,255,10
glTexCoord2f 0.0 , 0.0 : glVertex2f x, y
'glcolor4ub 0,0,0,255
glTexCoord2f 1.0 , 0.0 : glVertex2f x+gfx_width, y
'glcolor4ub 0,0,0,255
glTexCoord2f 1.0 , 1.0 : glVertex2f x+gfx_width, y+gfx_height
'glcolor4ub 0,0,0,255
glTexCoord2f 0.0 , 1.0 : glvertex2f x, y+gfx_height
glEnd
glMatrixMode GL_PROJECTION
glPopMatrix
glMatrixMode GL_MODELVIEW
glPopMatrix
glEnable GL_DEPTH_TEST
gldisable GL_TEXTURE_2D
'GLDISABLE GL_ALPHA_TEST
'GLALPHAFUNC GL_GREATER, 0.1
GLDISABLE GL_BLEND
end sub