diff options
Diffstat (limited to 'OpenAL32/Include/alMain.h')
-rw-r--r-- | OpenAL32/Include/alMain.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index 8f08d94a..0770ee89 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -437,6 +437,26 @@ enum DevFmtChannels { }; #define MAX_OUTPUT_CHANNELS (16) +/* DevFmtType traits, providing the type, etc given a DevFmtType. */ +template<DevFmtType T> +struct DevFmtTypeTraits { }; + +template<> +struct DevFmtTypeTraits<DevFmtByte> { using Type = ALbyte; }; +template<> +struct DevFmtTypeTraits<DevFmtUByte> { using Type = ALubyte; }; +template<> +struct DevFmtTypeTraits<DevFmtShort> { using Type = ALshort; }; +template<> +struct DevFmtTypeTraits<DevFmtUShort> { using Type = ALushort; }; +template<> +struct DevFmtTypeTraits<DevFmtInt> { using Type = ALint; }; +template<> +struct DevFmtTypeTraits<DevFmtUInt> { using Type = ALuint; }; +template<> +struct DevFmtTypeTraits<DevFmtFloat> { using Type = ALfloat; }; + + ALsizei BytesFromDevFmt(enum DevFmtType type); ALsizei ChannelsFromDevFmt(enum DevFmtChannels chans, ALsizei ambiorder); inline ALsizei FrameSizeFromDevFmt(enum DevFmtChannels chans, enum DevFmtType type, ALsizei ambiorder) |