Web server application - OpenGL Super Bible! Page 381 SetBkColor(hDC,RGB(0,0,255)); SetTextColor(hDC,RGB(255,255,0)); TextOut(hDC,0,cRect.bottom-20,cBuffer,strlen
OpenGL Super Bible! Page 381 SetBkColor(hDC,RGB(0,0,255)); SetTextColor(hDC,RGB(255,255,0)); TextOut(hDC,0,cRect.bottom-20,cBuffer,strlen (cBuffer)); // Do not validate, forcing a continuous repaint } break; This message handler gets the current system time and counts the number of times it is called. After 71 times, it gets the new time, subtracts the difference, and displays the lapsed time. Remember that our bolt is rotating 5 each time it is rendered, so this technique effectively measures the amount of time it takes to spin the bolt 360 . The function ulGetProfileTime simply gets the system time in clock ticks and converts it to thousandths of a second. (You can examine this yourself in the source listing if you want, but its operation is not germane to our discussion here.) SPINBOLT s output is shown in Figure 10-9. The time to spin the bolt around in this example was just under 15 seconds (on a 90MHz Pentium with no hardware 3D acceleration). Figure 10-9 Output from the SPINBOLT program Improving Performance You may have spotted a glaring performance problem with the WM_PAINT technique, however. Each time the bolt is drawn, a large number of calculations must be performed to redraw the thread, the shaft, and the bolt head. Among these calculations are some pretty expensive calls to sin() and cos().
In case you need affordable webhost to host your website, our recommendation is ecommerce web host services.