Thanks for that, I get a better idea of how I'm going to do this now. It makes sense if I do the check when the mouse is down, and that code will be helpful.
Now I only have one more problem, getting the location of an object after a transform. In GDI/GDI+, was there some way to get the position of something after a transform? Because as far as my program knows, it hasn't moved.
Here's what I mean.
//find the angle to rotate by using the mouse position relative to where the rotation will occurangle=atan2((mousePos.y-200.0f),(mousePos.x-250.0f))* 57.29f;//rotate the render target by the angleRT->SetTransform(D2D1::Matrix3x2F::Rotation(angle, D2D1::Point2F(250.0f, 200.0f)));//draw the line from 250,200 to 250,50 on the rotated render targetRT->DrawLine(D2D1::Point2F(250, 200),D2D1::Point2F(250, 50),Black, 12.0, Strokestyle);
My program will always see the line as being from 250,200 to 250,50 while I see it rotated to be facing towards to mouse. I know it'll start at 250,200 to 250,50 but after I've rotated it how will I know it's new position?
EDIT: For the actual hit testing I found this function on MSDN, ID2D1Geometry::FillContainsPoint pretty self explanatory.
Should work for the normal hit testing, may also fix my transform problem but if not I still need to find out how. I'll reply later saying if it fixes it or not.
[Edited by - Waterfox on December 28, 2009 5:37:07 AM]