-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
System.Windows.Forms control fails to create context if framebuffer properties are changed #119
Comments
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. I meant to use a 32 bit depth buffer earlier, but that does not make a difference. 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: