diff --git a/src/Sprite.hpp b/src/Sprite.hpp index ae774d5..db79036 100644 --- a/src/Sprite.hpp +++ b/src/Sprite.hpp @@ -192,6 +192,17 @@ namespace sb return _texture_index; } + /*! + * Increment the texture index the given number of times. Defaults to 1. It will wrap around at the end. Negative increment can be used. + * + * @param increment amount to increment the texture index + */ + void texture_increment(int increment = 1) + { + /* Add and wrap (even though model wraps as well) */ + _texture_index = glm::mod(_texture_index + increment, static_cast(plane.textures().size())); + } + /*! * If the GL context is active, this can be called to load image paths previously associated with textures attached to the * sprite's plane object.