Skip to content

🗿 Fork of headless-gl that can render to windows

Notifications You must be signed in to change notification settings

kmamal/headless-gl

 
 

Repository files navigation

@kmamal/gl

This is a simple fork of the gl package that adds a single feature: it can work together with @kmamal/sdl to allow WebGL drawing to actual windows.

It should work on Linux, Mac, and Windows. Prebuilt binaries are available for x64 architectures, and arm-based Macs.

Releases of this package start from v4.9.0 of gl. This package's version number tracks the gl package's version number and appends a suffix with it's own "release" version such as: v4.9.0-2 where the -2 suffix denotes that this is the second release of this package for the v4.9.0 release of gl.

Example

const sdl = require('@kmamal/sdl')
const createContext = require('@kmamal/gl')

const window = sdl.video.createWindow({
  title: "Hello, World!"
  opengl: true,
})

// Clear screen to red
const { width, height, native } = window
const gl = createContext(width, height, { window: native })
gl.clearColor(1, 0, 0, 1)
gl.clear(gl.COLOR_BUFFER_BIT)
gl.swap()

About

🗿 Fork of headless-gl that can render to windows

Resources

Stars

Watchers

Forks

Languages

  • JavaScript 66.9%
  • C++ 30.2%
  • C 1.7%
  • Python 1.2%