-1

I am looking for a way to create a "buffer" which I can directly copy, or blit, onto a WINDOW* using ncurses. I know there are subwindows, but since the only way to move/ resize them is to create a whole new subwindow, they are not a great fit. I'm looking for something like Microsoft's WriteConsoleOutput.

Would be nice if I could also copy regions, in a reverse-blit fashion (take rect of stdscr and store a copy in a buffer)

AlgoRythm
  • 1,196
  • 10
  • 31

1 Answers1

0

windows can in fact be moved or resized without re-creating them:

mvwin

Calling mvwin moves the window so that the upper left-hand corner is at position (x, y). If the move would cause the window to be off the is allowed, but should be avoided.

wresize

This is an extension to the curses library. It reallocates storage for an ncurses window to adjust its dimensions to the specified values. If either dimension is larger than the current values, the window's data is filled with blanks that have the current background rendition (as set by wbkgdset) merged into them.

This extension of ncurses was introduced in mid-1995. It was adopted in NetBSD curses (2001) and PDCurses (2003).

Regarding the question, updates to a window are based on lines (see waddchnstr for instance).

Thomas Dickey
  • 51,086
  • 7
  • 70
  • 105
  • I believe I am looking for a combination of the `newpad` function and the `copywin` function, after some additional research. – AlgoRythm Feb 15 '20 at 03:34