06-11-2004, 04:41 AM
I encountered a strange problem when i use glTranslate function to make a sphere to move by setting a timer. My idea is very simple :
.....
---set a "SetTimer(1,10,NULL)";
---caculate the position of the sphere(x,y,z);
---glPushMatrix;
---draw a sphere;
---glTranslate (to move the sphere);
---glPopMratrix;
......
at first the sphere moves well, but the things is that after a few minutes it slow down gradually ,I extend the time alternation "SetTimer(1,20,NULL)",I find the CPU utility was declined ,but it still slow down after a bit more minutes :( why ? maybe other codes in the program have some unknow effect...
Is anyone have experienced such situation and could you please tell me what usually cause this?
Thank you.
.....
---set a "SetTimer(1,10,NULL)";
---caculate the position of the sphere(x,y,z);
---glPushMatrix;
---draw a sphere;
---glTranslate (to move the sphere);
---glPopMratrix;
......
at first the sphere moves well, but the things is that after a few minutes it slow down gradually ,I extend the time alternation "SetTimer(1,20,NULL)",I find the CPU utility was declined ,but it still slow down after a bit more minutes :( why ? maybe other codes in the program have some unknow effect...
Is anyone have experienced such situation and could you please tell me what usually cause this?
Thank you.