Issue
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
Solution
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.
Answered By – Sam
Answer Checked By – Pedro (BugsFixing Volunteer)