exp/audio/al: add Capability type, export distance model capability

Fixes golang/go#11298.

Change-Id: I3f103a2c1a63e96ca8c7367994179fb32d5ec7db
Reviewed-on: https://go-review.googlesource.com/16435
Reviewed-by: David Crawshaw <crawshaw@golang.org>
This commit is contained in:
Burcu Dogan 2015-10-28 14:13:23 -07:00
parent c6f2181dba
commit 3ca3fec8ee
2 changed files with 13 additions and 6 deletions

View File

@ -24,19 +24,22 @@
// http://repo.or.cz/w/openal-soft.git/blob/HEAD:/COPYING.
package al // import "golang.org/x/mobile/exp/audio/al"
// Capability represents OpenAL extension capabilities.
type Capability int32
// Enable enables a capability.
func Enable(capability int32) {
alEnable(capability)
func Enable(c Capability) {
alEnable(int32(c))
}
// Disable disables a capability.
func Disable(capability int32) {
alDisable(capability)
func Disable(c Capability) {
alDisable(int32(c))
}
// Enabled returns true if the specified capability is enabled.
func Enabled(capability int32) bool {
return alIsEnabled(capability)
func Enabled(c Capability) bool {
return alIsEnabled(int32(c))
}
// Vector represents an vector in a Cartesian coordinate system.

View File

@ -76,3 +76,7 @@ const (
FormatStereo8 = 0x1102
FormatStereo16 = 0x1103
)
// CapabilityDistanceModel represents the capability of specifying a different distance
// model for each source.
const CapabilityDistanceModel = Capability(0x200)