Giter VIP home page Giter VIP logo

sfml.js's Introduction

Node.js binding for SFML - a Simple and Fast cross-platform Multimedia Library.

Installation

$ npm install --save sfml.js

Usage

Examples

  • node-sfml-demos: Several small example games;
  • play-nes: A cross-platform desktop NES emulator powered by OpenGL in Node.js.

PR is welcomed. You can add your own sfml.js example.

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Khaidi Chu

🚧 💻

NuriYuri

💻

Hanz

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

sfml.js's People

Contributors

allcontributors[bot] avatar hanzceo avatar nuriyuri avatar xadillax 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

sfml.js's Issues

Rendering text in async crashes the program

this code

const { readFileSync } = require('fs');
const { RenderWindow, VideoMode, Text, Font } = require('sfml.js');

let i = 0;

async function asyncRender() {
        let text = new Text("Testing", font);
        text.setFillColor(255); // Black

        while(true) {
                let event;
                while ((event = window.pollEvent())) {
                        if (event.type === "Closed") {
                                window.close();
                                return;
                        }
                }

                text.setString("Testing".substr(0, i++ % ("Testing".length)));

                window.clear(-1); // White eraser
                await window.drawAsync(text);
                await window.displayAsync();
        }
}

let font = new Font();
let window = new RenderWindow(new VideoMode(400, 400), "issue");

let data = readFileSync("C:/Windows/Fonts/segoeui.ttf");
font.loadFromMemory(data);

(async () => {
        await asyncRender();
})();

Will crashes at drawAsync in Windows 10.0
I don't know what causes this. Please assist.

Node v14.18.2

Support M1 Mac architecture

Currently when trying to install on M1 Mac, the follow error appears: Error: Unsupported architecture: arm64

Hi, I got an error when I tried to install a package

`npm ERR! code 1
npm ERR! path C:\Users\joyrax\testex\node_modules\sfml.js
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node-gyp rebuild
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | win32 | x64
npm ERR! gyp info find Python using Python version 3.10.2 found at "C:\Users\joyrax\AppData\Local
Programs\Python\Python310\python.exe"
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS msvs_version not set from command line or npm config
npm ERR! gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
npm ERR! gyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer, try re-run
ning with '--loglevel silly' for more details
npm ERR! gyp ERR! find VS looking for Visual Studio 2015
npm ERR! gyp ERR! find VS - not found
npm ERR! gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS You need to install the latest version of Visual Studio
npm ERR! gyp ERR! find VS including the "Desktop development with C++" workload.
npm ERR! gyp ERR! find VS For more information consult the documentation at:
npm ERR! gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Could not find any Visual Studio installation to use
npm ERR! gyp ERR! stack at VisualStudioFinder.fail (C:\Users\joyrax\testex\node_modules\node-g
yp\lib\find-visualstudio.js:122:47)
npm ERR! gyp ERR! stack at C:\Users\joyrax\testex\node_modules\node-gyp\lib\find-visualstudio.
js:75:16
npm ERR! gyp ERR! stack at VisualStudioFinder.findVisualStudio2013 (C:\Users\joyrax\testex\nod
e_modules\node-gyp\lib\find-visualstudio.js:363:14)
npm ERR! gyp ERR! stack at C:\Users\joyrax\testex\node_modules\node-gyp\lib\find-visualstudio.
js:71:14
npm ERR! gyp ERR! stack at C:\Users\joyrax\testex\node_modules\node-gyp\lib\find-visualstudio.
js:384:16
npm ERR! gyp ERR! stack at C:\Users\joyrax\testex\node_modules\node-gyp\lib\util.js:54:7
npm ERR! gyp ERR! stack at C:\Users\joyrax\testex\node_modules\node-gyp\lib\util.js:33:16
npm ERR! gyp ERR! stack at ChildProcess.exithandler (node:child_process:404:5)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:390:28)
npm ERR! gyp ERR! stack at maybeClose (node:internal/child_process:1064:16)
npm ERR! gyp ERR! System Windows_NT 6.3.9600
npm ERR! gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\joyrax\testex\node_m
odules\node-gyp\bin\node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd C:\Users\joyrax\testex\node_modules\sfml.js
npm ERR! gyp ERR! node -v v16.13.1
npm ERR! gyp ERR! node-gyp -v v8.4.1
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\joyrax\AppData\Local\npm-cache_logs\2022-04-01T16_37_09_862Z-debug.log `

Unit test structure is needed

This project should set-up a unit test structure via mocha and we need GitHub Action to do the CI.

  • rect
  • vector
    • vector2 i / f / u
    • vector3 i / f / u
  • vertex
  • video_mode
  • ...

And we should find a way to test Things rendered in a Window.

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.