How can I provide another Direct2D rendering object?

I am using Direct2D in C # to render a small gui framework for my research project. I'm not very used to working on Windows or DirectX. I am using a Windows Forms control to create a rendering target, and msdn warns that since it uses BindDC, the larger the rendering target, the worse the performance (which turned out to be a sharp difference when I maximize the window, I get about 15 frames per second) .

What would be the best way to create targeted rendering for Direct2D? Is there a way to create a window and render it directly, instead of first rendering the control buffer and then doing it? If so, how?

Sorry if my English sucks and not my native language.

+4
source share
1 answer

Instead, you should use CreateHwndRenderTarget using the Handle property of the control. To do this completely correctly, create your own control and override the OnHandleCreated () method. And override OnPaintBackground () and do nothing.

+2
source

Source: https://habr.com/ru/post/1307129/


All Articles