Changeset 2769 for GTP/trunk/App/Demos/Vis/CHC_revisited/chcdemo.cpp
- Timestamp:
- 06/18/08 04:08:41 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/CHC_revisited/chcdemo.cpp
r2768 r2769 19 19 #include "CHCPlusPlusTraverser.h" 20 20 #include "Visualization.h" 21 21 #include "RenderState.h" 22 22 23 23 … … 80 80 void SetupLighting(); 81 81 void DisplayStats(); 82 void Output(int x, int y, const char *string); 82 83 83 84 void begin2D(); 84 85 void end2D(); 85 void output(int x, int y, const char *string);86 86 void keyboard(unsigned char c, int x, int y); 87 87 void drawHelpMessage(); … … 180 180 181 181 //glEnable(GL_ALPHA_TEST); 182 //glAlphaFunc(GL_GEQUAL, 0.01);183 184 182 glDisable(GL_ALPHA_TEST); 183 glAlphaFunc(GL_GEQUAL, 0.1f); 185 184 186 185 glFrontFace(GL_CCW); … … 263 262 else 264 263 { 265 output(x, y, message[i]);264 Output(x, y, message[i]); 266 265 y += 14; 267 266 } … … 734 733 735 734 736 void output(const int x, constint y, const char *string)735 void Output(int x, int y, const char *string) 737 736 { 738 737 if (string != 0) … … 744 743 for (i = 0; i < len; ++ i) 745 744 { 746 glutBitmapCharacter(GLUT_BITMAP_ 8_BY_13, string[i]);745 glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, string[i]); 747 746 } 748 747 } … … 841 840 char msg3[200]; 842 841 char msg4[200]; 842 char msg5[200]; 843 843 844 844 … … 856 856 renderTime = traverser->GetStats().mRenderTime * expFactor + (1.0f - expFactor) * renderTime; 857 857 858 if (renderTime) fps /=(float)renderTime;859 860 sprintf_s(msg 3, "Threshold: %4d, render time: %ld ms (%3.3f fps), issued queries: %d%s",861 traverser->GetVisibilityThreshold(), renderTime, fps, traverser->GetStats().mNumIssuedQueries,optstr[useOptimization]);858 if (renderTime) fps = 1e3f / (float)renderTime; 859 860 sprintf_s(msg2, "threshold: %4d%s", 861 traverser->GetVisibilityThreshold(), optstr[useOptimization]); 862 862 863 863 string str; … … 868 868 CalcDecimalPoint(str2, traverser->GetStats().mNumRenderedTriangles); 869 869 870 sprintf_s(msg 4, "rendered objects %5d (of %5d), rendered triangles: %s (of %s)",870 sprintf_s(msg3, "rendered objects: %6d (of %6d), rendered triangles: %s (of %s)", 871 871 traverser->GetStats().mNumRenderedGeometry, sceneEntities.size(), str.c_str(), str2.c_str()); 872 873 sprintf_s(msg4, "issued queries: %5d", traverser->GetStats().mNumIssuedQueries); 874 875 sprintf_s(msg5, "fps: %6.1f", fps); 872 876 873 877 … … 880 884 else 881 885 { 882 glColor3f(1.0f, 1.0f , 1.0f); 883 output(10, winHeight - 10, msg[renderMode]); 886 glColor3f(1.0f, 1.0f, 1.0f); 887 888 Output(800, 30, msg[renderMode]); 884 889 885 890 if(showStatistics) 886 891 { 887 output(20, winHeight - 70, msg3); 888 output(20, winHeight - 50, msg4); 889 output(20, winHeight - 30, msg2); 892 Output(20, 30, msg2); 893 Output(20, 60, msg3); 894 Output(20, 90, msg4); 895 Output(20, 120, msg5); 890 896 } 891 897 }
Note: See TracChangeset
for help on using the changeset viewer.