I am trying to implement basic collision between a moving square and some obstacles. For the objects to render I used glRectf. I have two structs to detect collisions. One placed around the car and other around the obstacles and I am sending the xmin, ymin, xmax, ymax coordinates of the obstacles into the constructor of the obstasclecollision struct and sending the xmin, ymin etc for the car to the carrcollision struct and pushing all these values to two separate vectors which store the x,y values of player and obstacles. However when checking through the vector, the xmin and ymin coordinates never change or update as the car moves. Not sure what is wrong there and how I can make it update the xmin etc in the vector.