/********************************************************************************************************* ** Function name: drawNumberBig ** Descriptions: drawNumberBig *********************************************************************************************************/ int ePaper::drawNumberBig(long long_num,int poX, int poY) { char tmp[10]; sprintf(tmp, "%d", long_num); return drawStringBig(tmp, poX, poY); }
/* There can be only one idle() callback function. In an animation, this idle() function must update not only the main window but also all derived subwindows */ void idle (void) { glutSetWindow (winIdMain); glutPostRedisplay (); glutSetWindow (winIdSub); glutPostRedisplay (); }; void drawString (char *s) { unsigned int i; for (i = 0; i < strlen (s); i++) glutBitmapCharacter (GLUT_BITMAP_HELVETICA_10, s[i]); }; void drawStringBig (char *s) { unsigned int i; for (i = 0; i < strlen (s); i++) glutBitmapCharacter (GLUT_BITMAP_HELVETICA_12, s[i]); }; static char label[100]; /* Storage for current string */ void subMenuDisplay() { /* Clear subwindow */ glutSetWindow (winIdSub); glClearColor(0.7f, 0.7f, 0.7f, 1.0f); glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); /* Write State Variables */ glColor3f (1.0F, 1.0F, 1.0F); sprintf (label, "Number Of Particle LIQUID_PARTICLE + ELASTIC_PARTICLE + BOUNDARY_PARTICLE = %d + %d + %d", fluid_simulation->get_numOfLiquidP(),fluid_simulation->get_numOfElasticP(),fluid_simulation->get_numOfBoundaryP()); glRasterPos2f (0.01F, 0.65F); drawStringBig (label); glColor3f (1.0F, 1.0F, 1.0F); sprintf (label, "FPS = %.2f ", fps); glRasterPos2f (0.01F, 0.20F); drawStringBig (label); glutSwapBuffers (); };