No description
Find a file
Silvio 1196ef8df2
Merge pull request #2 from Smittyvb/master
Fix logging code on latest Nim
2020-07-28 14:32:25 +02:00
docs fix canvas having duplicate clienWidth, clientHeight since they are now in dom.Element. Also update docs,examples 2017-05-10 19:12:09 +02:00
examples BREAKING: move to using enums 2017-03-11 21:18:29 +01:00
oldwrapper preparations to rewrite 2017-03-02 23:40:05 +01:00
src Make log a template 2019-05-25 08:43:46 -04:00
templates use exampler for generating docs, rebuild docs 2017-03-04 16:30:23 +01:00
.gitignore add to gitignore 2017-03-04 15:30:52 +01:00
LICENSE Initial commit 2016-07-20 13:48:30 +02:00
README.md update readme 2016-09-19 22:03:04 +02:00
webgl.nimble Bump patch version 2019-05-24 20:17:37 -04:00

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