Make a texture a clickable Button What would be the best way to make a texture a clickable button? Suppose I have a Room (respresented by a 2D texture), where there are buttons. 

Would I in the main loop:


check when the mouse is clicked if it is in any region of a button? ($\mathcal{O}(n_{Button})$)
Do something entirely different that I can't think of?


I may be overthinking this, maybe this isn't a problem at all, but somehow, what I came up with sounds way to "stupid" to me to be the right solution. It sounds like a hack to me, but maybe this is the way to do it? In 3D Games, would the check than be just radial coordinates ($r,\phi,\theta$)?
In games and other 3D scenes, generally when the user clicks the mouse, a ray is cast into the scene in the direction the camera is facing, and a check is done to see what geometry in the scene it intersects. If it intersects nothing, it is ignored. If it intersects a single object, then the application processes a click on that object (at the location of the intersection). If more than one object is intersected, then usually the front-most object is assumed to be the on the user wanted to click on, so that is processed.

In general, geometry is stored using x,y,z coordinates rather than spherical coordinates, as the GPU hardware works in cartesian coordinates.