Used as a global class to create a GPUCurtainsRenderer, create all objects that need a reference to a renderer, listen to various events such as scroll and resize and render.

// set our main GPUCurtains instance
const gpuCurtains = new GPUCurtains({
container: '#canvas' // selector of our WebGPU canvas container
})

// set the GPU device
// note this is asynchronous
await gpuCurtains.setDevice()

Constructors

Properties

type: string

The type of this GPUCurtains

Options used to create this GPUCurtains

container: HTMLElement

HTMLElement that will hold the WebGPU HTMLCanvasElement

deviceManager: GPUDeviceManager

GPUDeviceManager used to handle the GPUAdapter and GPUDevice

scrollManager: ScrollManager

Tiny scroll event listener wrapper

_onScrollCallback: () => void = ...

function assigned to the onScroll callback

_onErrorCallback: () => void = ...

function assigned to the onError callback

_onContextLostCallback: (info?: GPUDeviceLostInfo) => void = ...

function assigned to the onContextLost callback

_onContextDestroyedCallback: (info?: GPUDeviceLostInfo) => void = ...

function assigned to the onContextLost callback

Accessors

Methods