luca-piccioni / OpenGL.Net

Modern OpenGL bindings for C#.
MIT License
578 stars 110 forks source link

Changed postbuild events to be OS-conditional, and updated NUnit to v3. #8

Closed Nihlus closed 8 years ago

Nihlus commented 8 years ago

I've implemented a small number of fixes for the projects and tests which allows everything to build out of the box on Linux.

Full list of changes:

Unfortunately, samples still will not run due to a TypeInitializationException. I suspect that there's a DLLConfig missing somewhere that prevents mono from communicating with the native OpenGL library. If nothing else, this is a start in the right direction for us Linuxers :)

EDIT: Here's the exception. Looks like it's not finding libGL properly. https://gist.github.com/Nihlus/3b3977da6c47c89d20c139b9efa002fc

luca-piccioni commented 8 years ago

Thank you. I'm reviewing right now. I think to merge it on master.

Just some note if you plan to keep going:

NUnit 3 is ok since 3.2, due its parallel task feature that must be disabled. I got crazy few weeks ago to upgrade it untill I gave up waiting version including the hotfix.

luca-piccioni commented 8 years ago

The exception you linked can be solved by defining a configuration file mapping library names:

<configuration>
  <dllmap os="linux" dll="opengl32.dll" target="libGL.so.1"/>
  <dllmap os="linux" dll="libGL" target="libGL.so.1"/>
<configuration>

No very sure for the last dllmap, since I don't remember where glXCreateContext and co. are effectively implemented (maybe in libX11 or others).

Nihlus commented 8 years ago

I may keep going with this to get it to run properly. For the C++ parts I may have to write a makefile as well, since MonoDevelop doesn't do C++ very well. I'll keep the coding style in mind :)

I merged the configuration you provided with the OpenTK configuration I had, but unfortunately it had no effect. This is what is currently in that file:

https://gist.github.com/Nihlus/508fa8fe38f220292a7d21dfe6c8bbb2