Actually it more a general ogl question.
What I’m trying to do is draw a 2d textured quad to the screen. should be simple…
The problem I am having, which I’m sure is cos I’ve missed somthing obvious, is that when I draw on quad over the other one, I want to just see the shape of the picture and I don’t.
What i seem to be able to do is draw one image on top of the other but with the transparent bit darwing black, or loose the transparent bit (what I want to do) but it also blends the images together (which I don’t want to do). Does this make any sense? I’m just wanting to draw a sprite.
I’m using a png for my texture which I’m using DevIL to load (as per nehe lessono6 port) my test rendering code is:
glPushMatrix();
glEnable(GL_BLEND);
glDisable(GL_DEPTH_TEST);
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
texture.bind();
glBegin(GL_QUADS);
glVertex2f(50.0f, 50.0f);
glTexCoord2f(0.0f, 1.0f);
glVertex2f(100.0f, 50.0f);
glTexCoord2f(1.0f, 1.0f);
glVertex2f(100.0f, 100.0f);
glTexCoord2f(1.0f, 0.0f);
glVertex2f(50.0f, 100.0f);
glTexCoord2f(0.0f, 0.0f);
glEnd();
glTranslatef(10f, 10f, 0f);
glBegin(GL_QUADS);
glVertex2f(50.0f, 50.0f);
glTexCoord2f(0.0f, 1.0f);
glVertex2f(100.0f, 50.0f);
glTexCoord2f(1.0f, 1.0f);
glVertex2f(100.0f, 100.0f);
glTexCoord2f(1.0f, 0.0f);
glVertex2f(50.0f, 100.0f);
glTexCoord2f(0.0f, 0.0f);
glEnd();
glPopMatrix();
and just before this I’m clearing the colour and depth buffers. Any ideas?
Cheers,
Dan.
edit slight typo

