c - 在 GTK3 中在屏幕上绘制自定义内容的替代方法?
问题描述
我只知道一种在屏幕上绘制自定义内容的方法 - GTKDrawArea using Cairo
这就是我所做的: 除了每秒完全重绘屏幕 60 次之外,还有其他方法可以归档这样的东西吗?如果没有,是否存在优化选项(例如使用图层,因此不会在每帧重绘网格或一次渲染整个方案然后将其移动)?
编辑:我忘了提到 GtkGlArea,但在这个应用程序中使用起来非常困难,所以我认为它不合适。
解决方案
That's a very wide question, I'll have a go.
You can use GtkGLArea, that allows you to render using OpenGL which can be more low-level and thus faster than going through Cairo. It does of course make you do a lot more work.
You can also create an off-screen image and render the entire schematic to that, then just copy a suitable rectangle to match the current scroll location, that can probably be faster than doing lots of drawing.
推荐阅读
- javascript - 不能在函数中使用传递对象的方法
- sql - 在 informatica 目标平面文件的输出底部添加总行
- install4j - createbundle 因 `file.parentFile must not be null` 而失败
- javascript - 如何将时钟功能添加到 LED 定时器
- database - Flutter -> UploadTask 方法 OnComplete 不存在
- ios - 在 App-Developer 帐户中更改 App-Icon,然后再重新发布
- python - 使用 BeautifulSoup 抓取 Google 搜索结果描述
- linux - 使用 FIND & EXEC 在多个文件上执行需要文件名的 Perl 脚本
- r - 如何在R中用男性和女性替换1和0?
- sql - Oracle查询将多级多对多关系分组为独立组