Sign in to follow this  

glutBitmapCharacter issue

This topic is 1709 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

Hi,

 

I'm drawing a white quad and then rendering some text over top of it using glutBitmapCharacter, but the text is being covered by the quad.  Does anyone know why?  Given the order I do the rendering, the text should be on top of the quad.

 

void renderBitmapString(
		float x,
		float y,
		float z,
		void *font,
		char *string) {

	char *c;
	glRasterPos3f(x, y,z);
	for (c=string; *c != '\0'; c++) {
		glutBitmapCharacter(font, *c);
	}
}

...
...
...
	glPushMatrix();
	glColor3f(0.9f, 0.9f, 0.9f);
	glBegin(GL_QUADS);
		glVertex3f(-100.0f, -100.0f, 0.0f);
		glVertex3f(-100.0f, 100.0f,  0.0f);
		glVertex3f( 100.0f, 100.0f,  0.0f);
		glVertex3f( 100.0f, -100.0f, 0.0f);
	glEnd();

	void *font= GLUT_BITMAP_8_BY_13;
	
	glColor3f(0.9f, 0.0f, 0.0f);
	renderBitmapString(30,15,0,font,(char *)"GLUT Tutorial @ Lighthouse3D");

 

 

Share this post


Link to post
Share on other sites

This topic is 1709 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