云风
云风
OK :) Could you send a pull-request to help me make a rockspec file ?
userdata 可以是 lua full userdata, 也可以是 light userdata 。所以你要么构造一个 full userdata ,要么直接传 C 指针,也就是 light userdata 。这些都依赖你额外用 C 实现一个 api 供 lua 调用。
如果要用字典,key 就不可以是 number ,只能是 string 。如果是 Array 这要求必须 key 为连续的 integer 。所以这个测试案例本身是错误的用法,这里的 t 本身不是一个可以合法 encode 成 bson 对象的 table 。 参见 http://bsonspec.org/spec.html 中 element 和 array 的定义。
To generate C++ header, we may need annotate the default value. How about ```lua func.frame "uint32_t" .capture "bool" { default = false } ```
I rewrite the test.lua for better code gen. https://github.com/cloudwu/bgfxidl/blob/master/test.lua#L973-L1020
Ok, I will use the same license of bgfx.
License added. Maybe we can design a new DSL for bgfx shader. lua interpreter is small as C Preprocessor , and we can keep it simple but more flexible.
> Another thing. It would be good that IDL for class members automatically add their class name to function. > > For example: > `func.Encoder.setInstanceDataBuffer { cname = "encoder_set_instance_data_from_dynamic_vertex_buffer" }`...
> > Maybe we can design a new DSL for bgfx shader. lua interpreter is small as C Preprocessor , and we can keep it simple but more flexible. >...
I will add enum define first.