Jump to content
  • Advertisement
Sign in to follow this  
szecs

glCallLists drives me nuts

This topic is 3175 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

void glMenuPrintHighlight(int x,int y,int z,int q,const char *fmt,...)
{	
	char str[1000];
	int prev_i = 0,i = 0;
	va_list ap;

	va_start(ap, fmt);
	    vsprintf(str, fmt, ap);
	va_end(ap);

	glListBase(MenuFontOffset-32);

	while( 1 )
	{	
		glWindowPos3i(x,y,z);

		if( i == 0 )
			glColor4f(0,0,0,1);
		else
			glColor4f(0.9921875, 0.8125, 0.26953125, 1.0);

		while( str && str != '\n' )
			i++;
							
		glCallLists(i-prev_i, GL_UNSIGNED_BYTE, (GLubyte *)(str+prev_i));

		if( !str )
			break;

		i++;
		
		prev_i = i;
		y -= 20;
		q--;
	}
}
OK I'm still in C Anyway: What I'm excepting: the first line is drawn black, the others orange. What I get: the second line is drawn black, the others orange. It seems that the glColor is executed after glCallLists. It's a test version, that's why I'm checking 'i', instead of 'q'. I'm sure this will be just another stupid bug, that I always post.

Share this post


Link to post
Share on other sites
Advertisement
The raster color is copied from the primary color when you set the raster position. You need to set the primary color before glWindowPos so the correct raster color is set also.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!