ECS 36B Lecture Notes - Lecture 10: Ncurses
ECS 36B verified notes
10/26View all
Document Summary
It"s a terminal handling library typically used under unix and windows. Allows you to write to any location on the screen. Treats the terminal like a 2d array of characters which you write to. Have to modify the cmakelists. txt file to include for curses functionality. Echo() -- whatever you type appears on screen. Moves the cursor to position (row, column) All of the write functions will translate your input to a virtual screen. Refresh() -- allows the virtual screen to be displayed on the actual screen. Stdscr represents the entire screen and often times it is better to split this into different parts depending on desired functionality. In a game, may want one area for user input, one to display actions, and one to display stats. Newwin command creates a new virtual screen window. Subwin and derwin commands use the parent window. Writing functions take the same arguments as stdscr except for the extra slot to specify window.