Developing C++ extension in Defold itself is ugly (no code completion or anything except for syntax highlighting, but it also sometimes doesn’t work properly). I want to develop my extension in VSCode, but I need dmsdk/sdk.h file, so that code completion and other stuff worked. Here is said that the file is not published anywhere: https://defold.com/manuals/extensions-defold-sdk/ - is it still the case knowing that the engine is open source now? Where can I download those header files if they are in fact available?
I’ve found this: https://github.com/defold/defold/tree/dev/engine/dlib/src/dmsdk
But I’m not sure it is what I’m looking for, and there is no sdk.h in it.
Hi! sdk.h can be found here:
You can find this file in https://d.defold.com/archive/stable/f34b08dc12af1101ae62c6e880b6373a03206174/engine/defoldsdk.zip (for Defold 1.2.180) and all other exposed headers. The Defold build server uses this .zip to build native extensions.
Thanks for pointing this out! I’ve updated the page with links to the header files.
Just if you needed; vscode snippets contain all lua + c/c++ api for code completion
Thanks, everyone! I’ve downloaded the SDK and added include folder to compiler’s include search path, everything seems to be working fine.
Oh, this looks nice, what additional extensions do I need to work with Defold’s Lua scripts in VSCode? EmmyLua only? Or do I need to add all extensions mentioned in a README.md?
This is just a snippets so it works by its own. You don’t have to do anything else but it is highly suggested.
Emmylua is not necessary. EmmyLua is a nice lua language server. I recommend it. But you can use anything you want for lua linting, lua syntax checking…
For Lua, it would be better to define extensions. But it is not necessary too. You can choose language from bottom right of the vscode if you like. For c/c++, you don’t need to do anything.