The are a few different ways you can get potentially get surround sound working with PC games using your receiver, though not all of them involve Dolby Digital or DTS. Many PC games support surround sound, but only a very few are capable of outputting Dolby Digital or DTS themselves. There are three ways you can potentially connect your PC to your receiver and get surround sound in a wide range of games: using analogue audio cables, using on-the-fly Dolby Digital/DTS encoding, or using HDMI.
Analogue Audio Cables
My first recommendation would be to check to see if your receiver has an analogue multi-channel input. This is fairly common in older AV receivers, and very uncommon in newer ones. If so you can get surround sound by connecting the multi-channel analogue audio output jacks at the back of your PC to the multi-channel input of your receiver. Not all PCs have will have these jacks but most do. This pretty much the superior option for getting surround sound in games. It has the least compatibility problems, and unlike it Dolby Digital and DTS it's not lossly compressed so the sound quality will actually be higher.
Dolby Digital Live or DTS Connect
The next thing I would check is to see if your motherboard (or sound card) supports Dolby Digital Live or DTS Connect (both sometimes given other names). If so then the drivers for your audio device are capable of converting the surround sound from game into Dolby Digital or DTS on the fly. If you have one of the few motherboards (or one of the many sound cards) that support this all you would need to do then is go into the your audio options and enable it. If not then it's possible to buy an add-in sound card that does.
The last possibility is to use HDMI. Your receiver would need to have an HDMI input and your PC would need to have an HDMI output that supports audio. This true for pretty much all receivers sold in the last 10 years, and most PCs in the last 5 years or so. This option is a bit of pain however, as HDMI won't carry audio without video, so you have to actually display something on the HDMI output. You can either connect your monitor through the receiver, duplicate your desktop to the receiver, or extend your desktop to the receiver. The first two options will probably limit your display's resolution to 1920x1080 or lower (though that's not a problem if your monitor is that resolution or less). The last option won't restrict your monitor's resolution, but it will cause your mouse cursor to get lost from time to time on a display you can't see.
Relying on Game Support
If none of these options will work for you then your stuck with whatever surround sound encoding solution the game supports, and most PC games don't support any. They rely on Windows and audio drivers handling this for them using one of the above solutions.
Games capable of outputting Dolby Digital or DTS themselves are very rare. Providing surround sound support in these formats would require paying money to Dolby or DTS for something that won't work over the analogue audio connections most PCs have traditionally used. The few PC games do support it are likely only going to support it with pre-encoded Dolby Digital or DTS soundtracks during cutscenes. Encoding Dolby Digital or DTS on the fly means paying an even bigger licence fee for an encoder.
The one game I can point to that's supposed to support Dolby Digital is Star Wars Battlefront II. Unfortunately I can't get it to output audio in that format, as it appears the game's support for Dolby Digital doesn't work with Windows 7. That's the other problem with supporting these formats, Windows doesn't make it easy to send encoded audio out a digital audio (SPDIF) jack.
Generic Matrix Surround
A more commonly supported option is some form a surround sound matrixing derived from Dolby Surround/ProLogic. Since the patents on that expired long ago and it works over stereo analogue audio cables this sometimes gets supported by games, though more likely in older games. If a game has a "surround" audio output option, it could mean that it supports matrix surround and will work with your receiver (over digital or analogue audio cables) in Dolby ProLogic mode.