daFrameGraph in Daslang + ECS

Nodes can be stored in ECS singleton and in this case there is special function annotation _stdlib_fg_ecs for hot reloading.

Function should take NodeHandle or NodeHandleVector as first argument and set up it.

Another arguments of function can be any other components of singleton entity and will be passed to es macro as is.

Possible arguments for fg_ecs_node annotation itself:

  • on_appear - call function on appear of entity.

  • on_event=EventName - call function on event.

  • track=component_name - call function on change of component.

Example:

require daFrameGraph.fg_ecs

[fg_ecs_node(on_appear)]
def register_some_node(var some_node : NodeHandle&)
  some_node <- root() |> registerNode("some_node") <| @(var registry : Registry)

    // Node requests, for example:
    registry |> requestRenderPass |> color([[auto[] "some_tex"]])

    return <- @ <|

      // Render code, for example:
      query() <| $ [es] (some_shader : PostFxRenderer)
        some_shader |> render()

Function Annotations

fg_ecs_node

|function_annotation-fg_ecs-fg_ecs_node|

Classes

FgEcsNodeAnnotation : AstFunctionAnnotation

|class-fg_ecs-FgEcsNodeAnnotation|

FgEcsNodeAnnotation.apply(self: AstFunctionAnnotation; func: FunctionPtr; group: ModuleGroup; args: AnnotationArgumentList const; errors: das_string)

apply returns bool

argument

argument type

self

ast::AstFunctionAnnotation

func

FunctionPtr

group

rtti::ModuleGroup

args

rtti::AnnotationArgumentList const

errors

builtin::das_string

|method-fg_ecs-FgEcsNodeAnnotation.apply|

FgEcsNodeAnnotation.declareReloadCallback(self: FgEcsNodeAnnotation; func: FunctionPtr; parsed: FgEcsNodeAnnotationArgs const; args: AnnotationArgumentList const)

argument

argument type

self

fg_ecs::FgEcsNodeAnnotation

func

FunctionPtr

parsed

fg_ecs::FgEcsNodeAnnotationArgs const

args

rtti::AnnotationArgumentList const

|method-fg_ecs-FgEcsNodeAnnotation.declareReloadCallback|

FgEcsNodeAnnotation.declareES(self: FgEcsNodeAnnotation; func: FunctionPtr; parsed: FgEcsNodeAnnotationArgs const; args: AnnotationArgumentList const)

argument

argument type

self

fg_ecs::FgEcsNodeAnnotation

func

FunctionPtr

parsed

fg_ecs::FgEcsNodeAnnotationArgs const

args

rtti::AnnotationArgumentList const

|method-fg_ecs-FgEcsNodeAnnotation.declareES|

FgEcsNodeAnnotation.parseArgs(self: FgEcsNodeAnnotation; func: FunctionPtr; args: AnnotationArgumentList const; errors: das_string)

parseArgs returns fg_ecs::FgEcsNodeAnnotationArgs

argument

argument type

self

fg_ecs::FgEcsNodeAnnotation

func

FunctionPtr

args

rtti::AnnotationArgumentList const

errors

builtin::das_string

|method-fg_ecs-FgEcsNodeAnnotation.parseArgs|