Can i load resource from native extension?
I can use sys.load_resource from lua then pass string to native, but loading it from c++ will be better.
We do not currently expose any IO functions in the extension SDK. For now you have to load on the Lua side and pass on to your extension code.
You can load resource buffers with resource.load(). That one you can pass to the extension and then get with dmScript::CheckBuffer().
Ok. But no way without lua?
No, not at this point. And to be honest, I don’t think accessing it directly from C++ makes it “better” (or even easier). It would however increase our API. We wish to keep the API as small as possible in order for us to maintain a robust sdk in the long run. Thus, we choose to support buffers, and let all communication go via Lua.
sys.load_resource enough for me. I load json.
I think you are right.Keep api as small as possible sounds good.