We also need to determine what color formats the game can handle. The proper programming method is to read the capabilities of underlying hardware and perform tasks that make use of the hardware appropriately. We would need to determine the tasks required during conversion among pixel formats and then write an interface that would handle tasks and hide the implementation. Perform the conversion as quickly as possible, because a game can spend significant time loading all the textures and bitmaps for a scene. Ensure that the conversion works safely.
Pixel formats differ in many ways, notably the pixel depth.
Until games run in 32-bit environment, we ll be satisfied with a maximum of 32 bits per pixel. Different pixel formats also offer palletized and RGB modes, as well as modes with an alpha channel. We may want our format conversion class to be able to convert data from any format into any other format. However, it doesn t need to be that flexible, at least on the source side. When it comes to destination formats, the converter should be more flexible and able to handle most possible graphics formats.