diff --git a/base/applications/screensavers/3dtext/3dtext.c b/base/applications/screensavers/3dtext/3dtext.c index c1f908ca37a..b4bdd2ca6a0 100644 --- a/base/applications/screensavers/3dtext/3dtext.c +++ b/base/applications/screensavers/3dtext/3dtext.c @@ -41,6 +41,8 @@ GLfloat extentY = 0.0f; HINSTANCE hInstance; BOOL fullscreen = FALSE; +#define APP_TIMER 1 // Graphics Update Timer ID +#define APP_TIMER_INTERVAL USER_TIMER_MINIMUM * 5 // Graphics Update Interval // Build Our Bitmap Font GLvoid BuildFont(GLvoid) @@ -338,6 +340,7 @@ ScreenSaverProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) // Initialize The GL Screen Using Screen Info InitGL(Screen.right, Screen.bottom); + SetTimer(hWnd, APP_TIMER, APP_TIMER_INTERVAL, NULL); // Graphics update timer break; case WM_DESTROY: @@ -360,6 +363,7 @@ ScreenSaverProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) case WM_PAINT: DrawGLScene(); SwapBuffers(hDC); + ValidateRect(hWnd, NULL); // Don't update here. Wait for timer. break; case WM_SIZE: // Resizing The Screen @@ -367,6 +371,10 @@ ScreenSaverProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) ReSizeGLScene(LOWORD(lParam), HIWORD(lParam)); break; + case WM_TIMER: // Used to update graphic based on timer udpate interval + InvalidateRect(hWnd, NULL, TRUE); + break; + default: // Pass Windows Messages to the default screensaver window procedure return DefScreenSaverProc(hWnd, message, wParam, lParam);