contextLossHandler MethodStatic

A function that is invoked after the WebGL context is lost. Context loss is almost always caused by excessive consumption of GPU memory. After context loss occurs, the RenderSystem will be unable to interact with WebGL by rendering viewports, creating graphics and textures, etc. By default, this function invokes ToolAdmin.exceptionHandler with a brief message describing what occurred. An application can override this behavior as follows:

RenderSystem.contextLossHandler = (): Promise<any> => {
 // your implementation here.
}

contextLossHandler(): Promise<any>

@note Context loss is reported by the browser some short time after it has occurred. It is not possible to determine the specific cause.

@see - TileAdmin.gpuMemoryLimit to limit the amount of GPU memory consumed thereby reducing the likelihood of context loss.

Returns - Promise<any>

Defined in

Last Updated: 20 April, 2024