Skip to content

Commit

Permalink
🚧 initial setup, includes and gdscript not adjusted yet
Browse files Browse the repository at this point in the history
  • Loading branch information
bitbrain committed Jul 27, 2022
1 parent 4638171 commit c0c87ea
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 19 deletions.
19 changes: 0 additions & 19 deletions src/gdlibrary.cpp

This file was deleted.

42 changes: 42 additions & 0 deletions src/register_types.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#include "register_types.h"

#include <godot/gdnative_interface.h>

#include <godot_cpp/core/class_db.hpp>

This comment has been minimized.

Copy link
@bitbrain

bitbrain Jul 27, 2022

Author Contributor

Those need changing. Omit the godot_cpp

#include <godot_cpp/core/defs.hpp>
#include <godot_cpp/godot.hpp>

#include "godot_fmod.h"

using namespace godot;

void initialize_fmod_module(ModuleInitializationLevel p_level) {
if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) {
return;
}

Callbacks::GodotFileRunner::get_singleton();

ClassDB::register_class<FMOD>();
}

void uninitialize_fmod_module(ModuleInitializationLevel p_level) {
if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) {
return;
}
}

extern "C" {

// Initialization.

GDNativeBool GDN_EXPORT fmod_library_init(const GDNativeInterface *p_interface, const GDNativeExtensionClassLibraryPtr p_library, GDNativeInitialization *r_initialization) {
godot::GDExtensionBinding::InitObject init_obj(p_interface, p_library, r_initialization);

init_obj.register_initializer(initialize_fmod_module);
init_obj.register_terminator(uninitialize_fmod_module);
init_obj.set_minimum_library_initialization_level(MODULE_INITIALIZATION_LEVEL_SCENE);

return init_obj.init();
}
}
10 changes: 10 additions & 0 deletions src/register_types.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#ifndef FMOD_REGISTER_TYPES_H
#define FMOD_REGISTER_TYPES_H

#include <godot_cpp/core/class_db.hpp>
using namespace godot;

void initialize_example_module(ModuleInitializationLevel p_level);
void uninitialize_example_module(ModuleInitializationLevel p_level);

#endif // ! FMOD_REGISTER_TYPES_H

0 comments on commit c0c87ea

Please sign in to comment.