Original Post
I have the following code: IDirect3DTexture9* texture=0; NLogFile *lf=NLogFile::getInstance(); D3DLOCKED_RECT r; D3DXCreateTextureFromFile(EngineStatics::GetDevice(), filename, &texture); texture->LockRect(0, &r, 0, D3DLOCK_DISCARD); char* pr=(char*)r.pBits; while(pr!=0) { //Insert code for storing the pixel value here pr++; } My problem is that the loop never ends. Am I using the wrong terminate condition? Or am I incrementing the pointer incorrectly? Right now, I'm using the char* value as the pointer. Is this the correct type for reading in the pixel values for a bmp? Or is there a better way to do it? I'm using a grayscale bmp. Thanks. -Nick