I have a dynamic plugin where I’m creating an L16 texture, like so:
return new Texture(device, texW, texH, 1, Usage.None, Format.L16, Pool.Managed);
This does not work with /dx9ex, as noted in another thread, and no texture is created. That thread say to change “Pool.Managed” needs to “Pool.Default”. When I do that:
return new Texture(device, texW, texH, 1, Usage.None, Format.L16, Pool.Default);
The texture gets created, but I only get a black texture out. Here’s how it’s being filled:
unsafe protected override void UpdateTexture(int Slice, Texture texture)
{
FCurrentSlice = Slice;
var rect = texture.LockRectangle(0, LockFlags.Discard).Data;
rect.WriteRange(bitmapptr, texH * texW * 2);
texture.UnlockRectangle(0);
}
I looked at TextureUtils.CreateTexture, but can’t see how to make an L16. Any ideas? Thanks!