Skip to main content
gamedev.net
🔒 Locked

need masking help

Started by WWakerFAN 2 replies 600+ views
Original Post
WWakerFAN
WWakerFAN
	
glBindTexture(GL_TEXTURE_2D,partTex);		
glEnable(GL_BLEND);
		glBlendFunc(GL_DST_COLOR,GL_ZERO);
		glColor3f(1.0f,1.0f,1.0f);
		glBegin(GL_TRIANGLE_STRIP);
			glTexCoord2d(1,1); glVertex3f(32.0f,32.0f,1.0f); // Top Right
			glTexCoord2d(0,1); glVertex3f(-32.0f,32.0f,1.0f); // Top Left
			glTexCoord2d(1,0); glVertex3f(32.0f,-32.0f,1.0f); // Bottom Right
			glTexCoord2d(0,0); glVertex3f(-32.0f,-32.0f,1.0f); // Bottom Left
		glEnd();
		glBlendFunc(GL_ONE,GL_ONE);
		glColor3f(1.0f,0.0f,1.0f);
		glBegin(GL_TRIANGLE_STRIP);
			glTexCoord2d(1,1); glVertex3f(32.0f,32.0f,1.0f); // Top Right
			glTexCoord2d(0,1); glVertex3f(-32.0f,32.0f,1.0f); // Top Left
			glTexCoord2d(1,0); glVertex3f(32.0f,-32.0f,1.0f); // Bottom Right
			glTexCoord2d(0,0); glVertex3f(-32.0f,-32.0f,1.0f); // Bottom Left
		glEnd();
		}
		glDisable(GL_BLEND);
could someone tell me why this code doesn't work? [Edited by - phantom on September 16, 2005 6:38:06 AM]
Enigma
Enigma
Probably because you have a pancake on your head. Seriously though, what do you expect the code to do, what does it actually do, what steps have you taken to test what might be going wrong and what were the results of those tests?

Enigma
WWakerFAN
WWakerFAN
i expect it to draw a colored shape that is created from a black & white image
but for some reason it also draws the black background in also

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.