@playcanvas/react
Version:
A React renderer for PlayCanvas – build interactive 3D applications using React's declarative paradigm.
18 lines (17 loc) • 958 B
TypeScript
import { DEVICETYPE_WEBGL2, DEVICETYPE_WEBGPU, DEVICETYPE_NULL, GraphicsDevice } from "playcanvas";
import { GraphicsDeviceOptions } from "../types/graphics-device-options.ts";
/**
* Creates a graphics device with fallbacks.
*
* This is functionally very similar to the createGraphicsDevice function in PlayCanvas,
* but **importantly** it does not inject additional graphics devices when none are specified!
*
* This is necessary because often we want explicitly specify the device types we want to use,
* eg a Null device without WebGL2 or WebGPU.
*
* This function is used internally by the Application component, and is also exported for use in other contexts.
*/
export declare function internalCreateGraphicsDevice(canvas: HTMLCanvasElement, options?: GraphicsDeviceOptions & {
deviceTypes?: DeviceType[];
}): Promise<GraphicsDevice>;
export type DeviceType = typeof DEVICETYPE_WEBGPU | typeof DEVICETYPE_WEBGL2 | typeof DEVICETYPE_NULL;