原址:http://topic.youkuaiyun.com/u/20110623/20/dd6dcc4c-a60a-4fcc-82bd-ca4882fb6fc6.html
我希望利用GPU硬件加速图形绘制,于是想到了Qt的OpenGL模块
QT Demo里的2D paintings是这么说明的
The 2D Painting example shows how QPainter and QGLWidget can be used together to display accelerated 2D graphics on supported hardware.
Demo是一个继承QWidget,一个继承QGLWidget,都是在paintEvent里用QPainter画图。
然后把Demo里的Timer去掉,在PaintScene里调animate,在animate里直接update,画的时候也是每帧固定一角度旋转,并且把Native和OpenGL的引擎分开成两个程序,以满速来测试效率。
结果很诧异的,居然Native的动画比OpenGL快多了。
自己写了一个画线的。结果Opengl是60帧,原始是600帧。。。
这个DEMO的目的不是为了说明GPU加速么?比原始的慢十倍这让人情何以堪?
求解释。
PS,显卡是9600GT, 驱动是270.51。
好吧,我错了,系统的垂直同步限制opengl到60帧,一关掉就3800帧了 =w=