luca-piccioni / OpenGL.Net

Modern OpenGL bindings for C#.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Switch the GlControl to OpenGl.Net.WinForms_net461 with running exception

stevenmbiz opened this issue · comments

Switch to use the WinForms_net461 GlControl for my project because I need newer version 4.6.1 .net framework to work for assimpNet skeleton animation import. I also switch both OpenGl.net.dll and OpenGl.net.winforms.dll references in visual studio 2017 to newer _net461 versions. When running the project, a exception occurred:
OpenGL.GlException: 'invalid enumeration' at CheckErrors function at startup.

Do I have to set the GlControl to something when using newer 4.6.1 framework?

I'm seeing this error as well. Did you find a solution?

No, I've look at another solution now.

If the exceptions are raised at initialization, they are masked with a try catch. This is quite normal on non-NVIDIA hardware: essentially the framework is trying to get the implementation limits using glGet, but the enumeration is not recognized (but it should since the relative GL extension is declared as supported).

If it happens during debugging in Visual Studio, just uncheck the option "break when... is user handled" to avoid the annoying breaks.

That's got it, thanks @luca-piccioni. Triangle is doing a funny dance but it's working. Now to take another stab at getting the .NET Core version working. Any tips would be appreciated.

I do have an NVIDIA card but it's my laptop so must be picking the default Intel card.