diff options
author | Chris Robinson <[email protected]> | 2010-07-24 19:14:32 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2010-07-24 19:14:32 -0700 |
commit | 40dd1fb85364e3a9e278ffa7a034638e7718770b (patch) | |
tree | b4da0f38e57498b1c2e4b44986814f7e58d92ef6 /Alc/dsound.c | |
parent | ab77fc14d53993e90403dd3474725a6202f623c4 (diff) |
Add a backend callback to get the device time
The method should monotonically count the number of nanoseconds the device has
active contexts
Diffstat (limited to 'Alc/dsound.c')
-rw-r--r-- | Alc/dsound.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Alc/dsound.c b/Alc/dsound.c index 3365f5ef..f636287f 100644 --- a/Alc/dsound.c +++ b/Alc/dsound.c @@ -538,6 +538,11 @@ static ALCuint DSoundAvailableSamples(ALCdevice *pDevice) return 0; } +static ALuint64 DSoundGetTime(ALCdevice *Device) +{ + return Device->SamplesPlayed * 1000000000 / Device->Frequency; +} + BackendFuncs DSoundFuncs = { DSoundOpenPlayback, @@ -549,7 +554,8 @@ BackendFuncs DSoundFuncs = { DSoundStartCapture, DSoundStopCapture, DSoundCaptureSamples, - DSoundAvailableSamples + DSoundAvailableSamples, + DSoundGetTime }; |