3.0 - Simple IHandle interface for XYZHandle structs#2504
Open
aquagoose wants to merge 1 commit intodotnet:develop/3.0from
Open
3.0 - Simple IHandle interface for XYZHandle structs#2504aquagoose wants to merge 1 commit intodotnet:develop/3.0from
aquagoose wants to merge 1 commit intodotnet:develop/3.0from
Conversation
Perksey
requested changes
Nov 29, 2025
|
|
||
| namespace Silk.NET.Core; | ||
|
|
||
| public interface IHandle |
Member
There was a problem hiding this comment.
Missing docs comments are resulting in compilation failure.
Comment on lines
+719
to
+720
| CastExpression(IdentifierName("IntPtr"), IdentifierName("Handle")), | ||
| LiteralExpression(SyntaxKind.NumericLiteralExpression, Literal(0)) |
Member
There was a problem hiding this comment.
Could we do this == default to make it agnostic to non-pointer-sized handles?
|
|
||
| namespace Silk.NET.Core; | ||
|
|
||
| public interface IHandle |
Member
There was a problem hiding this comment.
Hmmm on second thought, maybe we could do IHandle<TSelf> : IEquatable<TSelf>, IEqualityOperators<TSelf, TSelf, bool>? At this point we totally negate the need for IsNull as users generalising over T: IHandle<T>>? Could maybe keep this non-generic interface and DIM it in the generic one if we want (is that a thing?) If we go that route no changes will be required to TransformHandles other than the base list.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of the PR
Adds a simple IHandle struct for XYZHandle structs, and implements an
IsNullproperty.Related issues, Discord discussions, or proposals
https://discord.com/channels/521092042781229087/587346162802229298/1443561471245291592
Further Comments
Only tested locally with SDL.