1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-07-03 14:41:21 +00:00

Fix to prevent SUB _GL from consuming all runtime resources when it cannot meet _FPS (or assumed _FPS) demands

This commit is contained in:
Galleon 2015-01-21 04:51:58 -08:00
parent dcaf43a493
commit f1938b5b01

View file

@ -28477,6 +28477,7 @@ void sub__maptriangle(int32 cull_options,float sx1,float sy1,float sx2,float sy2
#ifdef QB64_GLUT
glutPostRedisplay();
int32 msdelay=1000.0/max_fps;
Sleep(4); msdelay-=4;//this forces GLUT to relinquish some CPU time to other threads but still allow for _FPS 100+
if (msdelay<1) msdelay=1;
glutTimerFunc(msdelay,GLUT_TIMER_EVENT,0);
#endif