KEMBAR78
Remap common numeric types by kennykerr · Pull Request #3524 · microsoft/windows-rs · GitHub
Skip to content

Conversation

@kennykerr
Copy link
Collaborator

The windows-numerics crate provides graphics-oriented math types like Vector2 and Matrix3x2 but there are a number of older DirectX types that predate Windows numerics and can benefit from a common optimized implementation with suitable overloads and helpers.

The followings numeric types are currently remapped:

  • D2D_MATRIX_3X2_F -> Matrix3x2
  • D3DMATRIX -> Matrix4x4

The following are added in this update:

  • D2D_POINT_2F -> Vector2
  • D2D_VECTOR_2F -> Vector2
  • D2D_VECTOR_4F -> Vector4

I also removed some of the TypeName constants and just included their literal names directly in the remapping function as that's the only place where these types are named and this makes it a bit clearer as to what's actually being remapped.

@kennykerr kennykerr changed the title Remap a few more common numeric types Remap common numeric types Feb 28, 2025
@kennykerr kennykerr requested a review from robmikh February 28, 2025 21:47
@kennykerr kennykerr merged commit 428c39a into master Feb 28, 2025
34 checks passed
@kennykerr kennykerr deleted the remap-numerics branch February 28, 2025 22:52
@kennykerr kennykerr mentioned this pull request Mar 17, 2025
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