Skip to content

[FEATURE] Add callback to API to support loading textures from non-filesystem sources #870

@kblaschke

Description

@kblaschke

Please confirm the following points:

  • This feature request is NOT for the Android apps in the Play Store
  • I have searched the project page to check if a similar request was already made

Application or Project

libprojectM (including the playlist library)

Is Your Enhancement Related to a Problem?

No response

Your Suggested Enhancement

Currently, libprojectM requires textures used in presets to reside on the host OS filesystem. While this works fine in most usage situations, there are cases where the embedding application wants to pass in the textures or where no filesystem is accessible.

To cater for these needs, we should add a simple API callback which, if set, is called and can return the requested image data. If no callback is set or the callback doesn't return the requested data, the projectM library should still fall back to the original behavior and search the texture path (if set).

Additionally, instead of image data, the application may also provide a texture ID with the source texture.

This will allow a few scenarios like:

  • Storing textures in an application-defined archive (e.g. ZIP)
  • Loading/generating textures on-demand
  • By using a texture ID, changing the texture contents on each frame is possible, e.g. rendering videos or other external graphics into a preset
  • Using projectM in a network-only environment

Alternative Solutions

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementThe feature is considered an enhancement.

    Projects

    Status

    Todo

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions