GithubHelp home page GithubHelp logo

Comments (1)

bcampbell avatar bcampbell commented on June 9, 2024

See also #34.

The current implementation of IL_NUM_IMAGES returns the number of images after the currently-bound image. So the result returned depends upon which frame you're currently on (eg if you're on the first frame of a 10 frame animation, IL_NUM_IMAGES will return 9. If you're on frame 2, it'll return 8. And so on.).

The animation support is really fuzzy. I'm planning to do some cleanup to clarify how it all works.
Basically, I think that:

  • IL_NUM_IMAGES should always return the number of images in the whole animation, regardless of which frame you're on.
  • ilActiveImage(N) should jump to frame N in the anim, rather than advancing N beyond the current frame (currently it advances N frames from the current one - see #34).

The obvious loop is:

num_frames = ilGetInteger(IL_NUM_IMAGES);
for(n=0;n<num_frames; ++n) {
    ilActiveImage(n);
    ... do stuff with frame n...
}

But this doesn't work with the current code. I think it should.

Most of these same issues also apply to Mipmaps, Layers and Cubemap faces.
And obviously, it gets even more complicated when you want to deal with, say, animated cubemaps with mipmap levels ;-)
So I think my planned changes will break the API... but then I feel it's not too big a deal because the API is already pretty broken in this respect. Feedback welcome!

from devil.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.