Archived

This topic is now archived and is closed to further replies.

SCRUB

Display Lists and glColor problem

Recommended Posts

Im having a problem with display lists and glColor, for some reason when I Print using White it come out in my previous set color of red !!!!!! here is a cut down version of my code
  
////////////////////////////////////////////

void Display ()
{
	glClear (GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
	glLoadIdentity ();
	glColor3f (1.0f, 0.0f, 0.0f);	(==RED===)
	console.DrawConsole (CON_DROP);
}

/////////////////////////////////////////////

console::DrawConsole ()
{
	vec4_t color(0.8f, 0.8f, 0.8f,0.75f); (==WHITE==)

	glRasterPos2f (rasPosX, rasPosY);
	if (!text->Print2D (fontName, color, "] %s",inputtext))		(==pass the White==)
		error_t::File ("error.log", "error printing console input text");
}
//////////////////////////////////////////////

text::Print2d ()
{
#ifdef _DEBUG
	vec4_t colortest;
	glGetFloatv (GL_CURRENT_COLOR, colortest.v);
#endif
	glColor4f (color.v[0], color.v[1], color.v[2], color.v[3]);	
	glDisable (GL_TEXTURE_2D);							
	glListBase (base);								
	glCallLists (strlen (text), GL_UNSIGNED_BYTE, text);	
	glEnable (GL_TEXTURE_2D);							
#ifdef _DEBUG
	glGetFloatv (GL_CURRENT_COLOR, colortest.v);
#endif	
}
  
now GL_CURRENT_COLOR returns RED just before setting the color to WHITE. Then I call GL_CURRENT_COLOR after and its WHITE !!! what simple thing/rule am I missing ?? thanks p.s. I did a search and couldnt find anyhting

Share this post


Link to post
Share on other sites