AddDestroyCallback would be used to destroy the image struct, which will be used when InitFromFile will be implemented. Since the image here is provided by the application, there wasn't any need to use a destroy callback right now.
> Am 28.04.2016 um 20:17 schrieb Aaryaman Vasishta <jem456.vasishta@gmail.com>:
>
> + if (texture->d3drm && texture->initialized)
> + IDirect3DRM_Release(texture->d3drm);
I thought the idea was to use AddDestroyCallback instead of a flag to control the Release call. Do I remember this incorrectly, or what's the reason for going back to a flag?
Also, what's the difference between image != NULL and initialized? Or, in a later stage when you have initFromTexture or what it is called, image != NULL || ddraw_texture != NULL?
> IDirect3DRM_AddRef(texture->d3drm);
> +
> + if (texture->image)
> + return D3DRMERR_BADOBJECT;
Afair the ref leak here is intentional. If it is, I think it's worth adding a comment.