parsing - How can I parse through a texutre in DirectX? (IDirect3DTexture9*) -


I am trying to parse texture for two reasons: its own texture format and existing IDirect3DTtexture Manipulate data in 9 types of texture.

I'm looking at the IDirect3DTexture9 :: LockRect () function but I am unsure how it works, is * n * pBits. Is it data in D3DLOCKED_RECT texture? Does it mean that I can read it by converting it to D3XXloror or something else?

I just want to read and write in RGBA values ​​if I want to ...

In fact, it does not know where to go, any help would be appreciated!

The value of PBIT is the indicator for actual texture data when you create texture, the format of the data by you is specified.

The pitch is neurberg of the bytes in one line. It is not necessary (though usually) the width of the texture is multiplied by the number of bytes per pixel.

So if you have made D3DFMDA 32B 32G32R 32F texture, then you can use PBIT pointers like D3DXLOR pointers and color components such as array (eg color [census] etc. etc.) Use

However if it is 32-bit then you will need some structure like the following (I'm not sure if I have the right path to my components, but you can easily understand what the correct order is Is)

  struct ARGB {unsigned char A; Unsigned char r; Unsigned four grams; Unsigned four b; };  

Then you can put PBIT in an ARGb pointer and access it in the same way.

When you bring a compressed texture into it, things are a lot more complicated.


Comments