diff options
| author | LLLL Colonq <llll@colonq> | 2024-04-21 23:16:23 -0400 |
|---|---|---|
| committer | LLLL Colonq <llll@colonq> | 2024-04-21 23:16:23 -0400 |
| commit | d2f9bfeba00018a1109949eed5a2434a040881fe (patch) | |
| tree | c396e4e8a00b500957d07ef47210b09d6325c412 | |
| parent | f449efbebd6f04a94648c8c662191845a6ed9472 (diff) | |
More general texture binding
| -rw-r--r-- | src/texture.rs | 4 | ||||
| -rw-r--r-- | src/utils.rs | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/texture.rs b/src/texture.rs index 6e46d58..2fd9aab 100644 --- a/src/texture.rs +++ b/src/texture.rs @@ -60,9 +60,9 @@ impl Texture { } } - pub fn bind_normal(&self, ctx: &context::Context) { + pub fn bind_index(&self, ctx: &context::Context, idx: u32) { unsafe { - ctx.gl.active_texture(glow::TEXTURE1); + ctx.gl.active_texture(glow::TEXTURE0 + idx); ctx.gl.bind_texture(glow::TEXTURE_2D, Some(self.tex)); } } diff --git a/src/utils.rs b/src/utils.rs index 57ccf13..e0a0e29 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -1,4 +1,4 @@ -#[derive(Clone, Debug, PartialEq)] +#[derive(Clone, Debug, PartialEq, Eq, Hash)] pub enum Cardinal { North, South, |
