Derelict

Mike Parker via Digitalmars-d digitalmars-d at puremagic.com
Mon Dec 5 05:54:01 PST 2016


On Monday, 5 December 2016 at 11:38:05 UTC, D.Rex wrote:
> Hi,
>
> I am sure this has been asked a thousand times before, but can 
> anyone link me to a tutorial on how to set up derelict and 
> GLFW3, I am trying to work on a project and I just can't get it 
> set up regardless of how many times I read the derelict 
> readme's.

See the Derelict documentation (linked from the README) on using 
Derelict with DUB-managed projects [1]. Summary:

Step 1: Make sure the GLFW 3 library is installed on your system. 
On Windows, that means you just put the glfw3.dll in the same 
directory in which your executable will reside. On Mac, it's 
easiest to install with Homebrew (should be 'brew install glfw' 
or 'brew install glfw3', can't recall which). On Linux, use your 
package manager. Get the dev version of the package if you want, 
but you don't need it with Derelict.

Step 2: Add 'derelict-glfw3' as a dependency to your dub.json or 
dub.sdl file (assuming you are using dub to manage your project. 
If not, see the Derelict documentation using Derelict packages 
with non-DUB projects [2]).

For dub.json:
"dependencies" : {
"derelict-glfw3": "~>3.1.1"
}

For dub.sdl:

dependency "derelict-glfw3" version="~>3.1.1"

Step 3: Import derelict.glfw3.glfw3 and somewhere in your code, 
preferably during startup, call DerelictGLFW3.load.

```
import derelict.glfw3.glfw3;
void main() { DerelictGLFW3.load(); }
```

[1] http://derelictorg.github.io/building/with-dub/
[2] http://derelictorg.github.io/building/without-dub/





More information about the Digitalmars-d mailing list