DrawTarget & implementation from IUpdate

Jun 23, 2010 at 3:27 PM

Why DrawTargetToScreen/ DrawTarget don´t implement IUpdate? Is this a design-error?

 

Coordinator
Jun 23, 2010 at 5:03 PM

No.

Drawing occurs in the main Draw / Frame loop, rendering as fast as the graphics card can manage. Whereas updating occurs within the Update loop at user defined frequencies.
The update loop occurs before the draw loop.

This is intentional, so that calling the main Draw() methods for a DrawTarget is very explicit. Otherwise you have to do nasty things like draw order sorting.

Jun 24, 2010 at 10:16 AM

Thank you very much for the information. I understand it now. But i understand not why draw can be faster than update. (e.g. inputquery, whe draw=120 fps and update 60 fps)

 

Coordinator
Jun 24, 2010 at 10:45 AM

If you disable vsync, then draw can be faster than 60hz. However, by default vsync is enabled - so Draw cannot be faster than 60hz.

For this reasons, disabling vsync isn't very common.