Original Post
Hi guys, I am working on a simple editor for my game. It gives the possibility to select an object and move it around the emviroment. I want to be able to select the object with the mouse, and that is why I simply check if after a WM_LBUTTONDOWN, the coordinates of the mouse are inside a bounding rect for my object. The problem is that it apears that the bounding rects are not where I would expect them to be. I calculate the bounding rects like this: m_Sprite is a LPD3DXSPRITE. If I try to draw the the bounding rectangle (r), using: 
Anybody has any idea why this is happening? [Edited by - Overdrive on April 22, 2008 7:20:26 AM]
RECT r;
D3DSURFACE_DESC dsc;
m_pTexture->GetLevelDesc(0, &dsc);
r.top = (LONG) m_pos.y;
r.left = (LONG) m_pos.x;
r.right = (LONG)r.left + dsc.Width;
r.bottom = (LONG)r.top + dsc.Height;
m_pos is a 3D vector that is used in the renderer like this:
v = (*it)->GetPosition();
m_Sprite->Draw((*it)->GetTexture(), NULL, NULL, (v), D3DCOLOR_XRGB(255, 255, 255));
it = iterator used to go trough an vector
RECT rect = gStaticObjects->GetBoundingRect();
Rectangle(hDC, rect.left, rect.top, rect.right, rect.bottom);
Something very strange happens.The image is like this: 
Anybody has any idea why this is happening? [Edited by - Overdrive on April 22, 2008 7:20:26 AM]