16.1 2D Games and Images


16.1 2D Games and Images

Most typical computer games create a game window, and the details for doing this were demonstrated in the previous chapter. The game window is a standard window that can be full-screen or less; its purpose is to be a canvas upon which graphical data is drawn. Graphics are usually drawn onto the canvas in one large batch by the graphics card, and each time this process occurs it is said to be a frame.In order to maintain some smoothness and consistency between each frame to the human eye, frames need to occur many times per second. It is the job of the rendering loop to ensure this happens.

Naturally, one of the first tasks any game programmer has when setting out to create a game is to determine how to display elements such as fill colors and images on the screen. The previous chapter examined how the screen can be filled with a solid color. However, it is useful to display more complex data too; specifically, images from files such as JPEGs, TGAs, or PNGs. The next section examines this process.




Introduction to Game Programming with C++
Introduction to Game Programming with C++ (Wordware Game Developers Library)
ISBN: 1598220322
EAN: 2147483647
Year: 2007
Pages: 225
Authors: Alan Thorn

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