Git Product home page Git Product logo

Comments (5)

MarkCallow avatar MarkCallow commented on June 19, 2024

The loader already sets GL_TEXTURE_MAX_LEVEL when compiled for a version of OpenGL {,ES} that supports it, i.e. GL_TEXTURE_MAX_LEVEL is defined in gl.h. You can use glGetTexParameter to retrieve this value. Does this meet your need?

I have now documented this in the docs for the ktxLoadTexture* functions. Sorry for the oversight.

I can consider changing this to a run-time rather than compile time choice, based on whether the GL context supports the parameter. Would this help?

from ktx-software.

suikki avatar suikki commented on June 19, 2024

Thanks. Seems that I was using some ancient version of libktx that didn't do that yet.

The only problem that I see is that I'm also building an OpenGL ES2 app on iOS. It supports max level with an extension where the same define is called TEXTURE_MAX_LEVEL_APPLE. So it would probably only work with a runtime check (or minor hacking).

from ktx-software.

MarkCallow avatar MarkCallow commented on June 19, 2024

I'll be happy to accept a pull request to make this work on iOS. I'm busy working on a KTX loader for Vulkan right now so I won't be able to look at this myself for a while.

from ktx-software.

suikki avatar suikki commented on June 19, 2024

Yeah, no problem. I already have the old version working with a minor hack and I'm also quite busy now so I won't be updating to the newer lib quite yet. But I'll probably do it at some point.

from ktx-software.

MarkCallow avatar MarkCallow commented on June 19, 2024

This is fixed in the new API currently in incoming. The ktxTexture object created when loading a file has a field giving the number of mipmap levels in the file.

from ktx-software.

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.