BITMAP* tex[10];
int& pixel(BITMAP* bmp, int x, int y)
{
return ((int**)(bmp->line))[y][x];
}
but what's the syntax for this in DirectX?
BITMAP* tex[10];
int& pixel(BITMAP* bmp, int x, int y)
{
return ((int**)(bmp->line))[y][x];
}
You need to call Map() on the texture to get access to the texture data. Don't forget to call Unmap() afterwards. You will have had to create the texture with the proper flags to be able to write to the texture.
ID3D10Texture2D
[in] UINT Level,
[out] D3DLOCKED_RECT *pLockedRect,
[in] const RECT *pRect,
[in] DWORD Flags
the OP did tag the question as [D3D9].
Since this hasn't been asked yet, I'll go ahead and bite the bullet: What Are You Doing, Really? Any time the subject of CPU readbacks come up, there's like a 90% chance a better way to do what you're trying to accomplish exists.
[quote name='InvalidPointer' timestamp='1338516602' post='4945166']
Since this hasn't been asked yet, I'll go ahead and bite the bullet: What Are You Doing, Really? Any time the subject of CPU readbacks come up, there's like a 90% chance a better way to do what you're trying to accomplish exists.
The client really should be the one generating this stuff, sending actual assets over the network isn't the best use of bandwidth (of course, maybe you have something different in mind, but from what you said it sounds like an overly complicated method to do things)