我目前正在编写和应用程序来测试人类的视觉。就目前的程序而言,我使用 VB.Net 和 DirectX 9 在屏幕上按需呈现刺激。按需我只是指包含用于绘制刺激的代码并具有 device.present 调用的 renderscene 方法不存在于一个单独的线程中,该线程会尽可能地不断绘制帧。每当我需要更改刺激时,我只需调用 renderscene 方法,该刺激不超过每秒一次,通常甚至更少。这被认为是不好的形式吗?我在弄清楚如何处理 DeviceLostExceptions 时遇到了一些麻烦(例如在 alt-Tab 或 ctrl-alt-delete 之后),因为我发现的大多数示例代码都假设程序不断地渲染场景。笔记:
问问题
126 次
1 回答
1
There is nothing wrong with this approach per se.
It is simply unusual because DirectX is usually used for games, and in games, you generally need to redraw the scene constantly, as fast as possible, no matter what. (things are typically always moving on the screen, and the game has to be as responsive as possible).
But if you don't need this responsiveness, and if your scene is mostly static, then there's nothing wrong with rendering only when the contents to be rendered change.
于 2012-09-13T13:17:53.113 回答