4
votes

I know this is a niche topic. But hopefully someone on here will know. AFter spending some time researching, I decided that the D programming language was best for me - high-level, relatively good bindings and fast.

I would like to get GLFW and OpenGL up and running with it. I've done some research into D programming, and have successfully compiled programs that use simple imports from the standard libraries. I have experience programming in other languages (Python, C, C#, C++, etc.) but I cannot work out how to get GLFW, D and OpenGL working together. I've spent a long time searching the web, and all tutorials I can find are relevant to Windows, or do not explain it.

I am running on Arch Linux. If anyone can give me a quick example - things like compiler tags, directories to put "stuff" in, and the import statements - that would be brilliant.

Thanks.

1
there's some packages here code.dlang.org/search?q=glfw but I haven't used any myself so I can't help too much - Adam D. Ruppe
Do some reading on dub, D's package manager. It will help you in fetching packages, compiling and linking your libraries and programs. code.dlang.org/about - yaz

1 Answers

1
votes

Derelict has GFLW bindings: https://github.com/DerelictOrg/DerelictGLFW3

Here's a tutorial on how to use Derelict: http://dblog.aldacron.net/derelict-help/using-derelict/

You will have to add derelict-gl3 and derelict-glfw3 to your dub dependencies, and load them in your code according to their readme files on GitHub.