Simple image animation like gif or spritesheet

Hey Guys,

i am currently searching for a lightweight and easy way to include simple image animation into my project. I am a bit confused that there is no simple way to use gif or sprite based animations in of. The gif addons i tried are not really working and the spritesheet addons are quite complex and have to many features for my needs.

Can you suggest me something which simply loops a sequence of images in an really simple gif style?
I am really confused that there is no native way in OF for that. Or do i miss something?

This is for png and jpg image sequences.


static const int imagenum = 10; //the total number of images to sequence
int imageno, counter, counterlimit, imagex, imagey;
ofImage image[imagenum];


void ofApp::setup {
    imageno = 0;
    counter = 0;
    counterlimit = 1000;
    for (int i=0; i<imagenum; i++) image[i].loadImage("pathToImage.png");
    imagex = 0;
    imagey = 0;

void ofApp::draw() {
    glClearColor(0, 0, 0);

    image[imageno].draw(imagex, imagey);
    if (counter >= counterlimit) {
        counter = 0;
        if (imageno >= imagenum) imageno = 0;

thanks man.

i solved it for now with a vector.