ofRect, Opengl and Mouse click

Hello everyone.

I’m using opengl to transform a rect, like this:

ofPushMatrix();
  ofTranslate( toTranslateX, toTranslateY);
  ofPushMatrix();
     glMultMatrixf( glWarp_mat );	
     ofPushStyle();
     ofRect(0,0,100,100);
     ofPopStyle();
   ofPopMatrix();
ofPopMatrix();

And now I want to click inside that changed Rect and after it do some stuff. My point here is, I have no clue how can I detect the click inside the Rect’s area. Does anyone know?

I really appreciate your help.

Thank you for your time,
Wazhup

Hi,
Perhaps something like that ?

@lilive thank you for your reply. Gonna check this out for see if this works in my case.