[3DTEXT]
[reactos.git] / reactos / base / applications / screensavers / 3dtext / 3dtext.c
index 7b8d11f..a64e325 100644 (file)
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-#include <windows.h>
+#include "3dtext.h"
+
+#include <winbase.h>
+#include <wingdi.h>
+#include <winuser.h>
 #include <scrnsave.h>
 #include <math.h>
-#include <GL/gl.h>
 #include <GL/glu.h>
-#include <tchar.h>
 
 #include "resource.h"
-#include "3dtext.h"
 
 static HGLRC hRC;       // Permanent Rendering Context
 static HDC hDC;         // Private GDI Device Context
@@ -83,7 +84,7 @@ GLvoid BuildFont(GLvoid)
                        0.0f,                    // Deviation From The True Outlines
                        0.2f,                    // Font Thickness In The Z Direction
                        WGL_FONT_POLYGONS,       // Use Polygons, Not Lines
-                       gmf);                    // Address Of Buffer To Recieve Data
+                       gmf);                    // Address Of Buffer To Receive Data
 
     // Calculate the string extent
     for (i = 0; i < _tcslen(m_Text); i++)
@@ -208,6 +209,9 @@ GLvoid ReSizeGLScene(GLsizei Width, GLsizei Height)
 // Handles Rendering
 GLvoid DrawGLScene(GLvoid)
 {
+    // Save ticks count of previous frame here
+    static DWORD dwTicks = 0;
+
     // Clear The Screen And The Depth Buffer
     glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
 
@@ -243,7 +247,9 @@ GLvoid DrawGLScene(GLvoid)
     glColor3f(0.0f, 0.0f, 1.0f);
 
     // Increase The Rotation Variable
-    rot += 0.1f;
+    if(dwTicks)
+        rot += (GetTickCount() - dwTicks) / 20.0f;
+    dwTicks = GetTickCount();
 }
 
 LRESULT CALLBACK