summary refs log tree commit diff
path: root/src/zeal.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/zeal.zig')
-rw-r--r--src/zeal.zig17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/zeal.zig b/src/zeal.zig
index 26dffa8..af9fd85 100644
--- a/src/zeal.zig
+++ b/src/zeal.zig
@@ -35,6 +35,10 @@ pub const Device = struct {
         return Device{ .pimpl = try alc.openDevice(name) };
     }
 
+    pub fn enabledHrtf(self: Device) alc.Error!bool {
+        return 0 != try alc.getInt(self.pimpl, alc.HRTF);
+    }
+
     pub fn deinit(self: Device) alc.Error!void {
         try alc.closeDevice(self.pimpl);
     }
@@ -152,6 +156,19 @@ pub const Source = struct {
         try al.source.destroy(&self.reference);
     }
 
+    /// Specify if the source always has 3D spatialization features (al.ON),
+    /// never has 3D spatialization features (al.OFF), or if spatialization
+    /// is enabled based on playing a mono sound or not (al.AUTO, default).
+    pub fn setSpatialize(self: Source, value: i32) Error!void {
+        try checkContext(self.context);
+        try al.source.set(self.reference, al.SOURCE_SPATIALIZE, value);
+    }
+
+    pub fn setPosition(self: Source, position: [3]f32) Error!void {
+        try checkContext(self.context);
+        try al.source.set(self.reference, al.POSITION, position);
+    }
+
     pub fn isPlaying(self: Source) Error!bool {
         try checkContext(self.context);
         const state = try al.source.get(i32, self.reference, al.SOURCE_STATE);