Skip to content

Commit

Permalink
Add support for binding textures directly from a TextureSequence
Browse files Browse the repository at this point in the history
Fixes #1645
  • Loading branch information
PathogenDavid committed May 3, 2024
1 parent ced27db commit a38d56b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Bonsai.Shaders/BindTexture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,12 @@ public IObservable<Texture> Process(IObservable<Texture> source)
return Process(source, input =>
{
GL.ActiveTexture(TextureSlot);
GL.BindTexture(TextureTarget, input != null ? input.Id : 0);
int textureId;
if (Index is int index)
textureId = ((TextureSequence)input).Textures[index];
else
textureId = input.Id;
GL.BindTexture(TextureTarget, textureId);
});
}
}
Expand Down

0 comments on commit a38d56b

Please sign in to comment.