The basic4 sample program utilizes the functions explained in this chapter to implement an application with a simple menu.
The program has two modes: the menu mode and the animation mode. The program runs in menu mode when the static variable IsMenuMode in the Draw function of graphic.c is set to 1. When this variable is set to 0, the program runs in animation mode.
A variety of debug console functions are utilized to display the menu in this sample program, so if you want to see an example of actual usage of the debug console, we recommend you look through graphic.c. The basic4 sample program also contains a routine for Controller input. The process is not very difficult, so you should be able to comprehend things by reading the sample source. To learn more about the Controller, see the relevant chapter in the Device Tutorial. This chapter's sample program is written not only to draw rectangles, but also to display the debug console and the performance meter. Ultimately, it is the Draw function in graphic.c that instructs NuSystem to render these.
|List 4-1 See basic4 "graphic.c"|
Important here is that the last argument in both nuGfxTaskStart and nuDebConDisp is NU_SC_NOSWAPBUFFER. If you do not suppress swapping with this argument, then the framebuffer will be swapped when the rendering of the rectangle or the debug console has been completed. As a result, when you call nuDebTaskPerfBar1, the performance meter will be displayed in a different framebuffer than the rectangle or the debug console.