Reputation: 41
I am just starting to learn direct2d. I have written a test application in which the drawing part is basically empty, just a call to m_pRenderTarget->BeginDraw()
followed by a call to m_pRenderTarget->EndDraw()
. I made some timing measurement between the call to BeginDraw() and EndDraw() and found out that it takes about 16ms. I tried on Window 7 64bit and Windows 10 and had similar results. I am surprised with such slow performance. Is this timing value something expected or am I doing something wrong?
Thanks for your help, Sam
Upvotes: 3
Views: 234
Reputation: 41
There was no issue -- as Dai pointed out, 16ms is 1/60th of a second, so the elapsed time between Begin and EndDraw should indeed be 16ms. In fact, if you check it using Ticks, you'll get around 166666 elapsed Ticks. My system runs at 120Hz, so when run here, I get around 8ms or 83333 Ticks.
Upvotes: 1
Reputation: 41
Thank you very much Dai for gearing me to the right direction. I found the issue, it was the "present" option of D2D1_HWND_RENDER_TARGET_PROPERTIES that was set to D2D1_PRESENT_OPTIONS_NONE, I changed it to D2D1_PRESENT_OPTIONS_IMMEDIATELY and got much better timing performance.
Upvotes: 1