You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to set up an OpenGL.GlControl in a WPF window using OpenGL.NET 0.7.1 from NuGet. I am experiencing issues if I change some of the Framebuffer properties of the control.
I will receive a System.NullReferenceException at the Gl.ActiveTexture call. Same happens if I change the ColorBits to 24 for example, the ActiveTexture function will not be loaded, so I am guessing there are issues with setting up the context.
The text was updated successfully, but these errors were encountered:
I'm not aware of how WPF will initialize the designer properties. These are the default values: ColorBits is 24 (reference), while all others have defaulted to 0 (DepthBits, StencilBits and MultisampleBits).
Sincerely I doubt you don't have a ColorBits=24 + DepthBits=8 framebuffer configuration (it's quite a basic setup), indeed there's something wrong here.
Anyway, if the GL context creation fails, an exception shall be thrown, and it should be intercepted by your development environment. Or WPF masks every exception?
Moreover, the GlControl, when in DesignMode, should preview which framebuffer configuration would select with the current Framebuffer designer properties, and if it fails, it should show the exception about.
Thanks for the response.
Unfortunately I do not receive any exception until the ActiveTexture call. WPF should not mask exceptions normally, but the WindowsFormsHost control may have some strange behaviour.
I find it especially strange that many other functions like GenTexture, BindTexture or TexImage2D are loaded, only the ActiveTexture function is missing (or throwing a Nullptr exception to be more specific).
I meant to use a 32 bit depth buffer earlier, but that does not make a difference.
I also started testing inside the HelloTriangle.WPF sample to avoid side effects which could be present in my solution, but this wasn't the cause.
Do my framebuffer settings have to match an element in the DeviceContext.PixelsFormats array? I have 75 items there but there is none with 24 bit color 32 bit depth and 0 bit stencil.
Hi!
I am trying to set up an OpenGL.GlControl in a WPF window using OpenGL.NET 0.7.1 from NuGet. I am experiencing issues if I change some of the Framebuffer properties of the control.
The following example works without issues:
Now if all I do is change the control to have a depth buffer like this:
I will receive a System.NullReferenceException at the Gl.ActiveTexture call. Same happens if I change the ColorBits to 24 for example, the ActiveTexture function will not be loaded, so I am guessing there are issues with setting up the context.
The text was updated successfully, but these errors were encountered: