add sprite texture index increment function
This commit is contained in:
parent
110b876648
commit
0a42df9a00
|
@ -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<int>(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.
|
||||
|
|
Loading…
Reference in New Issue