I'm using C++ and SDL2 to learn about coding by creating a clone of a 2d tile-based game I enjoy. To setup my problem; There can be multiple items dropped on a tile by the player or other entities which can overlap and be placed at any location within the tile.
All items on screen are just sdl rects with textures rendered to them however the items usually aren't squares. If multiple items are stacked on top of each other I'm not sure how to determine which item they are actually trying to select.
I can find items easily if there is only ever one in a tile or if they stay exclusively out of each others textures but with overlapping textures im stumped.
Can someone explain a method for me to determine which item the player is trying to select?