Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify how custom renderers should use on remove method #517

Merged
merged 1 commit into from
Mar 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/docs/extension/three-custom-renderer.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class ThreeCubeRenderer {

### `onRemove`

ICustomRenderer.[onRemove](/api/interfaces/viewer.icustomrenderer#onremove) is called when the renderer has been removed from the `Viewer` with the Viewer.[removeCustomRenderer](/api/classes/viewer.Viewer#addcustomrenderer) method. This gives us a chance to clean up our Three.js resources (and potential event listeners etc).
ICustomRenderer.[onRemove](/api/interfaces/viewer.icustomrenderer#onremove) is called when the renderer has been removed from the `Viewer` with the Viewer.[removeCustomRenderer](/api/classes/viewer.Viewer#addcustomrenderer) method. This gives us a chance to clean up our Three.js resources (and potential event listeners etc). Everything that we created in the `onAdd` method should be disposed and cleaned up now.

```js
class ThreeCubeRenderer {
Expand Down
2 changes: 1 addition & 1 deletion doc/docs/extension/webgl-custom-renderer.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ class WebGLCubeRenderer {

### `onRemove`

ICustomRenderer.[onRemove](/api/interfaces/viewer.icustomrenderer#onremove) is called when the renderer has been removed from the `Viewer` with the Viewer.[removeCustomRenderer](/api/classes/viewer.Viewer#addcustomrenderer) method. This gives us a chance to clean up our WebGL resources (and potential event listeners etc).
ICustomRenderer.[onRemove](/api/interfaces/viewer.icustomrenderer#onremove) is called when the renderer has been removed from the `Viewer` with the Viewer.[removeCustomRenderer](/api/classes/viewer.Viewer#addcustomrenderer) method. This gives us a chance to clean up our WebGL resources (and potential event listeners etc). Everything that we created in the `onAdd` method should be dispose and cleaned up now.

```js
class WebGLCubeRenderer {
Expand Down