Skip to content

WIP: Improve texture loading API#970

Draft
kblaschke wants to merge 1 commit intomasterfrom
allow-passing-compressed-textures
Draft

WIP: Improve texture loading API#970
kblaschke wants to merge 1 commit intomasterfrom
allow-passing-compressed-textures

Conversation

@kblaschke
Copy link
Member

Based on user feedback, the texture loading API should support a few additional features:

  • Load compressed images as-is, e.g. the app just passing in the raw image file into projectM and have projectM deal with the decoding internally, just as with auto-loaded textures.
  • Improve life time/ownership issue with app-created GL textures. projectM should only use, but not own/delete the texture.
  • Add a way to push textures in advance, with the option to not have projectM delete them automatically. This will allow pre-loading large textures (given there's enough VRAM) and user sprite images to avoid lags later on.
  • Add a callback when projectM no longer needs a user-supplied GL texture, e.g. if it's being purged from the cache. This will give apps a hint that the texture may be deleted.

In addition to these features, I've reworked the API to provide separate loading functions for compressed images, GL texture IDs and raw bitmap data, which can either be called within the texture load callback, or at any given time the app wants to push or pre-load textures. This removes the struct from the API, which would be considered immutable after releasing the new version. Adding new functions is more forward-compatible than a fixed-size struct.

@kblaschke kblaschke added this to the 4.2 milestone Feb 26, 2026
@kblaschke kblaschke self-assigned this Feb 26, 2026
@kblaschke kblaschke added the enhancement The feature is considered an enhancement. label Feb 26, 2026
@kblaschke kblaschke moved this to In Progress in libprojectM Release 4.2 Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement The feature is considered an enhancement.

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

1 participant