Jump to content
  • Advertisement
Sign in to follow this  
pkiskool

outputCharacter

This topic is 3654 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 trying to output a value which a variable is carrying, in to my graphics. Here is how I'm trying to do it:
void *font = GLUT_BITMAP_9_BY_15;
char s[100];

void outputCharacter(float x, float y, float z, char *string) 
{
  int len, i;
  glRasterPos3f(x, y, z);
  len = (int) strlen(string);
  for (i = 0; i < len; i++) 
  {
    glutBitmapCharacter(font, string);
  }
}

void RenderScene(void)
	{
	sprintf_s(s,"%d", disp);
outputCharacter(- ((gridspace * n)/2-(gridspace/2)) - 42, (gridspace * n)/2-(gridspace/2) - 9, 0, s);

				// Restore transformations
				glPopMatrix();

				// Flush drawing commands
				glutSwapBuffers();

				glutPostRedisplay();

	}


Obviously this is just bits and bits and you won't be able to compile it. The variable which carries the value that I want is called 'disp'. It is a big number (a pressure value up to 500,000 Pa). But it will just display a zero at the momment. I double checked to see that disp is carrying the correct value of 500 Kpa.

Share this post


Link to post
Share on other sites
Advertisement
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!