JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 7
  • Score
    100M100P100Q41234F
  • License MIT

SDL2 bindings for Node

Package Exports

  • sdl2-link

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (sdl2-link) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

sdl2-link

A node module that exposes the SDL2 C API to Javascript through the Foreign Function Interface (FFI).

Requirements

SDL2 must be installed on your Linux, Mac and Windows system.

Foreign Function Interface (FFI) modules:

https://www.npmjs.com/package/ref-napi https://www.npmjs.com/package/ffi-napi

or

https://www.npmjs.com/package/ffi https://www.npmjs.com/package/ref

Installation

npm install sdl2-link

Usage

// Import the FFI modules.
const ref = require('ref-napi');
const ffi = require('ffi-napi');
// Load the SDL2 library, including constants, structs, unions and functions.
const SDL2 = require('sdl2-link')({ ffi: ffi, ref: ref });

// Start making calls to SDL.
SDL2.SDL_Init(SDL2.SDL_INIT_VIDEO);

// etc

Status

The module is currently in an unstable, experimental state.