Last active
July 22, 2019 18:37
-
-
Save DrewDahlman/775bb1b79878fafba1e3bbb2ea6c0d67 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class WebGL extends React.Component { | |
state = { | |
elements: [], | |
renderer: null, | |
scene: null | |
}; | |
addImage = (image) => { | |
//.. Create Image texture & push into webgl context | |
} | |
// We wrap everything in our Effect context provider | |
render() { | |
const { children } = this.props; | |
const { elements, scene } = this.state; | |
return ( | |
<EffectContext.Provider | |
value={{ | |
elements: elements, | |
scene: scene, | |
addImage: this.addImage | |
}} | |
> | |
{children} | |
<WebGLRenderer /> | |
</EffectContext.Provider> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment