Skip to content

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

Open
@Orcolom

Description

@Orcolom

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions