First off, you shouldn't eat anything significant within an hour of playing.
I rarely pay attention to the food I eat the day before I am going to play, but I do think about it. Meals high in complex carbs are good, but I am not so sure that matters so much the day before? Either way, for tennis players (most athletes, I would imagine), carbs are what it's all about. Carbohydrates are the fuel for our muscles. Without them, you're not going to be able to do much.
I eat something 2 hours before I play. Pasta's are always good, bagels, wheat bread, peanut butter, and things like that are great. I play tennis so often I don't pay much attention to it, I just have a significant meal a couple of hours before I play. I never eat meat or anything that is hard to digest the day I am going to play. You have to figure out what works for yourself. If you can eat an hour before playing and be fine, go for it. If you feel sick if you eat within 3 hours of playing, you've got to make the adjustment.
Someone I play with goes to McDonalds and eats a few minutes before hitting the court. He is usually complaining about it for the first hour or so of play. I am pretty sure it is never a good idea to eat right before play.
30 minutes before I play, if I am hungry, I have a banana (best choice), a few crackers or something else very light. At this time I drink of Gatorade (that I make myself). I don't measure the amount, just take a couple big drinks. Make sure you've kept yourself hydrated the whole day leading up to your play, or the night before. Pay attention to your salt (sodium) intake during the day.
Then I get to the court and every chance I get I drink water. I also have more of my Gatorade mix that I drink while I play. Drink when you're not thirsty. That is the best tip I've ever heard. I usually eat an energy bar or crackers or something while I am playing. Sometimes I do it because of boredom while playing doubles, sometimes I just get hungry. Bananas are good to eat during play because they digest faster than most other foods and they contain all kinds of good stuff for people running around. Again, you've got to figure out what works for yourself.
After I play I eat a meal with carbs and protein... Chocolate milk is supposedly a great recovery food because of the ratio of carbs to protein (3:1). I like Honey Bunches of Oats cereal and usually eat a ton of that as soon as I get home, that stuff is delicious. If I've played far away from my house, I eat some tasty energy (protein) bars that are in my bag. They are pretty much just candy, but I am addicted to the Snickers Marathon bars.