Skip to content

fix(types): correct defaultViewAPI typing#3502

Merged
finetjul merged 1 commit into
Kitware:masterfrom
PaulHax:default-view-api-typing
May 11, 2026
Merged

fix(types): correct defaultViewAPI typing#3502
finetjul merged 1 commit into
Kitware: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

Copy link
Copy Markdown
Member

@finetjul finetjul left a comment

Choose a reason for hiding this comment

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

LGTM

@finetjul finetjul added this pull request to the merge queue May 11, 2026
Merged via the queue into Kitware:master with commit c4b7e87 May 11, 2026
2 checks passed
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 35.15.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions Bot added the released Automated label label May 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Automated label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants