QA


Q&A

Q1:

Why isn't the Bitmap class in this hour more flexible in supporting other image types?

A1:

There are two reasons for the Bitmap class being limited in its support for image types. The first reason has to do with coding simplicity ”it takes considerably more complex code to handle multiple image types. Because the goal of this book is to get you creating games with minimal distractions, keeping the Bitmap class as simple as possible is extremely important. The second reason has to do with performance ”using an image format with fewer colors results in faster games. This is because less colors results in less information being transferred when an image is drawn to a device context, which means speedier draws. Performance is a critical factor in virtually all games, so sacrificing zillions of colors in favor of a smoother and quicker game is usually worth the trade-off.

Q2:

What's the purpose of the third Create() method in the Bitmap class?

A2:

The third Create() method in the Bitmap class is used to create a blank bitmap in a solid color , which might not seem very useful at first. However, later on in the book, you'll find out how bitmaps don't always originate with bitmap files or resources. Besides, you might want to create a bitmap as a background for a game that gets customized specifically for the game. For example, consider a space background with several planets. You might create a solid black bitmap and then draw the planets on top of it.



Sams Teach Yourself Game Programming in 24 Hours
Sams Teach Yourself Game Programming in 24 Hours
ISBN: 067232461X
EAN: 2147483647
Year: 2002
Pages: 271

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net