如何优化绘图例程以在Windows CE中实现最大刷新率? [英] How can drawing routines be optimized to achieve the maximum refresh rate in Windows CE?

查看:216
本文介绍了如何优化绘图例程以在Windows CE中实现最大刷新率?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序中,我绘制一些线(如垂直图),刷新率将在30秒左右。我已经计算了性能,它花了400毫秒来绘制完整的线,但这不会够快,因为我们必须刷新屏幕每34毫秒。

In my application i am drawing some set of lines (like a vertical graph), and the refresh rate will be around 30 times in a second. I have calculated the performance and it is taking 400 milliseconds to draw complete lines, but this won't be fast enough since we have to refresh the screen every 34 milliseconds.

我在使用CDC。

我们将使用带有400MHz处理器的Windows CE设备。绘图涉及简单的MFC API,例如 MoveTo LineTo FillRect ,等等在DC视图:

We will be drawing on a Windows CE device with a 400 MHz processor. Drawing involves the simple MFC APIs like MoveTo, LineTo, FillRect, etc. on DC of View:

CDC* pDC = GetDC(); //draw vertical line from one end of screen to the other 
pDC->MoveTo(some xy Cordinates);
pDC->LineTo(some xy Points);

我们如何优化绘图程序?

How we can optimize the drawing routines? Please suggest any pointers.

推荐答案

从Windows Vista开始,GDI操作(BitBlt除外)不再是硬件加速,软件。

Since Windows Vista, GDI operations (other than BitBlt) are no longer hardware accelerated, but done in software.

为了获得所需的性能,您可能需要使用Direct3D或OpenGl。

To get the performance you need, you probably need to use Direct3D or OpenGl.

此msdn文档意味着,由于NT 6.1,hw加速的GDI又回到了桌子上。仍然我期望OpenGL和D3D提供的基于矢量的API应该执行更可靠 - GDI线条画不是驱动程序作者努力优化。

All though this msdn document implies that, since NT 6.1, hw acceleration of GDI is back on the table. Still I expect the vector based APIs offered by OpenGL and D3D should perform far more reliably - GDI line drawing is not something driver writers strive to optimize.

在回答Windows CE是目标的更新时: Direct X 显然是在Windows CE上可用的,因为至少CE 2.1

In answer to the update re Windows CE being the target: Direct X has apparently been available on Windows CE since at least CE 2.1

Im仍然在押注GDI在CE上不是特别加速;如果有任何hw支持,DirectX将是访问它的方式。

Im still betting that GDI is not particularly hw accelerated on CE; if there is any hw support at all, DirectX would be the way to access it.

这篇关于如何优化绘图例程以在Windows CE中实现最大刷新率?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆