chrisdill / raylib-cs

C# bindings for raylib, a simple and easy-to-use library to learn videogames programming

Home Page:http://www.raylib.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug] Fix names in structs!

MrScautHD opened this issue · comments

Before submitting a new issue, please verify and check:

  • The issue is specific to Raylib-cs and not raylib
  • I checked there is no similar issue already reported
  • My code has no errors or misuse of Raylib-cs

Issue description

Hello, i saw variable names that not agree with the C# rules.

Example:

Yours:

    public partial struct Transform
    {
        /// <summary>
        /// Translation
        /// </summary>
        public Vector3 translation;

        /// <summary>
        /// Rotation
        /// </summary>
        public Quaternion rotation;

        /// <summary>
        /// Scale
        /// </summary>
        public Vector3 scale;
    }

How it should look like:

    public partial struct Transform
    {
        /// <summary>
        /// Translation
        /// </summary>
        public Vector3 Translation;

        /// <summary>
        /// Rotation
        /// </summary>
        public Quaternion Rotation;

        /// <summary>
        /// Scale
        /// </summary>
        public Vector3 Scale;
    }

Environment

*Raylib-cs

@ChrisDill What you think about it?

Open to trying this out and Transform seems like a good place to start with this.

This will require all existing code using this struct to be updated. Are we going to limit this to the next major release?

Its not that big deal, but lets talk to chrisdill

@MrScautHD It is a breaking change so I agree with @9ParsonsB that it should go into a major release. Considering creating a separate branch to track and test breaking changes like this.

@MrScautHD It is a breaking change so I agree with @9ParsonsB that it should go into a major release. Considering creating a separate branch to track and test breaking changes like this.

ok, yea then lets do a own branch for it.

Can you create one, so we can do pull requests for it?

@MrScautHD Done, dev branch created. Can you fix the conflicts then I can merge it in.

thx, yea sure

@MrScautHD Done, dev branch created. Can you fix the conflicts then I can merge it in.

I resolved the conflicts :)

@ChrisDill is there anything that need todo?

I have added a dev branch to the examples to test the changes and check for any issues. Looks good so far!

Nothing specific at the moment. Thinking about other design changes I may make but have not decided yet.

I have added a dev branch to the examples to test the changes and check for any issues. Looks good so far!

Nothing specific at the moment. Thinking about other design changes I may make but have not decided yet.

i made some checkes too, and it looks fine for me.

Yes Please!
I always hated how raylib-cs didn't use C# naming conventions.

I saw you renamed the Rlgl methods what about we remove from the methods the rl

@MrScautHD Initially I changed them back to get it working with the examples. Now that is done we can try removing the prefix and see how that looks. Needs the EntryPoint to be set so the name can be different.

@MrScautHD Initially I changed them back to get it working with the examples. Now that is done we can try removing the prefix and see how that looks. Needs the EntryPoint to be set so the name can be different.

yea i forgot about the EntryPoint...

Instead of:

[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern void rlEnd();

Lets do:

[DllImport(NativeLibName, EntryPoint = "rlEnd", CallingConvention = CallingConvention.Cdecl)]
public static extern void End();

If you agree with that i could do that for the full class

        // GL blending functions/equations
        public const int RL_FUNC_ADD = 0x8006;
        public const int RL_MIN = 0x8007;
        public const int RL_MAX = 0x8008;
        public const int RL_FUNC_SUBTRACT = 0x800A;
        public const int RL_FUNC_REVERSE_SUBTRACT = 0x800B;
        public const int RL_BLEND_EQUATION = 0x8009;
        public const int RL_BLEND_EQUATION_RGB = 0x8009;
        public const int RL_BLEND_EQUATION_ALPHA = 0x883D;
        public const int RL_BLEND_DST_RGB = 0x80C8;
        public const int RL_BLEND_SRC_RGB = 0x80C9;
        public const int RL_BLEND_DST_ALPHA = 0x80CA;
        public const int RL_BLEND_SRC_ALPHA = 0x80CB;
        public const int RL_BLEND_COLOR = 0x8005;

Should we remove the RL before the names to?

it would looks way cleaner... i removed it with my latest pull request.

And i would suggest to rename the Raylib_cs namespace to Raylib