Advertisement

Textures = No More Colours?

Started by January 10, 2003 12:55 PM
2 comments, last by GroZZleR 22 years, 1 month ago
Hey all, I'm trying to write a font in the colour white, but when I draw it, it turns out this nearly black colour. I'm just wondering if maybe some texture stuff is interfering? Heres my drawing function:
    
int DrawGLScene(GLvoid)									// Here's Where We Do All The Drawing

{
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);	// Clear Screen And Depth Buffer


	for(int iRow = 0; iRow < 15; iRow++)
	{
		for(int iColumn = 0; iColumn < 15; iColumn++)
		{
			glLoadIdentity();
			glTranslatef((float)(iRow * 32 + 16), (float)(iColumn * 32 + 16), 0.0f);			// Move To The Right Of Our Title Text

			glBindTexture(GL_TEXTURE_2D, texture[iMap[iRow][iColumn]]);

			glBegin(GL_QUADS);
				glTexCoord2f(0.0f, 0.0f); glVertex2d(-16, 16);
				glTexCoord2f(1.0f, 0.0f); glVertex2d( 16, 16);
				glTexCoord2f(1.0f, 1.0f); glVertex2d( 16,-16);
				glTexCoord2f(0.0f, 1.0f); glVertex2d(-16,-16);
			glEnd();
		}

		// Draw The Player

		glLoadIdentity();
		glTranslatef((float)gPlayer.iFineX + 16, (float)gPlayer.iFineY + 16, 0.0f);
			glBegin(GL_QUADS);
				glVertex2d(-16, 16);
				glVertex2d( 16, 16);
				glVertex2d( 16,-16);
				glVertex2d(-16,-16);
			glEnd();
			glEnd();
	}

	glLoadIdentity();									// Reset The Current Modelview Matrix

	glTranslatef(0.0f, 0.0f,0.0f);						// Move One Unit Into The Screen

	// Pulsing Colors Based On Text Position

	glColor3f(255.0f, 255.0f, 255.0f);
	// Position The Text On The Screen

	glRasterPos2f(496.0f, 64.0f);
 	glPrint("Active OpenGL Text With NeHe");	// Print GL Text To The Screen


	return TRUE;										// Keep Going

}
    
Anyone see any problems in there, which would be screwing up the glColor3f for the text? The font and everything else works, its just not in the right colour. I'm also using an Ortho view. Thanks guys. [edited by - GroZZleR on January 10, 2003 1:57:03 PM]
You could easily test if textures are the problem by disabling them before the print, and enabling them after.
Advertisement
That must be my problem them, how do you disable them?

Like I''ve got that: glBindTexture(GL_TEXTURE_2D, texture[iMap[iRow][iColumn]]);

Do I need a glUnbind or something like that?
glDisable(GL_TEXTURE_2D);

This topic is closed to new replies.

Advertisement