For now I used CreateTexture (as the documentation suggested) another way is CreateTextureFromSurface, but that didn't work either (after passing it an off-screen plain surface).
I called IDirect3DRM3_CreateObject(d3drm3, &CLSID_CDirect3DRMTexture, NULL, &IID_IDirect3DRMTexture3, &texture3), which works, then calling InitFromFile on texture3 also returns successfully. It seems that if the image struct is not set within the object, only then InitFromFile works (as InitFromFile didn't work when called on a texture created from LoadTexture or CreateTexture, both of which initialize the image struct member).
On Sat, Mar 26, 2016 at 3:03 AM, Henri Verbeet hverbeet@gmail.com wrote:
On 25 March 2016 at 22:20, Aaryaman Vasishta jem456.vasishta@gmail.com wrote:
I wrote a quick test, and it seems that InitFromFile always returns D3DRMERR_BADOBJECT, even after passing it an IDirect3DRMTexture created
via
CreateTexture.
How are you creating the texture? The interesting cases are probably CoCreateInstance() and IDirect3DRM_CreateObject().