title: Help with object from mouse algorithm
body: <p>I wasn't sure what to call this. I'm building a tile based game where the user can click on a tile.
  it is a 2d c++ vector of tiles. right now I have an algorithm that positions them like this:</p>
  
  <pre><code>[][][][][][][][][][][]
  [][][][][][][][][][][]
  [][][][][][][][][][][]
  [][][][][][][][][][][]
  [][][][][][][][][][][]
  [][][][][][][][][][][]
  </code></pre>
  
  <p>they are positioned based on their size and my tile class holds each of their x and y coordinates, and I have 2 variables for the height and width.</p>
  
  <p>Basically I'd like to find an algorithm that can return the tile my mouse is on based on the mouse's position.</p>
  
  <p>For example: if my mouse (relative to the game window)'s position is 37,0 and each of my tiles is 10 * 10 in size and they are each tilewidth apart then by having my mouse over 37,0 it should return (4,1) meaning the 4th element on the x and the first element on the y. I thought about doing bounding box checks against each rectangle but I think that will use up too much cpu if i check 60 times / second. </p>
  
  <p>Thanks</p>