-
Notifications
You must be signed in to change notification settings - Fork 507
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
.NET: Clear the OpenTK namespace #13160
Comments
For OpenTK.Matrix2, OpenTK.Matrix3 and OpenTK.Matrix4d I wonder if you could use |
Sadly not, value tuples have auto layout rather than sequential: not suitable for interop...
Note: Vector isn't quite akin to Vector2, namely it's variably sized and actually might hold more than 2 Ts in some cases. Because of this, the memory layout probably isn't suitable for your needs (interop, presumably?) There's a proposal for generic "dimensional" vectors (dotnet/runtime#24168), but these have been postponed to .NET 7. The best solution is probably to whip up your own vectors in a Xamarin namespace. When .NET 7 generic vectors become available, either implicit casts can be added or throw those types out if you still feel in the mood to break things between major releases. For your reference: We've been down this road and made our own maths library which fills these holes for us (i.e. MathHelper, called Scalar in our library; and generic vector types like Vector2D). It's possibly a bit overkill for what Xamarin needs, but figured I'd drop it here for your reference (please change the namespace if you use anything): https://github.com/dotnet/Silk.NET/tree/main/src/Maths/Silk.NET.Maths One more thing to add is please don't call anything VectorN or MatrixNxN regardless of namespace as these will conflict with System.Numerics if ever they get those types as well if users are using both namespaces - this is why the above link uses VectorND for its vectors and a capital X for its matrices. |
Clean the OpenTK namespace, part 0: remove unused types (#13160) Removing: - Box2, - Functions - Half - Vector[2|3|4]h - BezierCuve*
fixes #13160 - removes unused types - use System.Numerics when possible - move own created types from OpenTK namespace to CoreGraphics - create missing types in CoreGraphics namespace
fixes #13160 - removes unused types - use System.Numerics when possible - move own created types from OpenTK namespace to CoreGraphics - create missing types in CoreGraphics namespace
fixes #13160 - removes unused types - use System.Numerics when possible - move own created types from OpenTK namespace to CoreGraphics - create missing types in CoreGraphics namespace
fixes #13160 - removes unused types - use System.Numerics when possible - move own created types from OpenTK namespace to CoreGraphics - create missing types in CoreGraphics namespace
fixes #13160 - removes unused types - use System.Numerics when possible - move own created types from OpenTK namespace to CoreGraphics - create missing types in CoreGraphics namespace
fixes #13160 - removes unused types - use System.Numerics when possible - move own created types from OpenTK namespace to CoreGraphics - create missing types in CoreGraphics namespace
fixes #13160 - removes unused types - use System.Numerics when possible - move own created types from OpenTK namespace to CoreGraphics - create missing types in CoreGraphics namespace
fixes #13160 - removes unused types - use System.Numerics when possible - move own created types from OpenTK namespace to CoreGraphics - create missing types in CoreGraphics namespace
fixes #13160 - remove unused types - use System.Numerics when possible - move own created types from OpenTK namespace to CoreGraphics - create missing types in CoreGraphics namespace Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
Types in the OpenTK namespace
We want to remove types from the OpenTK namespace, and these types fall in three categories:
One important question is which namespace to use for 2. Options:
OpenTK
. This is not an option, because that's exactly what we're trying to move away from.ObjCRuntime
: not really very math-like, and this namespace shouldn't become a catch-all for everything that doesn't fit elsewhere either.CoreNumerics
: A mix of Apple's Core* frameworks with System.Numerics.CoreMath
: same as 3.CoreGraphics
: existing Apple namespace. Con: might end up with a name clash in the future depending on what Apple does.Ref: #2571
Ref: https://bugzilla.xamarin.com/show_bug.cgi?id=58599
Different type
The following types have an equivalent in .NET, so the proposal is to use that type instead:
Different namespace
The following OpenTK types have no equivalent in .NET, so the proposal is to copy the OpenTK implementation, but use a different namespace.
The following are types that we created ourselves, but put in the OpenTK namespace.
Types to remove
The following types don't seem to be used by any other API, so they can be removed
Don't know yet
Ref: #13087
The text was updated successfully, but these errors were encountered: