Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Direct2d timing performance

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

like image 495
Sam Avatar asked Aug 12 '26 18:08

Sam


1 Answers

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.

like image 68
Sam Avatar answered Aug 15 '26 11:08

Sam



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!