summary refs log tree commit diff
path: root/src/main.zig
blob: 61986ba7832e98f5ceb55803b5c8be95e93d8bc7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
const alc = @import("alc.zig");

pub fn init() !void {
    const device = try alc.openDevice(null);
    const context = try alc.createContext(device, null);
    try alc.makeContextCurrent(context);
}

pub fn deinit() !void {
    const context = alc.getCurrentContext();
    const device = try alc.getContextsDevice(context);
    try alc.makeContextCurrent(null);
    try alc.destroyContext(context);
    try alc.closeDevice(device);
}

test {
    try init();
    try deinit();
}