0

Is this code sample correct? Why do some of _data have the same values? How can i get pointers to every animation frame contained in gif image?

_num = ilGetInteger(IL_NUM_IMAGES)+1;

for (int i = 0; i < _num; i++)
{
    ilActiveImage(i);
    _data.push_back(ilGetData());
}
Jamie Counsell
  • 7,730
  • 6
  • 46
  • 81
user3808059
  • 373
  • 2
  • 15

1 Answers1

0

Documentation is very weak at this point. Correct code should be

num = ilGetInteger(IL_NUM_IMAGES);
for(int i = 0; i != num; ++i) {
    ilBindImage(your_image_id);
    ilActiveImage(i + 1);   // counts from 1
    // do something with ilGetData()
}

No doc seems to say that re-binding before each ilActiveImage is required, but it is.

keltar
  • 17,711
  • 2
  • 37
  • 42