Below is the source for vsyncCallback, the basic2 rendering callback function that was just registered. As you can see, this function does nothing itself, but relies on a function called Draw to complete the tasks.
List 2-4 See basic2 "main.c" | |
|
The Draw function directly writes values to the framebuffer holding the video output image, and prepares the image for output. Since the same value is written to all pixels, the screen output is a single color. However, the color changes as time passes. More specifically, since the RGB intensity value is provided by the unsigned char type variable, col, (appropriately multiplied), the screen color gradually changes in proportion to the increase in col.
List 2-5 See basic2 "graphic.c" | |
|
The other processes performed by the Draw function will be explained in a later chapter.