[WIP] Provide pip package management #15
GeorgeS2019
started this conversation in
General
Replies: 2 comments
-
// Entry point called by Godot
DLL_EXPORT GDExtensionBool pythonscript_init(
const GDExtensionInterfaceGetProcAddress p_get_proc_address,
const GDExtensionClassLibraryPtr p_library,
GDExtensionInitialization *r_initialization
) {
if (state != STALLED) {
printf("Pythonscript: Invalid internal state (this should never happen !)\n");
goto error;
}
state = ENTRYPOINT_CALLED;
if (p_get_proc_address == NULL || p_library == NULL || r_initialization == NULL) {
printf("Pythonscript: Invalid init parameters provided by Godot (this should never happen !)\n");
goto error;
}
// `pythonscript_gdextension_*` must be set as early as possible given it is never
// null-pointer checked, especially in the Cython modules
pythonscript_gdextension_get_proc_address = p_get_proc_address;
pythonscript_gdextension_library = p_library;
// Check compatibility between the Godot version that has been used for building
// (i.e. the bindings has been generated against) and the version currently executed.
GDExtensionGodotVersion godot_version;
{
GDExtensionInterfaceGetGodotVersion get_godot_version = (GDExtensionInterfaceGetGodotVersion)p_get_proc_address("get_godot_version");
get_godot_version(&godot_version);
}
if (godot_version.major != GODOT_VERSION_MAJOR || godot_version.minor < GODOT_VERSION_MINOR) {
char buff[256];
snprintf(
buff,
sizeof(buff),
"Pythonscript: Incompatible Godot version (expected ~%d.%d, got %s)\n",
GODOT_VERSION_MAJOR,
GODOT_VERSION_MINOR,
godot_version.string
);
GD_PRINT_ERROR(buff);
goto error;
}
// Initialize as early as possible, this way we can have 3rd party plugins written
// in Python/Cython that can do things at this level
r_initialization->minimum_initialization_level = GDEXTENSION_INITIALIZATION_CORE;
r_initialization->userdata = NULL;
r_initialization->initialize = _initialize;
r_initialization->deinitialize = _deinitialize;
state = ENTRYPOINT_RETURNED;
return true;
error:
state = CRASHED;
return false;
} |
Beta Was this translation helpful? Give feedback.
0 replies
-
PYTHONHOME versus GODOT_PYTHON_MODULE_LIB_DIR
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
#9 (comment)
Beta Was this translation helpful? Give feedback.
All reactions