mirror of
https://github.com/godotengine/gdnative-demos.git
synced 2025-12-30 21:49:05 +03:00
Updated the C demos
- removed godot_headers submodule - updated c submodules to godot-headers - updated SConstruct to compile with windows and godot-headers submodule, msvc was not picked up properly - updated api for instance_binding.c so it compiles
This commit is contained in:
18
.gitmodules
vendored
18
.gitmodules
vendored
@@ -1,9 +1,9 @@
|
||||
[submodule "c/simple/godot_headers"]
|
||||
path = c/simple/godot_headers
|
||||
url = https://github.com/godotengine/godot_headers
|
||||
[submodule "c/glfw/godot_headers"]
|
||||
path = c/glfw/godot_headers
|
||||
url = https://github.com/godotengine/godot_headers
|
||||
[submodule "c/instance_binding/godot_headers"]
|
||||
path = c/instance_binding/godot_headers
|
||||
url = https://github.com/godotengine/godot_headers
|
||||
[submodule "c/simple/godot-headers"]
|
||||
path = c/simple/godot-headers
|
||||
url = https://github.com/godotengine/godot-headers.git
|
||||
[submodule "c/glfw/godot-headers"]
|
||||
path = c/glfw/godot-headers
|
||||
url = https://github.com/godotengine/godot-headers.git
|
||||
[submodule "c/instance_binding/godot-headers"]
|
||||
path = c/instance_binding/godot-headers
|
||||
url = https://github.com/godotengine/godot-headers.git
|
||||
|
||||
@@ -4,7 +4,7 @@ import os, subprocess
|
||||
opts = Variables([], ARGUMENTS)
|
||||
|
||||
# Define the relative path to the Godot headers.
|
||||
godot_headers_path = "godot_headers/"
|
||||
godot_headers_path = "godot-headers/"
|
||||
|
||||
# Gets the standard flags CC, CCX, etc.
|
||||
env = DefaultEnvironment()
|
||||
@@ -64,7 +64,8 @@ elif env["platform"] == "windows":
|
||||
# This makes sure to keep the session environment variables
|
||||
# on Windows, so that you can run scons in a VS 2017 prompt
|
||||
# and it will find all the required tools.
|
||||
env.Append(ENV=os.environ)
|
||||
env = Environment(ENV=os.environ)
|
||||
opts.Update(env)
|
||||
|
||||
env.Append(CCFLAGS=["-DWIN32", "-D_WIN32", "-D_WINDOWS", "-W3", "-GR", "-D_CRT_SECURE_NO_WARNINGS"])
|
||||
if env["target"] in ("debug", "d"):
|
||||
|
||||
@@ -4,7 +4,7 @@ import os, subprocess
|
||||
opts = Variables([], ARGUMENTS)
|
||||
|
||||
# Define the relative path to the Godot headers.
|
||||
godot_headers_path = "godot_headers/"
|
||||
godot_headers_path = "godot-headers/"
|
||||
|
||||
# Gets the standard flags CC, CCX, etc.
|
||||
env = DefaultEnvironment()
|
||||
@@ -64,7 +64,8 @@ elif env["platform"] == "windows":
|
||||
# This makes sure to keep the session environment variables
|
||||
# on Windows, so that you can run scons in a VS 2017 prompt
|
||||
# and it will find all the required tools.
|
||||
env.Append(ENV=os.environ)
|
||||
env = Environment(ENV=os.environ)
|
||||
opts.Update(env)
|
||||
|
||||
env.Append(CCFLAGS=["-DWIN32", "-D_WIN32", "-D_WINDOWS", "-W3", "-GR", "-D_CRT_SECURE_NO_WARNINGS"])
|
||||
if env["target"] in ("debug", "d"):
|
||||
|
||||
@@ -23,7 +23,7 @@ typedef struct wrapper_object {
|
||||
char *message;
|
||||
} wrapper_object;
|
||||
|
||||
void *create_wrapper_object(void *data, godot_object *object) {
|
||||
void *create_wrapper_object(void *data, const void *global_type_tag, godot_object *object) {
|
||||
printf("we are now creating a wrapper object...\n");
|
||||
fflush(stdout);
|
||||
|
||||
@@ -47,7 +47,7 @@ void GDN_EXPORT godot_gdnative_init(godot_gdnative_init_options *options) {
|
||||
api = options->api_struct;
|
||||
|
||||
// now find our extensions
|
||||
for (int i = 0; i < api->num_extensions; i++) {
|
||||
for (unsigned int i = 0; i < api->num_extensions; i++) {
|
||||
switch (api->extensions[i]->type) {
|
||||
case GDNATIVE_EXT_NATIVESCRIPT: {
|
||||
nativescript_api = (godot_gdnative_ext_nativescript_api_struct *)api->extensions[i];
|
||||
@@ -78,20 +78,23 @@ void GDN_EXPORT godot_nativescript_init(void *handle) {
|
||||
|
||||
// register instance binding functions
|
||||
{
|
||||
godot_instance_binding_functions bind = {};
|
||||
bind.alloc_instance_binding_data = &create_wrapper_object;
|
||||
bind.free_instance_binding_data = &destroy_wrapper_object;
|
||||
godot_instance_binding_functions bind = {
|
||||
.alloc_instance_binding_data = &create_wrapper_object,
|
||||
.free_instance_binding_data = &destroy_wrapper_object
|
||||
};
|
||||
|
||||
language_binding_index = nativescript_1_1_api->godot_nativescript_register_instance_binding_data_functions(bind);
|
||||
}
|
||||
|
||||
// register class
|
||||
{
|
||||
godot_instance_create_func constructor = {};
|
||||
constructor.create_func = &ibd_constructor;
|
||||
godot_instance_create_func constructor = {
|
||||
.create_func = &ibd_constructor
|
||||
};
|
||||
|
||||
godot_instance_destroy_func destructor = {};
|
||||
destructor.destroy_func = &ibd_destructor;
|
||||
godot_instance_destroy_func destructor = {
|
||||
.destroy_func = &ibd_destructor
|
||||
};
|
||||
|
||||
nativescript_api->godot_nativescript_register_class(handle, "InstanceBinding", "Reference", constructor, destructor);
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import os, subprocess
|
||||
opts = Variables([], ARGUMENTS)
|
||||
|
||||
# Define the relative path to the Godot headers.
|
||||
godot_headers_path = "godot_headers/"
|
||||
godot_headers_path = "godot-headers/"
|
||||
|
||||
# Gets the standard flags CC, CCX, etc.
|
||||
env = DefaultEnvironment()
|
||||
@@ -64,7 +64,8 @@ elif env["platform"] == "windows":
|
||||
# This makes sure to keep the session environment variables
|
||||
# on Windows, so that you can run scons in a VS 2017 prompt
|
||||
# and it will find all the required tools.
|
||||
env.Append(ENV=os.environ)
|
||||
env = Environment(ENV=os.environ)
|
||||
opts.Update(env)
|
||||
|
||||
env.Append(CCFLAGS=["-DWIN32", "-D_WIN32", "-D_WINDOWS", "-W3", "-GR", "-D_CRT_SECURE_NO_WARNINGS"])
|
||||
if env["target"] in ("debug", "d"):
|
||||
|
||||
Reference in New Issue
Block a user