webplatformforembedded / node-wpe-webgl Goto Github PK
View Code? Open in Web Editor NEWWPE WebGL Node.js module
Home Page: https://www.npmjs.com/package/node-wpe-webgl
License: BSD 2-Clause "Simplified" License
WPE WebGL Node.js module
Home Page: https://www.npmjs.com/package/node-wpe-webgl
License: BSD 2-Clause "Simplified" License
and can prompt how to do this?
on Raspberry PI (node v8.9.1) I'm getting the following:
(Raspberry PI Zero W)
GL enabled
GPU mem set to 256Mb
initializing GLEW
No protocol specified
/home/smirza/zap-dash/node_modules/wpe-webgl/gles2.js:11
gles2.init(width, height, fullscreen, title);
^
RangeError: Can't init GLEW
at Object.init (/home/smirza/zap-dash/node_modules/wpe-webgl/gles2.js:11:11)
at Object.<anonymous> (/home/smirza/zap-dash/index.js:7:18)
at Module._compile (module.js:635:30)
at Object.Module._extensions..js (module.js:646:10)
at Module.load (module.js:554:32)
at tryModuleLoad (module.js:497:12)
at Function.Module._load (module.js:489:3)
at Function.Module.runMain (module.js:676:10)
at startup (bootstrap_node.js:187:16)
at bootstrap_node.js:608:3
here is the source code (slightly different from readme example)
const webgl = require('wpe-webgl');
const process = require('process');
let continueLooping = true;
const options = { width: 1280, height: 720, fullscreen: true };
const gl = webgl.init(options);
const end = (new Date().getTime()) + (10 * 1000);
const render = () => {
const now = new Date().getTime();
gl.clearColor(0, 1.0, 1.0, 0.0);
// Set the viewport
gl.viewport(0, 0, 640, 480);
// Clear the color buffer
gl.clear(gl.COLOR_BUFFER_BIT);
// Do other GL-related stuff here.
webgl.nextFrame(true /* Use false to prevent buffer swapping */);
if (continueLooping) {
process.nextTick(render);
}
if (now > end) {
process.exit(0);
}
}
render();
the following WebGLRenderingContext properties are unimplemented:
readonly drawingBufferHeight: number;
readonly drawingBufferWidth: number;
On Raspberry Pi 3 with node 8.9.4, jessie:
module.js:672
return process.dlopen(module, path._makeLong(filename));
^
Error: Module did not self-register.
at Object.Module._extensions..node (module.js:672:18)
at Module.load (module.js:556:32)
at tryModuleLoad (module.js:499:12)
at Function.Module._load (module.js:491:3)
at Module.require (module.js:587:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/usr/src/app/node_modules/wpe-webgl/gles2.js:1:75)
at Module._compile (module.js:643:30)
at Object.Module._extensions..js (module.js:654:10)
at Module.load (module.js:556:32)
gpu_mem is set to 196 and the results are the same with the new graphics driver (dt_overlay = vc4-kms-v3d)
There are 2 Packages from this repo on npm:
PS C:\play\nodegl> yarn add -D wpe-webgl
yarn add v1.5.1
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
[1/1] โ wpe-webgl: not ok
error An unexpected error occurred: "C:\\play\
odegl\
ode_modules\\wpe-webgl: Command failed.
Exit code: 1
Command: C:\\WINDOWS\\system32\\cmd.exe
Arguments: /d /s /c node-gyp rebuild
Directory: C:\\play\
odegl\
ode_modules\\wpe-webgl
Output:
C:\\play\
odegl\
ode_modules\\wpe-webgl>if not defined npm_config_node_gyp (node \"C:\\Program Files\
odejs\
ode_modules\
pm\\bin\
ode-gyp-bin\\\\..\\..\
ode_modules\
ode-gyp\\bin\
ode-gyp.js\" rebuild ) else (node \"\" rebuild )
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | win32 | x64
gyp info spawn C:\\Python27\\python.EXE
gyp info spawn args [ 'C:\\\\Program Files\\\
odejs\\\
ode_modules\\\
pm\\\
ode_modules\\\
ode-gyp\\\\gyp\\\\gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'msvs',
gyp info spawn args '-G',
gyp info spawn args 'msvs_version=auto',
gyp info spawn args '-I',
gyp info spawn args 'C:\\\\play\\\
odegl\\\
ode_modules\\\\wpe-webgl\\\\build\\\\config.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:\\\\Program Files\\\
odejs\\\
ode_modules\\\
pm\\\
ode_modules\\\
ode-gyp\\\\addon.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:\\\\Users\\\\piersh.DFCN\\\\.node-gyp\\\\9.9.0\\\\include\\\
ode\\\\common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=C:\\\\Users\\\\piersh.DFCN\\\\.node-gyp\\\\9.9.0',
gyp info spawn args '-Dnode_gyp_dir=C:\\\\Program Files\\\
odejs\\\
ode_modules\\\
pm\\\
ode_modules\\\
ode-gyp',
gyp info spawn args '-Dnode_lib_file=C:\\\\Users\\\\piersh.DFCN\\\\.node-gyp\\\\9.9.0\\\\<(target_arch)\\\
ode.lib',
gyp info spawn args '-Dmodule_root_dir=C:\\\\play\\\
odegl\\\
ode_modules\\\\wpe-webgl',
gyp info spawn args '-Dnode_engine=v8',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'C:\\\\play\\\
odegl\\\
ode_modules\\\\wpe-webgl\\\\build',
gyp info spawn args '-Goutput_dir=.' ]
'pkg-config' is not recognized as an internal or external command,\r
operable program or batch file.\r
gyp: Call to 'pkg-config glesv2 egl --libs --silence-errors | grep bcm || true' returned exit status 255 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (C:\\Program Files\
odejs\
ode_modules\
pm\
ode_modules\
ode-gyp\\lib\\configure.js:336:16)
gyp ERR! stack at ChildProcess.emit (events.js:180:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:12)
gyp ERR! System Windows_NT 10.0.16299
gyp ERR! command \"C:\\\\Program Files\\\
odejs\\\
ode.exe\" \"C:\\\\Program Files\\\
odejs\\\
ode_modules\\\
pm\\\
ode_modules\\\
ode-gyp\\\\bin\\\
ode-gyp.js\" \"rebuild\"
gyp ERR! cwd C:\\play\
odegl\
ode_modules\\wpe-webgl
gyp ERR! node -v v9.9.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok".
info If you think this is a bug, please open a bug report with the information provided in "C:\\play\
odegl\\yarn-error.log".
the link at the top of the https://github.com/WebPlatformForEmbedded/node-wpe-webgl page points to the wrong npm page:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.