expo-gl
Version:
Provides GLView that acts as OpenGL ES render target and gives GL context object implementing WebGL 2.0 specification.
30 lines • 1.42 kB
TypeScript
import * as React from 'react';
import { WebGLObject } from './GLView';
import { GLViewProps, GLSnapshot, SnapshotOptions, ComponentOrHandle } from './GLView.types';
export type GLViewWebProps = GLViewProps & {
onContextCreate: (gl: WebGLRenderingContext) => void;
onContextRestored?: (gl?: WebGLRenderingContext) => void;
onContextLost?: () => void;
webglContextAttributes?: WebGLContextAttributes;
nativeRef_EXPERIMENTAL?(callback: ComponentOrHandle | HTMLCanvasElement | null): any;
};
export declare class GLView extends React.Component<GLViewWebProps> {
canvas?: HTMLCanvasElement;
gl?: WebGLRenderingContext;
static createContextAsync(): Promise<WebGLRenderingContext | null>;
static destroyContextAsync(exgl?: WebGLRenderingContext | number): Promise<boolean>;
static takeSnapshotAsync(gl: WebGLRenderingContext, options?: SnapshotOptions): Promise<GLSnapshot>;
componentWillUnmount(): void;
render(): JSX.Element;
componentDidUpdate(prevProps: any): void;
private getGLContextOrReject;
private onContextLost;
private onContextRestored;
private getGLContext;
private setCanvasRef;
takeSnapshotAsync(options?: SnapshotOptions): Promise<GLSnapshot>;
startARSessionAsync(): Promise<void>;
createCameraTextureAsync(): Promise<void>;
destroyObjectAsync(glObject: WebGLObject): Promise<void>;
}
//# sourceMappingURL=GLView.web.d.ts.map