Is it ok to use directX for on demand rendering instead of rendering continually in a loop

I am currently writing and application to test human vision. As the program currently stands I am I using VB.Net and DirectX 9 to present a stimulus on the screen on demand. By on demand I simply mean that the renderscene method that contains the code to draw the stimulus and has the device.present call does not exist in a separate thread that constantly draws a frame whenever it can. I just call the renderscene method whenever I need to change the stimulus which is no more then about once a sec and usually even less. Is this considered bad form? I am having some trouble figuring out how to handle DeviceLostExceptions (for example after an alt-Tab or ctrl-alt-delete) because most of the example code I have found assumes program is continually rendering the scene. NOTE: I know DX for managed code is depreciated and I plan on rewriting the display code with slimdx when I get the chance.

Answers


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.


Need Your Help

In Highcharts Make tooltip of a specific point always visible and dynamically i will change its point

javascript jquery highcharts

i have created a line chart and make tooltip visible at particular point by this code

Get Attribute from Dynamically generated Class

c# c#-4.0

I have run in to a little bit of a problem which is not solved by the generally available solutions to seemingly the same problem.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.