Switching Modes While RunningAh, we finally get to switching modes… Well, we'll use a single function to switch modes. It'll be capable of changing between exclusive and windowed, and setting the display mode (while in exclusive mode). Here it is:
Kind of simple, isn't it? No, well…I'll explain it a little. When you want to switch from exclusive mode to windowed mode, you call it like this:
When you want to switch to exclusive mode, or just change between resolutions and color depths, you call it like this:
Not bad, huh? Ok, let's flesh it out a little. Here's the whole function:
That's it for switching modes! There are lots of ways to wring more performance out of a windowed mode DirectX app. There are also a few ways to make it easier for the end user to use. We'll try to achieve a blend of both. You'll have to wait for the next article for those tips though! Good Luck! - null_pointer
|