Ignore:
Timestamp:
06/18/08 04:08:41 (16 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Vis/CHC_revisited/chcdemo.cpp

    r2768 r2769  
    1919#include "CHCPlusPlusTraverser.h" 
    2020#include "Visualization.h" 
    21  
     21#include "RenderState.h" 
    2222 
    2323 
     
    8080void SetupLighting(); 
    8181void DisplayStats(); 
     82void Output(int x, int y, const char *string); 
    8283 
    8384void begin2D(); 
    8485void end2D(); 
    85 void output(int x, int y, const char *string); 
    8686void keyboard(unsigned char c, int x, int y); 
    8787void drawHelpMessage(); 
     
    180180                 
    181181        //glEnable(GL_ALPHA_TEST); 
    182         //glAlphaFunc(GL_GEQUAL, 0.01); 
    183  
    184182        glDisable(GL_ALPHA_TEST); 
     183        glAlphaFunc(GL_GEQUAL, 0.1f); 
    185184 
    186185        glFrontFace(GL_CCW); 
     
    263262                else  
    264263                { 
    265                         output(x, y, message[i]); 
     264                        Output(x, y, message[i]); 
    266265                        y += 14; 
    267266                } 
     
    734733 
    735734 
    736 void output(const int x, const int y, const char *string)  
     735void Output(int x, int y, const char *string)  
    737736{ 
    738737        if (string != 0)  
     
    744743                for (i = 0; i < len; ++ i)  
    745744                { 
    746                         glutBitmapCharacter(GLUT_BITMAP_8_BY_13, string[i]); 
     745                        glutBitmapCharacter(GLUT_BITMAP_HELVETICA_18, string[i]); 
    747746                } 
    748747        } 
     
    841840        char msg3[200]; 
    842841        char msg4[200]; 
     842        char msg5[200]; 
    843843 
    844844 
     
    856856        renderTime = traverser->GetStats().mRenderTime * expFactor + (1.0f - expFactor) * renderTime; 
    857857 
    858         if (renderTime) fps /= (float)renderTime; 
    859  
    860         sprintf_s(msg3, "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]); 
    862862 
    863863        string str; 
     
    868868        CalcDecimalPoint(str2, traverser->GetStats().mNumRenderedTriangles); 
    869869 
    870         sprintf_s(msg4, "rendered objects %5d (of %5d), rendered triangles: %s (of %s)",  
     870        sprintf_s(msg3, "rendered objects: %6d (of %6d), rendered triangles: %s (of %s)",  
    871871                          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); 
    872876 
    873877 
     
    880884        else 
    881885        { 
    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]); 
    884889 
    885890                if(showStatistics) 
    886891                { 
    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); 
    890896                } 
    891897        } 
Note: See TracChangeset for help on using the changeset viewer.