Add experimental device attributes for apps to query
These will be part of the ALC_EXT_device_time extension. Behavior, values, etc, are all subject to change.
This commit is contained in:
parent
d886fb118b
commit
f1f2941511
25
Alc/ALc.c
25
Alc/ALc.c
@ -1356,6 +1356,31 @@ ALC_API ALCvoid ALC_APIENTRY alcGetIntegerv(ALCdevice *device,ALCenum param,ALsi
|
||||
*data = device->Connected;
|
||||
break;
|
||||
|
||||
case ALC_GET_TIME_EXT:
|
||||
if(!IsDevice(device))
|
||||
alcSetError(device, ALC_INVALID_DEVICE);
|
||||
else if(size < 2)
|
||||
alcSetError(device, ALC_INVALID_VALUE);
|
||||
else
|
||||
{
|
||||
ALuint64 t = ALCdevice_GetTime(device);
|
||||
data[0] = t&0xffffffff;
|
||||
data[1] = t>>32;
|
||||
}
|
||||
break;
|
||||
|
||||
case ALC_GET_TIME_RES_EXT:
|
||||
if(!IsDevice(device))
|
||||
alcSetError(device, ALC_INVALID_DEVICE);
|
||||
else if(size < 2)
|
||||
alcSetError(device, ALC_INVALID_VALUE);
|
||||
else
|
||||
{
|
||||
data[0] = device->TimeRes&0xffffffff;
|
||||
data[1] = device->TimeRes>>32;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
alcSetError(device, ALC_INVALID_ENUM);
|
||||
break;
|
||||
|
@ -84,6 +84,12 @@ AL_API ALvoid AL_APIENTRY alUnmapDatabufferEXT(ALuint uiBuffer);
|
||||
#define AL_LOOP_POINTS 0x2015
|
||||
#endif
|
||||
|
||||
#ifndef ALC_EXT_device_time
|
||||
#define ALC_EXT_device_time 1
|
||||
#define ALC_GET_TIME_EXT 0x314
|
||||
#define ALC_GET_TIME_RES_EXT 0x315
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_STDINT_H)
|
||||
#include <stdint.h>
|
||||
typedef int64_t ALint64;
|
||||
|
Loading…
x
Reference in New Issue
Block a user