FLAMEGPU2 icon indicating copy to clipboard operation
FLAMEGPU2 copied to clipboard

`LayerDescription::addHostFunction` API inconsistency

Open ptheywood opened this issue 6 months ago • 0 comments

Unlike agent functions which can be added to a LayerDescrption using an overloaded method which can take:

  • CAgentFunctionDescription
  • AgentFunctionDescription
  • AgentFn a = AgentFn()
  • const std::string &agentName, const std::string &functionName
  • const char *agentName, const char *functionName

Host Functions can only be added by a function pointer.

    void addHostFunction(FLAMEGPU_HOST_FUNCTION_POINTER func_p);

Adding an overload which takes a HostFunctionDesciption object would improve API consistency.

(I believe this will have just been missed when HostFunctionDesciption was added during the DAG implementation)

ptheywood avatar Aug 12 '24 10:08 ptheywood