I'm trying to pass the buffer to a texture so I can draw it, the only way I found it was this:
By doing this, the game crashThe site documentation informs you that the size is width * height * 4Code:definitions(...) IDirect3DTexture9* tx; Init(...) RGetDevice()->CreateTexture(RGetScreenWidth(), RGetScreenHeight(), 1, 0, D3DFMT_A4R4G4B4, D3DPOOL_MANAGED, &tx, NULL); void(.., int width, int height, void* buffer){ D3DLOCKED_RECT d3dLockedRect; tx->LockRect(0, &d3dLockedRect, 0, 0); memcpy(d3dLockedRect.pBits, buffer, width *height* 4); tx->UnlockRect(0);}
"On Windows |buffer| will be width*height*4 bytes in size and represents a BGRA image with an upper-left origin"
Is there any way to pass the buffer to the texture?


Reply With Quote![[D3D9] buffer to texture](http://ragezone.com/hyper728.png)
Using 1024x768 resolution, with no problem, even buffer in BGRA using ARGB in texture

