Home > other >  Strange question Dx9 texture.
Strange question Dx9 texture.

Time:09-24

There is a 79 x 117 pixels figure

Width=79;
Height=117;

D3DXCreateTexture (pD3DDevice, width, height,
1,//Mip levels
0,//the Usage
D3DFMT_A1R5G5B5,//the Format
D3DPOOL_MANAGED,//the Memory pool
& PTex))

Create after use
PTex - & gt; GetLevelDesc (0, & amp; TDesc)
TDesc. The Width of 79

But after lockrect PLTCH of 160

Problem a, D3DXCreateTexture automatically optimize, isn't it? Width and height should not be optimized to 128? If MipLevels there automatically optimize written 0 to 128, but 2 d games, don't need a MIP,

Question 2, when lockrect PLTCH for 160, and then press line fill pixels, my machine display images correctly, but in a virtual machine with XP system, the graphics image is not correct, each pixel difference 2 BYTE that dislocation, change pitch to 79 * 2 virtual machine is no problem, but the dislocation in my machine, what is the great god master problem excuse me?
  • Related