Skip to content

[need feedback, breaking change] Make package syntax more csharp 'compliant' #6

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

Open
Orcolom opened this issue Mar 4, 2025 · 0 comments

Comments

@Orcolom
Copy link
Owner

Orcolom commented Mar 4, 2025

I will explain the changes I want to make to the public facing codebase. If you find more changes are needed, agree or disagree, please let me know.

What would change.

Clay-cs still lacks a few things, we as sharp users usually expect.

  • /// XML Documentation
  • ToString implementations for Clay structs and/or a helper DebugAttributes
  • A more typical sharp naming convention, see: Clay_RenderCommandType.CLAY_RENDER_COMMAND_TYPE_IMAGE

Untill now Clay-cs has been built to be as auto-generated as possible. But some of these are not fixable through the auto-generations. This is making me lean towards having to manually build the interop guided by the changes suggested by Clay.Builder.
This would also remove the need to wrap certain methods as we could call the extern calls directly.

Typical sharp naming convention

I'm still deliberating if we should keep the Clay prefix. While you could drop it, keeping it will avoid any naming conflicts with the users' own renderers. Like Raylib's Color -> ClayColor

Structs

Currently clay structs all start with Clay_*. eg.: Clay_Dimensions, Clay_StringSlice, ...
These would be changed to ClayDimensions, ClayStringSlice, ...

I would keep the field lowercase to minimize the size of the breaking change.

Enum

While csharp definitely doesn't shy away from verbose names sometimes, Clay_RenderCommandType.CLAY_RENDER_COMMAND_TYPE_SCISSOR_START and Clay_LayoutAlignmentX.CLAY_ALIGN_X_LEFT are really long for reasons that are unnecessary for csharp. Enums like this would be renamed to ClayRenderCommandType.ScissorStart and ClayLayoutAlignmentX.Left

Hope the benefits and the reasons are clear, let me know what you think.

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

No branches or pull requests

1 participant