Giter Club home page Giter Club logo

node-sdl2's People

Contributors

freshxopensource avatar jsm174 avatar zetsin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

node-sdl2's Issues

No available video device (Raspbian Stretch)

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

Failed to run test.js

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:

  • Clone the repo
  • npm install
  • node test/test.js

Tested on Windows 10 x64

--

I am getting these same errors when trying to use this module in my project.

An example of using Fonts?

Hey Man,

do you have an example of how to add text to the window? I've been trying to figure it out. Thanks!

  • Nick

Design Changes

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 definitions
    • properties would be an associative array that's merged in after libraries have been loaded

    This 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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.