title: SDL2 window resize mouse position
body: <p>How do i make so that positions adapts to the new window position when i resize my window in SDL2 and with SDL_RenderSetLogicalSize?</p>
  
  <p>I want to be able to hover a text and make it change color but whenever i resize the window its still in the same window cords. Is there a way to adapt the mouse?</p>
  
  <pre><code>void MainMenu::CheckHover()
  {
      for (std::list&lt;MenuItem&gt;::iterator it = menuItems.begin(); it != menuItems.end(); it++)
      {
          Text* text = (*it).text;
          float Left = text-&gt;GetX();
          float Right = text-&gt;GetX() + text-&gt;GetWidth();
          float Top = text-&gt;GetY();
          float Bottom = text-&gt;GetY() + text-&gt;GetHeight();
  
          if (mouseX &lt; Left ||
              mouseX &gt; Right ||
              mouseY &lt; Top ||
              mouseY &gt; Bottom)
          {
              //hover = false
              text-&gt;SetTextColor(255, 255, 255);
          }
          else
          {
              //hover = true
              text-&gt;SetTextColor(100, 100, 100);
          }
      }
  }
  </code></pre>