zetsin / node-sdl2 Goto Github PK
View Code? Open in Web Editor NEWBindings for SDL2 in Node
Bindings for SDL2 in Node
How would you modify surface pixel values, without having to use the drawPoint
?
bugs recently fixed are still in the official repo
Hi Zetsin,
I would like to run two graphical JavaScript applications on two separate displays. Right now, I'm using multiple Adafruit displays with a Raspberry Pi Zero W. They're registered as /dev/fb1 and /dev/fb2 via SPI and display overlays. I set an environmental variable via export SDL_FBDEV="/dev/fb1"
.
If I'm now running your test.js I end up with the error "No available video device" after I modified app.js slightly:
const SDL_error = require('../dep/SDL_error')
[...]
if(SDL.SDL_Init(flags) != 0) {
console.log(flags);
console.log(SDL_error.SDL_GetError());
this.quit()
return
}
Can you hint me how to use node-sdl2 with multiple dedicated framebuffer devices?
Cheers,
Uwe
I get this error:
digit@mighty-dev MINGW64 ~/Desktop/workspace/node-sdl2 (master)
$ node test/test.js
C:\Users\digit\Desktop\workspace\node-sdl2\node_modules\ffi\lib\dynamic_library.js:74
throw new Error('Dynamic Linking Error: ' + err)
^
Error: Dynamic Linking Error: Win32 error 126
at new DynamicLibrary (C:\Users\digit\Desktop\workspace\node-sdl2\node_modules\ffi\lib\dynamic_library.js:74:11)
at Object.Library (C:\Users\digit\Desktop\workspace\node-sdl2\node_modules\ffi\lib\library.js:45:12)
at Object.<anonymous> (C:\Users\digit\Desktop\workspace\node-sdl2\dep\SDL_stdinc.js:74:5)
at Module._compile (internal/modules/cjs/loader.js:799:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:810:10)
at Module.load (internal/modules/cjs/loader.js:666:32)
at tryModuleLoad (internal/modules/cjs/loader.js:606:12)
at Function.Module._load (internal/modules/cjs/loader.js:598:3)
at Module.require (internal/modules/cjs/loader.js:705:19)
at require (internal/modules/cjs/helpers.js:14:16)
My steps were:
Tested on Windows 10 x64
--
I am getting these same errors when trying to use this module in my project.
Hey Man,
do you have an example of how to add text to the window? I've been trying to figure it out. Thanks!
What are your thoughts on...
Make each module module export libraries
and properties
, which are aggregated all together in index.js
. The result would move all modules to the root so that referencing them would be easy:
var sdl = require('node-sdl2');
if (sdl.SDL_Init(sdl.SDL_INIT_VIDEO) != 0) {
console.log('SDL_Init Error: ' + sdl.SDL_GetError());
process.exit(1);
}
libraries
would be an associative array of the path of the library to load, along with all of the function definitionsproperties
would be an associative array that's merged in after libraries have been loadedThis would make it really easy to port existing C code over to JavaScript.
Refactor the library loading to discover the library path (it's just "libSDL2"
on Linux)
Remove the binaries from this package
Move to some of ES2015?
Move SDL_Image to its own package: https://github.com/robloach/node-sdl2-image
Implement additional packages:
Took this on in #2
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.