|
@@ -19,6 +19,7 @@
|
|
|
#include <vector.h>
|
|
|
|
|
|
bool isRunning = true;
|
|
|
+int previousFrameTime = 0;
|
|
|
|
|
|
#define N_POINTS (9*9*9)
|
|
|
vec3_t cubePoints[N_POINTS];
|
|
@@ -36,7 +37,7 @@ vec3_t cubeRotation =
|
|
|
.z = 0,
|
|
|
};
|
|
|
|
|
|
-double fovFactor = 640 ;
|
|
|
+double fovFactor = 820 ;
|
|
|
|
|
|
void setup()
|
|
|
{
|
|
@@ -120,9 +121,13 @@ void update()
|
|
|
{
|
|
|
int i;
|
|
|
|
|
|
- cubeRotation.x += 0.001;
|
|
|
- cubeRotation.y += 0.001;
|
|
|
- cubeRotation.z += 0.001;
|
|
|
+ while(!SDL_TICKS_PASSED(SDL_GetTicks(), previousFrameTime + FRAME_TARGET_TIME));
|
|
|
+
|
|
|
+ previousFrameTime = SDL_GetTicks();
|
|
|
+
|
|
|
+ cubeRotation.x += 0.01;
|
|
|
+ cubeRotation.y += 0.01;
|
|
|
+ cubeRotation.z += 0.01;
|
|
|
|
|
|
for(i = 0; i < N_POINTS; i++)
|
|
|
{
|