Skip to content

Conversation

@aquagoose
Copy link
Contributor

Summary of the PR

Adds a simple IHandle struct for XYZHandle structs, and implements an IsNull property.

Related issues, Discord discussions, or proposals

https://discord.com/channels/521092042781229087/587346162802229298/1443561471245291592

Further Comments

Only tested locally with SDL.


namespace Silk.NET.Core;

public interface IHandle
Copy link
Member

Choose a reason for hiding this comment

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

Missing docs comments are resulting in compilation failure.

Comment on lines +719 to +720
CastExpression(IdentifierName("IntPtr"), IdentifierName("Handle")),
LiteralExpression(SyntaxKind.NumericLiteralExpression, Literal(0))
Copy link
Member

Choose a reason for hiding this comment

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

Could we do this == default to make it agnostic to non-pointer-sized handles?


namespace Silk.NET.Core;

public interface IHandle
Copy link
Member

Choose a reason for hiding this comment

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

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.

@github-project-automation github-project-automation bot moved this from Todo to In Progress in Silk.NET Development Tracker Nov 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

2 participants