<div dir="ltr"><div><div>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).<br><br></div>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).<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Mar 26, 2016 at 3:03 AM, Henri Verbeet <span dir="ltr"><<a href="mailto:hverbeet@gmail.com" target="_blank">hverbeet@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 25 March 2016 at 22:20, Aaryaman Vasishta <<a href="mailto:jem456.vasishta@gmail.com">jem456.vasishta@gmail.com</a>> wrote:<br>
> I wrote a quick test, and it seems that InitFromFile always returns<br>
> D3DRMERR_BADOBJECT, even after passing it an IDirect3DRMTexture created via<br>
> CreateTexture.<br>
</span>How are you creating the texture? The interesting cases are probably<br>
CoCreateInstance() and IDirect3DRM_CreateObject().<br>
</blockquote></div><br></div>