Skip to content
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

Binding generation compile needs some work #2594

Open
cNori opened this issue May 12, 2024 · 0 comments
Open

Binding generation compile needs some work #2594

cNori opened this issue May 12, 2024 · 0 comments
Labels
scripting suggestion Idea or improvement suggestion tools
Milestone

Comments

@cNori
Copy link
Contributor

cNori commented May 12, 2024

Issue description:

Classes

there was almost a 3 major engine version and the nested classes are not supported yet,
limiting a decision choices for systems with out prefix evry think with the name
as a example:

API_CLASS() class EelementData
{
...
};
API_CLASS() class Eelement
{
...
private:
    API_FIELD()  EelementData m_Data;
};

and because only classes are nullabke in c# by default
structs cannot be used. because the bindings are not supporting a C# optionals [Data? data = null;]

Structs

  • structs and propertys are not suported yet
  • hiden structs fields not suported yet
  • structs not suporting a funcions
  • structs losing data
  • add support for API functions in structures (needed for Serialize(NetworkStream* stream))

with leads to this design because it is foreced on to a user
c++ side

API_STRUCT(NoPod) struct MODULE_API Data  :  public INetworkSerializable
{
...
        API_FIELD(internal) bool m_IsDirty; //needed to be exposed othere wise the flax C# Glue layer will remove it when pasing betwine c# and c++ and back
        /// <summary>
        /// Use Getter and Seter insted
        /// </summary>
        API_FIELD(internal) String m_Name;
        void SetName(const String& name);
        const String& GetName() const;
...
};

c# side needs a extra code

pubkic parsial struct Data 
{
        [NoSerialize]
        public string Name
        {
            get => m_Name;
            set
            {
               Name = value;
               m_IsDirty = true;
            }
        }
}
@mafiesto4 mafiesto4 added tools suggestion Idea or improvement suggestion scripting labels May 14, 2024
@mafiesto4 mafiesto4 added this to the 1.9 milestone May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scripting suggestion Idea or improvement suggestion tools
Projects
None yet
Development

No branches or pull requests

2 participants