J'essaye d'avoir un tic régulier de 41ms secondes et j'obtiens 100 ms.
Pourquoi ?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 m_fps = 24; TIMECAPS tc; UINT resolution; if (timeGetDevCaps(&tc, sizeof(TIMECAPS)) != TIMERR_NOERROR) return; resolution = min(max(tc.wPeriodMin, 1000/m_fps), tc.wPeriodMax); // resolution est bien egal a 41 uint err = timeBeginPeriod(resolution); // pas d'erreur m_loop_timer = timeSetEvent( 10, resolution, tic, (DWORD)(this), TIME_PERIODIC ); // handle ok if(!m_loop_timer) return;
Partager