hello,
I am trying to create a simple sprite based game and am having a problem
my sprites are quads textured with the bitmap of the sprite.
I was able to make the black background around the sprite be
transparent by:
glEnable(GL_TEXTURE_2D);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA,GL_ONE);
glBindTexture(GL_TEXTURE_2D, texture[0]);
glBegin(GL_QUADS);
glTexCoord2f(0.0f, 0.0f); glVertex3f(-1.0f,-1.0f, 0.0f);
glTexCoord2f(1.0f, 0.0f); glVertex3f( 1.0f,-1.0f, 0.0f);
glTexCoord2f(1.0f, 1.0f); glVertex3f( 1.0f, 1.0f, 0.0f);
glTexCoord2f(0.0f, 1.0f); glVertex3f(-1.0f, 1.0f, 0.0f);
glEnd();
glDisable(GL_BLEND);
now when I compose my scene I want my sprites to be on the foreground and lets say a bunch of points or quads on the background,
I have enabled depth-testing, but my background objects are always overwriting my sprites, NO MATTER what their Z position is
whats going on?

If I know what you mean, I had this problem a while ago too. The best way of getting around it is to disable Depth Testing, and sort the objects yourself. If you think about it, that method is faster too. Instead of testing for each pixel, you test once per object.

I would personally use .tga files for sprites cuz of the alpha channel in them and use glAlphaFunc(GL_GREATER, 0.1f);glEnable(GL_ALPHA_TEST);That will make everything that is black (in the alpha channel in the tga file) not appear if ya need more help be glad to help ya.