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.
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.