Sign in to follow this  

glCallLists drives me nuts

This topic is 2964 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[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

This topic is 2964 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.

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