smack0007 / GLFWDotNet

.NET bindings for GLFW.
MIT License
50 stars 8 forks source link

Linux/OSX support #25

Closed humbertodias closed 4 years ago

humbertodias commented 4 years ago

Linux

sudo apt install libc6-dev libglfw3-dev

unix-support

glfw-tests-ok

OSX

brew install glfw3
smack0007 commented 4 years ago

Hi! This is great and first of all thanks so much for contributing. I just have a few comments which I'll add directly to the commit log.

smack0007 commented 4 years ago

Took a look at the code inside of Visual Studio. Running the code generator breaks some of your changes. I'm willing to update the code generator to be compatible with your changes if you don't feel comfortable fixing it. Would it be ok if I merged your changes into a branch for now? I should be able to get the changes merged into master soon.

humbertodias commented 4 years ago

No problem. Go ahead.

smack0007 commented 4 years ago

I merged the changes into a branch of the same name and updated the generator so that it respects the platform when loading the functions. Let me know if it doesn't work for your use case for whatever reason.

I'd like to test this out myself at least on Linux before I merge into master. I'm sure it will work though as it looks like most other code I've seen for doing this kind of stuff on Linux. I don't own a Mac so I'll trust you on that one.

humbertodias commented 4 years ago

Seems to work https://drive.google.com/file/d/1TP-F9elPjGP5LulVL6THqfqHpJMGoGWO/view?usp=sharing

smack0007 commented 4 years ago

Great. You don't have to run the CodeGenerator btw. All that does is produce the GLFW.cs file. I did it that way so that I can extract as much information as possible from the GLFW header files. If the GLFW header file hasn't been changed it should produce the exact same GLFW.cs file again.

Can I put your name in a Contributors.md file?

humbertodias commented 4 years ago

Yes, for sure.

smack0007 commented 4 years ago

Linux

sudo apt install libglfw3-dev

I had to do sudo apt install libc6-dev as well otherwise I got an error message:

Unable to load DLL 'libdl'

smack0007 commented 4 years ago

Merged to master and published v20.9.0 to NuGet with these changes.