Sign in to follow this  
szecs

glCallLists drives me nuts

Recommended Posts

szecs    2990
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[i] && str[i] != '\n' )
			i++;
							
		glCallLists(i-prev_i, GL_UNSIGNED_BYTE, (GLubyte *)(str+prev_i));

		if( !str[i] )
			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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this