mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
28 lines
593 B
TypeScript
28 lines
593 B
TypeScript
import * as React from 'react';
|
|
import * as ReactDOM from 'react-dom';
|
|
import { Surface } from 'gl-react-native';
|
|
import { Shaders, GLSL, Node } from 'gl-react';
|
|
|
|
const shaders = Shaders.create({
|
|
Test: {
|
|
frag: GLSL`
|
|
precision highp float;
|
|
varying vec2 uv;
|
|
void main() {
|
|
gl_FragColor = vec4(uv.x, uv.y, 0.5, 1.0);
|
|
}`
|
|
}
|
|
});
|
|
|
|
const App = () => (
|
|
<div>
|
|
<Surface>
|
|
<Node shader={shaders.HelloBlue} />
|
|
</Surface>
|
|
</div>
|
|
);
|
|
|
|
const element = document.createElement('div');
|
|
document.body.appendChild(element);
|
|
ReactDOM.render(<App />, element);
|