diff options
Diffstat (limited to 'src/gl.zig')
| -rw-r--r-- | src/gl.zig | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -50,7 +50,7 @@ pub const Texture = struct { pub fn bind(self: *Texture) usize { if (self.image_unit == null) { - for (image_unit_map[0..], 0..) |*slot, i| { + for (image_unit_map[0..], 1..) |*slot, i| { if (slot.*) continue; slot.* = true; @@ -61,6 +61,7 @@ pub const Texture = struct { if (self.image_unit) |image_unit| { c.glActiveTexture(@intCast(c.GL_TEXTURE0 + image_unit)); + defer c.glActiveTexture(@intCast(c.GL_TEXTURE0)); c.glBindTexture(@intFromEnum(self.type), self.id); return image_unit; } else unreachable; @@ -887,7 +888,7 @@ pub const Source = struct { texture: Texture, update_fn: ?*const fn (self: *Source) void, - deinit_fn: *const fn (self: *const Source, allocator: std.mem.Allocator) void, + deinit_fn: *const fn (self: *Source, allocator: std.mem.Allocator) void, pub fn update(self: *Source) void { if (self.update_fn) |inner| inner(self); |
