MochiLibraries / Mochi.DearImGui

Automatically generated low-level C# bindings for Dear ImGui
MIT License
26 stars 8 forks source link

Vector4 is different from imvec4 #2

Closed AhmedZero closed 2 years ago

AhmedZero commented 2 years ago

order of vector4 is different from imvec4

struct ImVec4
{
    float                                                     x, y, z, w;
    constexpr ImVec4()                                        : x(0.0f), y(0.0f), z(0.0f), w(0.0f) { }
    constexpr ImVec4(float _x, float _y, float _z, float _w)  : x(_x), y(_y), z(_z), w(_w) { }
#ifdef IM_VEC4_CLASS_EXTRA
    IM_VEC4_CLASS_EXTRA     // Define additional constructors and implicit cast operators in imconfig.h to convert back and forth between your math types and ImVec4.
#endif
};
 public struct Vector4 : IEquatable<Vector4>, IFormattable
    {
        public float W;

        public float X;

        public float Y;

        public float Z;
}
PathogenDavid commented 2 years ago

I assume you closed since they are in fact the same layout, but thanks for double-checking me!

Out of curiosity, what were you looking at that showed W coming first?

Also FYI, I just published v0.0.1, which greatly improves how C++ references on Dear ImGui's API surface are exposed in C#.

AhmedZero commented 2 years ago

In my VS 2022, I think it's a VS problem, it's ordered the fields by alphabetical not by layout struct.

PathogenDavid commented 2 years ago

Ah yeah, I forgot the metadata view did that. You might consider enabling navigation to decompiled sources. It's quite a bit more useful most of the time.