luca-piccioni / OpenGL.Net

Modern OpenGL bindings for C#.
MIT License
570 stars 109 forks source link

Tolerate extensions appearing twice in extension list #26

Closed nmcveity closed 7 years ago

nmcveity commented 7 years ago

If an extension name appears twice in the extension list then the context always fails to create.

How do you get an extension appearing twice in the extension list? I found it would happen when running through apitrace (https://github.com/apitrace/apitrace). APITrace wants your application to take advantage of debug extensions (like GL_ARB_debug_output) so it unconditionally injects a bunch of extensions to the extension string.

However, if your OpenGL implementation already advertised any of those extensions, that extension will now be in the list twice.

luca-piccioni commented 7 years ago

The code is more robust now. If any GL implementation advertise the same extension mote than one time, no exception is thrown.