Advertisement Jump to content
Sign in to follow this  
Super Llama

[d3d9/win7] can't seem to create a shared texture resource?

This topic is 1903 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm trying to create a shared texture from a Direct3D 9 device using the pSharedHandle parameter that supposedly works starting with windows vista-- but no matter what I put in the parameters it always just returns an invalid call. I'm intending to share it with another device in another thread, but I can't even get the initial creation of the shared resource to work.

 
ddev->CreateTexture(width, height, 1, 0, D3DFMT_X8R8G8B8, D3DPOOL_DEFAULT, &tex, &handle);
 
I've tried changing pretty much all the parameters but if I pass it a &handle it always fails. The handle is pointing to a NULL value. I've been unable to find a lot of information about the texture sharing API, but everything I find says this should work. I'm compiling with the headers/libraries both from the Windows 7 SDK and the June 2010 DX SDK, and I'm able to see and instantiate D3D9Ex classes, so it's definitely a new enough version. The device is perfectly able to create the texture if I don't specify a handle, so I'm guessing I must not be fulfilling one of the restrictions for shared textures that microsoft barely told anyone about. MSDN is not helping very much, all it says is that I have to use D3DPOOL_DEFAULT, which I am.
 
Any ideas? I'll keep messing with the parameters while I wait for an answer.
 
EDIT: Well, I got it to create the handle by changing all the DirectX9 objects to DirectX9Ex objects, but this is not ideal and if there's still a way to do it with ordinary D3D9 interfaces, that would be preferable.
Edited by Super Llama

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!