https://github.com/stisa/webgl
Experimental wrapper to webgl for Nim (JS backend)
https://github.com/stisa/webgl
graphics js nim webgl
Last synced: 4 months ago
JSON representation
Experimental wrapper to webgl for Nim (JS backend)
- Host: GitHub
- URL: https://github.com/stisa/webgl
- Owner: stisa
- License: mit
- Created: 2016-07-20T11:48:29.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2020-07-28T12:32:26.000Z (over 5 years ago)
- Last Synced: 2025-04-12T16:52:17.802Z (8 months ago)
- Topics: graphics, js, nim, webgl
- Language: Nim
- Homepage: http://stisa.space/webgl
- Size: 207 KB
- Stars: 24
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
WebGL in Nim
=========
Experimental wrapper to webgl for Nim (JS backend).
Mostly taken from [mozilla webgl api](https://developer.mozilla.org/en-US/docs/Web/API/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](https://github.com/tparisi/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](http://stisa.space/webgl/)
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:]
```
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