Skip to content

fix(types): correct defaultViewAPI typing#3502

Open
PaulHax wants to merge 1 commit intoKitware:masterfrom
PaulHax:default-view-api-typing
Open

fix(types): correct defaultViewAPI typing#3502
PaulHax wants to merge 1 commit intoKitware:masterfrom
PaulHax:default-view-api-typing

Conversation

@PaulHax
Copy link
Copy Markdown
Collaborator

@PaulHax PaulHax commented May 7, 2026

defaultViewAPI is a string at runtime ('WebGL' / 'WebGPU'), but the types
disagreed:

  • DEFAULT_VIEW_API was a const enum with numeric values, so
    setDefaultViewAPI(DEFAULT_VIEW_API.WebGPU) would pass 1 and silently
    fall back to WebGL.
  • IFullScreenRenderWindowInitialValues.defaultViewAPI was typed boolean.

Switch DEFAULT_VIEW_API to a string union (same exported name) and reuse it.
No runtime changes. Related: #3216, #3139.

defaultViewAPI is a string at runtime ('WebGL' / 'WebGPU'), but the types
disagreed:

- DEFAULT_VIEW_API was a const enum with numeric values, so
  setDefaultViewAPI(DEFAULT_VIEW_API.WebGPU) would pass 1 and silently
  fall back to WebGL.
- IFullScreenRenderWindowInitialValues.defaultViewAPI was typed boolean.

Switch DEFAULT_VIEW_API to a string union (same exported name) and reuse
it. No runtime changes. Related: Kitware#3216, Kitware#3139.
Copy link
Copy Markdown
Collaborator

@daker daker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants