-
Notifications
You must be signed in to change notification settings - Fork 0
General project setup
insomniac_lemon edited this page Aug 6, 2024
·
3 revisions
Forenote: This structure or details may change, though other structures may still be continue to work.
project root
+ ├── core #this is a workspace
+ │ ├── bootstrap.nim # init_library. Imports src files+register their classes. In this dir, compile w/nim c bootstrap
+ │ ├── config.nims # technical settings, --path allows defining source code dir
+ │ ├── main.gdextension # tells Godot library location of each extension. Custom class icons also defined here
+ │ ├── lib # folder added on compile, along with its contents
+ │ │ └── libcore.so # OS specific .ext. Name from workspace, currently .toDll also adds lib prefix
+ │ └── src # code files go here
├── scenes
├── .gitattributes
├── .gitignore
├── icon.svg
├── icon.svg.import
└── project.godot
See quick_template for file contents.
Notes:
- workspace name is user choice
- workspaces may be nested for multiple extensions
- or at the same level for instance /addons/ may also be used alongside another workspace
- .gdextension may be auto-generated in the future
- .gdextension file can have any name...
- but you will need to open+close+reopen the Godot editor for it to properly reload after rename
- .gdextension file can have any name...
- config.nims can also go at root (or in /addons/ etc) to act as default for all extensions below it
- if doing so, a file like
bootstrapconf.nimsmay be used to add extension-specific changes
- if doing so, a file like
- you may register classes in your code after they are defined
- this only really makes sense if you're creating a lot of classes in one file as...
- the file still needs to be imported into init_library (bootstrap.nim), giving a warning, so...
- you will want
{.warning[UnusedImport]:off.}at the top of the init file for that
- bootstrap.nim may also be renamed, but this means your compile command will differ
- currently, desiredname.cfg in workspace folder with contents
--define: ExtensionMain:desiredname - doing so will change your library name to libdesiredname.ext
- via the same file you may also change the src folder to another directory for a custom structure
- for instance
--path: "$projectdir/../othername/src"...- allows you to have an additional folder at the same level as your extension where your src folder is
- for instance
- currently, desiredname.cfg in workspace folder with contents