Performance

Apr 5, 2013 at 11:06 AM
Although new to SharpGL and WPF and if correct, I would like to suggest that some information is provided on WPF and performance. As you can't select NativeWindow as rendercontexttype without an exception performance using WPF for large window sizes are't too impressive. Using WinForms and NativeWindow context works perfect. Should you even support WPF if no NativeWindow context is posible?

Looking forward to diging further into SharpGL.
Aug 13, 2013 at 10:41 AM
I sent an email to the author with this patch recently. The issue is that the OpenGLControl.cs does not pass the WPF Window Handle to the OpenGL.Create Method. You can to modify the OpenGLControl.cs OnApplyTemplate method as follows:
object parameter = null;

if(RenderContextType == RenderContextType.NativeWindow)
{
    HwndSource source = (HwndSource)HwndSource.FromVisual(this);
    parameter = source.Handle;
}

//  Lock on OpenGL.
lock (gl)
{
    //  Create OpenGL.
    gl.Create(RenderContextType, 1, 1, 32, parameter);
}
Aug 13, 2013 at 11:18 AM

Hi liamv06

Thanks for the post. Very much appreciated.

Regards

Peter

Nov 25, 2014 at 4:57 PM
The author still hasn't fixed this. I had to change this myself.
Coordinator
Nov 29, 2014 at 12:27 PM
Apologies to those who have been having this problem, I'll get this in the next release:

https://github.com/dwmkerr/sharpshell/issues/63

Above is the issue link if you want notifications for when it is done, I'll also update this thread.