Changeset 2748 for GTP/trunk


Ignore:
Timestamp:
06/10/08 11:05:51 (17 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

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

    r2746 r2748  
    353353        char msg8[100]; 
    354354 
    355         sprintf(msg2, "Traversed: %4d, frustum culled: %4d, query culled: %4d (of %d nodes)", 
     355        sprintf_s(msg2, "Traversed: %4d, frustum culled: %4d, query culled: %4d (of %d nodes)", 
    356356                        traverser.GetNumTraversedNodes(), traverser.GetNumFrustumCulledNodes(), 
    357357                        traverser.GetNumQueryCulledNodes(),  
     
    361361        char *querystr[2] = {"NV", "ARB"}; 
    362362 
    363         float fps = 1000.0; 
     363        float fps = 1e3f; 
    364364        long renderTime = calcRenderTime(); 
    365         if(renderTime) fps = 1000000.0f / (float)calcRenderTime(); 
    366  
    367         sprintf(msg3, "Threshold: %4d, algorithm rendering time: %ld ms (%3.3f fps), queries: %s%s",  
     365        if (renderTime) fps = 1e6f / (float)calcRenderTime(); 
     366 
     367        sprintf_s(msg3, "Threshold: %4d, algorithm rendering time: %ld ms (%3.3f fps), queries: %s%s",  
    368368                traverser.GetVisibilityThreshold(), renderTime / 1000, fps, querystr[useArbQueries], optstr[useOptimization]); 
    369369 
     
    374374        calcDecimalPoint(str2, Geometry::CountTriangles(objectType) * numObjects); 
    375375 
    376         sprintf(msg4, "Rendered objects %d (of %d), rendered triangles: %s (of %s)",  
     376        sprintf_s(msg4, "Rendered objects %d (of %d), rendered triangles: %s (of %s)",  
    377377                        traverser.GetNumRenderedGeometry(), numObjects, str.c_str(), str2.c_str());  
    378378 
    379         sprintf(msg5, "Next object num: %d", numNextObjects); 
    380         sprintf(msg6, "Next length in z dir: %3.3f", zLength); 
     379        sprintf_s(msg5, "Next object num: %d", numNextObjects); 
     380        sprintf_s(msg6, "Next length in z dir: %3.3f", zLength); 
    381381         
    382382        char *objectTypeStr[3] = {"teapot", "torus", "sphere"}; 
    383383 
    384         sprintf(msg7, "Next object type: %s", objectTypeStr[nextObjectType]); 
    385         sprintf(msg8, "Next object size: %3.3f", objectSize); 
     384        sprintf_s(msg7, "Next object type: %s", objectTypeStr[nextObjectType]); 
     385        sprintf_s(msg8, "Next object size: %3.3f", objectSize); 
    386386 
    387387        glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 
     
    836836        if (numbers.size() > 0) 
    837837        { 
    838                 sprintf(hstr, "%d", numbers.back()); 
     838                sprintf_s(hstr, "%d", numbers.back()); 
    839839                str.append(hstr); 
    840840        } 
     
    842842        for (size_t i = numbers.size() - 2; i >= 0; i--) 
    843843        { 
    844                 sprintf(hstr, ",%03d", numbers[i]); 
     844                sprintf_s(hstr, ",%03d", numbers[i]); 
    845845                str.append(hstr); 
    846846        } 
Note: See TracChangeset for help on using the changeset viewer.