• Advertisement
Sign in to follow this  

SlimDX RenderTarget Texture???

This topic is 3311 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