ncurses clear()不是差别(ncurses clear() is not differential)

编程入门 行业动态 更新时间:2024-10-22 16:25:11
ncurses clear()不是差别(ncurses clear() is not differential)

我注意到函数clear()将所有屏幕重新传输到终端而不是仅传输差异,例如ncurses除外。

我正在使用SSH,所以我可以在180x60终端上看到差异:

清除使用clear():20kB / s 没有清除:200B / s

刷新率为0.5秒,每帧之间的差异约为20个字符。

我们如何更有效地解释这个并清除屏幕?

I noticed that function clear() retransmit all screen to terminal instead of transmitting only the differences, as excepted with ncurses.

I'm working with SSH so I can see the difference on a 180x60 terminal :

with clearing using clear() : 20kB/s without clearing : 200B/s

The refresh rate is 0.5s and the differences between each frame is about 20 characters.

How can we explain this and clear screen more efficiently ?

最满意答案

从手册页:

明确和清晰的例程就像擦除和删除,但它们也调用clearok,以便在下次调用该窗口的wrefresh时完全清除屏幕并从头开始重新绘制。

尝试erase()

From the man page:

The clear and wclear routines are like erase and werase, but they also call clearok, so that the screen is cleared completely on the next call to wrefresh for that window and repainted from scratch.

Try erase()

更多推荐

本文发布于:2023-04-27 15:59:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1327169.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:差别   ncurses   clear   differential

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!