argl-react

argl react wrapper

Usage no npm install needed!

<script type="module">
  import arglReact from 'https://cdn.skypack.dev/argl-react';
</script>

README

argl-react

ArGL react wrapper

Install

yarn add -D argl-react

Usage

import React, { Component } from 'react'
import ReArGL from 'argl-react'

export default DotsSuzanne extends Component {
  init(argl) {
    // create shaders, camera and load models, textures here
  }
  draw(time) {
    // your draw func executes in render circle
  }
  render() {
    return (
      <ReArGL
        className="DotsSuzanne"
        width={960}
        height={540}
        init={this.init.bind(this)}
        draw={this.draw.bind(this)}
        options={
          // ArGL options here
        }/>
    )
  }

check test folder for a complete example.