Jump to content
  • Advertisement
Sign in to follow this  
devronious

SlimDX RenderTarget Texture???

This topic is 3558 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 can't lock a rendertarget texture in SlimDX created with Texture() ctor. The surfaces crash when I lock them. If I create a surface via the RenderTarget specific creator method then it works. But then its a surface, not a texture and later I need to draw with it. Is there a way?

Share this post


Link to post
Share on other sites
Advertisement
I don't know the SlimDX equivalents of the constants, but textures created in D3DPOOL_DEFAULT are only lockable if you specify D3DUSAGE_DYNAMIC.

Also, be aware that you should check the device caps to make sure that it supports dynamic textures before you try creating one.

Share this post


Link to post
Share on other sites
If I do this it works:

SlimDX.Direct3D9.Surface.CreateRenderTarget(
dev,
image.Width,
image.Height,
format,
MultisampleType.None,
0,
true);

But if I do this it locks up when I lock it:
tex = new SlimDX.Direct3D9.Texture(
dev,
image.Width,
image.Height,
0,
Usage.RenderTarget | Usage.Dynamic,
format,
Pool.Default);

Help!

Share this post


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

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!