mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-11 07:12:16 +00:00
Replace usleep with nanosleep for macOS too
This commit is contained in:
parent
f492e92cb5
commit
092b339c8f
1 changed files with 6 additions and 1 deletions
|
@ -77,7 +77,12 @@ void I_WaitVBL(const int count)
|
||||||
{
|
{
|
||||||
// I_WaitVBL is never used to actually synchronize to the
|
// I_WaitVBL is never used to actually synchronize to the
|
||||||
// vertical blank. Instead, it's used for delay purposes.
|
// vertical blank. Instead, it's used for delay purposes.
|
||||||
usleep(1000000 * count / 70);
|
struct timespec delay, rem;
|
||||||
|
delay.tv_sec = count / 70;
|
||||||
|
/* Avoid overflow. Microsec res should be good enough. */
|
||||||
|
delay.tv_nsec = (count%70)*1000000/70 * 1000;
|
||||||
|
while(nanosleep(&delay, &rem) == -1 && errno == EINTR)
|
||||||
|
delay = rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue