WebGL

Experimental wrapper to webgl for Nim

Wrapper score 15/100 · tests present · no docs generated

Wraps a native library — check OS Compatibility below for platform-specific linking notes.

Summary

Latest Version Unknown
License MIT
CI Status Failing
Downloads 0
Last Indexed 2026-07-21 05:24

Installation

nimble install WebGL
choosenim install WebGL
git clone https://github.com/stisa/webgl

OS Compatibility

Platform Linux macOS Windows FreeBSD OpenBSD NetBSD Android iOS WASM Embedded
WebGL - - - - - - -

Source

Repository https://github.com/stisa/webgl
Homepage https://stisa.space/webgl/
Registry Source nimble_official

README

WebGL in Nim

Experimental wrapper to webgl for Nim (JS backend).
Mostly taken from mozilla webgl api

NOTE: it is still incomplete and there are probably bugs

A couple of examples are provided in /examples They are mostly translations of js code taken from mozilla tutorials and webgl-lessons, so don't expect idiomatic nim code. I'll work on improving them ( PRs welcome! ).

Documentation

Some examples and autogenerated docs are avaliable in /docs and online at my site

To build the docs and examples, clone this repo and then run:

nimble builddocs

The docs are then available in /docs

Compiling to JS

nim js [-o:<outfile.js>] <filename> 

Note that the part between [] is optional, but it's useful as otherwise the .js file built by nim would be in nimcache.

TODO

  • move consts to enums?
  • move function out of the WebglRenderingContext object, to have autodocs?
  • Some utilites: others? ~~setting up a context~~, ~~reading errors~~, ~~emitting to console~~
  • Have a module for Webgl2
  • Show the code side-by-side with the examples