jayhf / OpenTkControl

A faster way to use OpenTk in WPF without Forms dependencies
MIT License
30 stars 6 forks source link

Fix crash in XAML design mode #7

Closed MikiraSora closed 3 years ago

MikiraSora commented 4 years ago

Fix issue : https://github.com/jayhf/OpenTkControl/issues/6 and another bug when control want to generate a opengl buffer in design mode:

MikiraSora commented 4 years ago

In fact I notice glReadPixels spend most time on copying buffer into bitmap though CPU. I think it could use WGL_NV_DX_interop and share with DirectX surface.

jayhf commented 4 years ago

The changes look great. I just want to test them before I approve and I probably won't have time until the weekend. You're right that the current CPU copying method isn't efficient and that interop function looks like it could really improve things. I didn't know it existed. I'm not actively developing this library any more, but you're welcome to integrate and PR it if you want.

MikiraSora commented 4 years ago

OK I had implemented this opengl extension and release a example. https://github.com/MikiraSora/OpenTkControl/releases/tag/v0.1.0

I will take a test and format code before raising new PR.

But this is temporary solution because the team of OpenTK dev also want to improve their control library though this extension and WGL_NV_DX_interop2.