@@ -100,12 +100,16 @@ PROJECTM_EXPORT void projectm_set_preset_switch_failed_event_callback(projectm_h
100100 * If neither is provided (data is NULL and texture_id is 0), projectM will
101101 * attempt to load the texture from the filesystem.
102102 *
103+ * @warning When providing a texture_id, projectM takes ownership of the OpenGL texture
104+ * and will delete it (via glDeleteTextures) when it is no longer needed. Do not
105+ * delete the texture yourself or reuse the texture ID after passing it here.
106+ *
103107 * @since 4.2.0
104108 */
105109typedef struct projectm_texture_load_data {
106- const unsigned char * data ; /**< Pointer to raw pixel data (RGBA/RGB format, bottom-to-top ). Can be NULL. */
107- unsigned int width ; /**< Width of the texture in pixels. */
108- unsigned int height ; /**< Height of the texture in pixels. */
110+ const unsigned char * data ; /**< Pointer to raw pixel data in standard OpenGL format (first row is bottom of image ). Can be NULL. */
111+ unsigned int width ; /**< Width of the texture in pixels. Must be > 0 when providing data or texture_id. */
112+ unsigned int height ; /**< Height of the texture in pixels. Must be > 0 when providing data or texture_id. */
109113 unsigned int channels ; /**< Number of color channels (3 for RGB, 4 for RGBA). */
110114 unsigned int texture_id ; /**< An existing OpenGL texture ID to use. Set to 0 if not used. */
111115} projectm_texture_load_data ;
@@ -129,6 +133,8 @@ typedef struct projectm_texture_load_data {
129133 * it needs to be retained for later use.
130134 * @note If providing raw pixel data, the data pointer must remain valid until
131135 * projectM has finished processing it (i.e., until the callback returns).
136+ * @note This callback is always invoked from the same thread that calls projectM
137+ * rendering functions. No additional synchronization is required.
132138 *
133139 * @param texture_name The name of the texture being requested, as used in the preset.
134140 * @param[out] data Pointer to a structure where the application should place texture data.
0 commit comments