22
33This is a part of [ Node3D] ( https://github.com/node-3d ) project.
44
5- [ ![ NPM] ( https://nodei.co/npm /deps-opengl-raub.png?compact=true )] ( https://www.npmjs.com/package /deps-opengl-raub )
5+ [ ![ NPM] ( https://badge.fury.io/js /deps-opengl-raub.svg )] ( https://badge.fury.io/js /deps-opengl-raub )
66[ ![ CodeFactor] ( https://www.codefactor.io/repository/github/node-3d/deps-opengl-raub/badge )] ( https://www.codefactor.io/repository/github/node-3d/deps-opengl-raub )
77
88```
@@ -12,163 +12,63 @@ npm i deps-opengl-raub
1212This dependency package is distributing ** OpenGL** , ** GLFW3** and ** GLEW**
1313binaries through ** NPM** for ** Node.js** addons.
1414
15- * Platforms (x64): Windows, Linux, OSX.
15+ * Platforms (x64): Windows x64 , Linux x64 , OSX x64, Linux Aarch64 .
1616* Libraries: GLEW 2.1, GLFW 3.3, OpenGL.
17- * Linking: static dll-type.
1817
19- ## Usage
20-
21- ### Example binding.gyp
22-
23- As in [ glfw-raub] ( https://github.com/node-3d/glfw-raub/tree/master/src ) Node.js addon.
24-
25- ``` javascript
26- {
27- ' variables' : {
28- ' bin' : ' <!(node -p "require(\' addon-tools-raub\' ).bin")' ,
29- ' gl_include' : ' <!(node -p "require(\' deps-opengl-raub\' ).include")' ,
30- ' gl_bin' : ' <!(node -p "require(\' deps-opengl-raub\' ).bin")' ,
31- },
32- ' targets' : [
33- {
34- ' target_name' : ' glfw' ,
35- ' sources' : [
36- ' cpp/bindings.cpp' ,
37- ' cpp/events.cpp' ,
38- ' cpp/glfw.cpp' ,
39- ],
40- ' include_dirs' : [
41- ' <(gl_include)' ,
42- ' <!@(node -p "require(\' addon-tools-raub\' ).include")' ,
43- ],
44- ' cflags!' : [' -fno-exceptions' ],
45- ' cflags_cc!' : [' -fno-exceptions' ],
46- ' library_dirs' : [' <(gl_bin)' ],
47- ' conditions' : [
48- [
49- ' OS=="linux"' ,
50- {
51- ' libraries' : [
52- " -Wl,-rpath,'$$ORIGIN'" ,
53- " -Wl,-rpath,'$$ORIGIN/../node_modules/deps-opengl-raub/<(bin)'" ,
54- " -Wl,-rpath,'$$ORIGIN/../../deps-opengl-raub/<(bin)'" ,
55- ' <(gl_bin)/libglfw.so.3' ,
56- ' <(gl_bin)/libGL.so' ,
57- ' <(gl_bin)/libXrandr.so' ,
58- ],
59- ' defines' : [' __linux__' ],
60- }
61- ],
62- [
63- ' OS=="mac"' ,
64- {
65- ' libraries' : [
66- ' -Wl,-rpath,@loader_path' ,
67- ' -Wl,-rpath,@loader_path/../node_modules/deps-opengl-raub/<(bin)' ,
68- ' -Wl,-rpath,@loader_path/../../deps-opengl-raub/<(bin)' ,
69- ' <(gl_bin)/glfw.dylib' ,
70- ],
71- ' defines' : [' __APPLE__' ],
72- }
73- ],
74- [
75- ' OS=="win"' ,
76- {
77- ' libraries' : [ ' glfw3dll.lib' , ' opengl32.lib' ],
78- ' defines' : [
79- ' WIN32_LEAN_AND_MEAN' ,
80- ' VC_EXTRALEAN' ,
81- ' _WIN32' ,
82- ],
83- ' msvs_settings' : {
84- ' VCCLCompilerTool' : {
85- ' AdditionalOptions' : [
86- ' /O2' ,' /Oy' ,' /GL' ,' /GF' ,' /Gm-' ,
87- ' /EHsc' ,' /MT' ,' /GS' ,' /Gy' ,' /GR-' ,' /Gd' ,
88- ]
89- },
90- ' VCLinkerTool' : {
91- ' AdditionalOptions' : [' /OPT:REF' ,' /OPT:ICF' ,' /LTCG' ]
92- },
93- },
94- },
95- ],
96- ],
97- },
98- ],
99- }
100- ```
10118
19+ ## Usage
10220
103- ### addon.cpp
104-
105- ``` cpp
106- #include < GL/glew.h>
21+ ### JS Interface
10722
108- #define GLFW_NO_GLU
109- #define GLFW_DLL
110- #include < GLFW/glfw3.h>
23+ See in [ glfw-raub] ( https://github.com/node-3d/glfw-raub/blob/master/core.js ) Node.js addon.
24+ See in [ webgl-raub] ( https://github.com/node-3d/webgl-raub/blob/master/core.js ) Node.js addon.
11125
11226
113- // Platform specific windows and contexts if needed
27+ ### binding.gyp
11428
115- #ifdef _WIN32
116- #define GLFW_EXPOSE_NATIVE_WIN32
117- #define GLFW_EXPOSE_NATIVE_WGL
118- #elif __ APPLE__
119- #define GLFW_EXPOSE_NATIVE_COCOA
120- #define GLFW_EXPOSE_NATIVE_NSGL
121- #elif __ linux__
122- #define GLFW_EXPOSE_NATIVE_X11
123- #define GLFW_EXPOSE_NATIVE_GLX
124- #endif
125- #include < GLFW/glfw3native.h>
29+ See in [ glfw-raub] ( https://github.com/node-3d/glfw-raub/tree/master/src/binding.gyp ) Node.js addon.
30+ See in [ webgl-raub] ( https://github.com/node-3d/webgl-raub/tree/master/src/binding.gyp ) Node.js addon.
12631
12732
128- // Fix bad defines for unix compilation
33+ ### addon.cpp
12934
130- #undef True
131- #undef False
132- ```
35+ See in [ glfw-raub] ( https://github.com/node-3d/glfw-raub/blob/master/src/cpp/glfw-common.hpp ) Node.js addon.
36+ See in [ webgl-raub] ( https://github.com/node-3d/webgl-raub/blob/master/src/cpp/webgl.hpp ) Node.js addon.
13337
13438Refer to [ GLFW] ( https://www.glfw.org/documentation.html ) and
13539[ GLEW] ( http://glew.sourceforge.net/basic.html ) official docs.
13640
13741
138- ---
139-
14042## Legal notice
14143
44+
14245### GLFW
14346
144- This software uses the [ GLFW open source library] ( http://www.glfw.org/index.html ) .
145- GLFW is legally used under the ZLIB license.
47+ [ GLFW] ( http://www.glfw.org/index.html ) is used under ZLIB license.
14648It is explicitly stated that GLFW can be used commercially in closed-source projects.
14749GLFW licensing information (a COPY) is given in a [ separate file] ( /GLFW_ZLIB ) ,
14850which also can be found on
14951[ GLFW's official repository] ( https://github.com/glfw/glfw/blob/master/LICENSE.md ) .
150- Windows, Linux, and OSX binaries are built with
151- [ GitHub Actions ] ( https://github. com/node-3d/deps-opengl-raub/actions ) .
52+ The binaries are built with this
53+ [ GitHub Action ] ( https://raw.githubusercontent. com/nigels-com/glew/master/.github/workflows/build.yml ) .
15254
15355
15456### GLEW
15557
156- Also this software uses the [ GLEW open source library] ( http://glew.sourceforge.net/ ) .
157- GLEW is legally used under it's own custom license.
58+ [ GLEW] ( http://glew.sourceforge.net/ ) is used under it's own custom license.
15859It is explicitly stated that GLEW can be used commercially in closed-source projects.
15960GLEW licensing information (a COPY) is given in a [ separate file] ( /GLEW_LICENSE ) ,
16061which also can be found on
16162[ GLEW's official repository] ( https://raw.githubusercontent.com/nigels-com/glew/master/LICENSE.txt ) .
162- Windows, Linux, and OSX binaries are built with
163- [ GitHub Actions ] ( https://github. com/node-3d/deps-opengl-raub/actions ) .
63+ The binaries are built with this
64+ [ GitHub Action ] ( https://raw.githubusercontent. com/nigels-com/glew/master/.github/workflows/build.yml ) .
16465
16566
16667### OpenGL
16768
16869End users, independent software vendors, and others writing code based on the OpenGL API
16970are free from licensing requirements. https://www.opengl.org/about/#11
17071
171-
17272---
17373
17474The rest of this package is MIT licensed.
0 commit comments