Texturepacker sdl
When the electron gun has finished drawing one frame, its aim will be positioned at the bottom-right corner of the CRT. It then repositions its aim so it can start all the way at the start of the subsequent scan line, repeating this process until all scan lines have been drawn. This gun starts drawing in the top-left corner of the screen and shifts its aim across horizontally to draw the first scan line (see Figure 2.1). In a CRT, all of the drawing is done by an electron gun that fires a narrow stream of electrons. The (0,0) pixel usually refers to the top-left corner, though not all displays follow this format. For instance, a 300×200 display would have 200 total rows, or scan lines, and each scan line would have 300 pixels, for a grand total of 60,000 pixels. The resolution of the display determines the total number of pixels. For a color display, each pixel contains a red, green, and blue sub-pixel, which can then be combined to create specific colors. A CRT features an array of picture elements known as pixels. Even though we now almost exclusively use LCD or plasma displays, many of the rendering concepts that were originally developed with older monitors in mind are still in use today.įor many years, cathode ray tube (CRT) displays were the predominant display technology. To fully understand 2D rendering, it is important to understand the limitations of display devices when these techniques were first developed. It also should be noted that many of the topics covered in latter chapters, whether physics, sound, or UI programming, are equally applicable in both 2D and 3D games. Though the primary focus of this book is on 3D games, it would be a mistake not to cover the core concepts behind 2D graphics. Gamers are drawn toward 2D because of the purity and simplicity of the games. Developers are drawn to 2D because the typical budget and team can be much smaller. With the explosion of web, smartphone, and indie games, 2D has had a renaissance of sorts. Game Programming Algorithms and Techniques: A Platform-Agnostic Approach (2014) Chapter 2.