diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json new file mode 100644 index 0000000..782448a --- /dev/null +++ b/.vscode/c_cpp_properties.json @@ -0,0 +1,23 @@ +{ + "configurations": [ + { + "name": "Win32", + "includePath": [ + "${default}", + "${workspaceFolder}/src/discord-game-sdk-cpp", + "${workspaceFolder}" + ], + "defines": [ + "_DEBUG", + "UNICODE", + "_UNICODE" + ], + "windowsSdkVersion": "10.0.22621.0", + "compilerPath": "cl.exe", + "cStandard": "c17", + "cppStandard": "c++17", + "intelliSenseMode": "windows-msvc-x64" + } + ], + "version": 4 +} \ No newline at end of file diff --git a/SConstruct b/SConstruct index 5283f44..0377857 100644 --- a/SConstruct +++ b/SConstruct @@ -14,10 +14,10 @@ env = SConscript("./godot-cpp/SConstruct") # tweak this if you want to use different folders, or more folders, to store your source code in. -env.Append(CPPPATH=["src/","src/discord-game-sdk-cpp"]) +env.Append(CPPPATH=["src/"]) -env.Append(LIBPATH=[ "./godot-cpp/bin", "src/discord-game-sdk-cpp/lib"]) -env.Append(LIBS=[ "libgodot-cpp{}{}".format(env["suffix"], env["SHLIBSUFFIX"]), "discord_game_sdk"]) +env.Append(LIBPATH=["project/addons/discord-rpc-gd/lib"]) +env.Append(LIBS=["discord_game_sdk"]) sources = Glob("src/*.cpp") if env["platform"] == "macos": diff --git a/project/addons/discord-rpc-gd/bin/libgd-discordrpc.windows.template_debug.x86_64.exp b/project/addons/discord-rpc-gd/bin/libgd-discordrpc.windows.template_debug.x86_64.exp new file mode 100644 index 0000000..ff55646 Binary files /dev/null and b/project/addons/discord-rpc-gd/bin/libgd-discordrpc.windows.template_debug.x86_64.exp differ diff --git a/project/addons/discord-rpc-gd/bin/libgd-discordrpc.windows.template_debug.x86_64.lib b/project/addons/discord-rpc-gd/bin/libgd-discordrpc.windows.template_debug.x86_64.lib new file mode 100644 index 0000000..ee7f576 Binary files /dev/null and b/project/addons/discord-rpc-gd/bin/libgd-discordrpc.windows.template_debug.x86_64.lib differ diff --git a/project/addons/discord-rpc-gd/discord-rpc-gd.gdextension b/project/addons/discord-rpc-gd/discord-rpc-gd.gdextension index 3280b50..9c5f239 100644 --- a/project/addons/discord-rpc-gd/discord-rpc-gd.gdextension +++ b/project/addons/discord-rpc-gd/discord-rpc-gd.gdextension @@ -20,3 +20,20 @@ android.debug.x86_64 = "bin/libgd-discordrpc.android.template_debug.x86_64.so" android.release.x86_64 = "bin/libgd-discordrpc.android.template_release.x86_64.so" android.debug.arm64 = "bin/libgd-discordrpc.android.template_debug.arm64.so" android.release.arm64 = "bin/libgd-discordrpc.android.template_release.arm64.so" + +[dependencies] + +windows.debug.x86_32 = "lib/discord_game_sdk.dll" +windows.release.x86_32 = "lib/discord_game_sdk.dll" +windows.debug.x86_64 = "lib/discord_game_sdk.dll" +windows.release.x86_64 = "lib/discord_game_sdk.dll" +linux.debug.x86_64 = "lib/discord_game_sdk.so" +linux.release.x86_64 = "lib/discord_game_sdk.so" +linux.debug.arm64 = "lib/discord_game_sdk.so" +linux.release.arm64 = "lib/discord_game_sdk.so" +linux.debug.rv64 = "lib/discord_game_sdk.so" +linux.release.rv64 = "lib/discord_game_sdk.so" +android.debug.x86_64 = "lib/discord_game_sdk.so" +android.release.x86_64 = "lib/discord_game_sdk.so" +android.debug.arm64 = "lib/discord_game_sdk.so" +android.release.arm64 = "lib/discord_game_sdk.so" \ No newline at end of file diff --git a/src/discord-game-sdk-cpp/lib/discord_game_sdk.bundle b/project/addons/discord-rpc-gd/lib/discord_game_sdk.bundle similarity index 100% rename from src/discord-game-sdk-cpp/lib/discord_game_sdk.bundle rename to project/addons/discord-rpc-gd/lib/discord_game_sdk.bundle diff --git a/src/discord-game-sdk-cpp/lib/discord_game_sdk.dll b/project/addons/discord-rpc-gd/lib/discord_game_sdk.dll similarity index 100% rename from src/discord-game-sdk-cpp/lib/discord_game_sdk.dll rename to project/addons/discord-rpc-gd/lib/discord_game_sdk.dll diff --git a/src/discord-game-sdk-cpp/lib/discord_game_sdk.dylib b/project/addons/discord-rpc-gd/lib/discord_game_sdk.dylib similarity index 100% rename from src/discord-game-sdk-cpp/lib/discord_game_sdk.dylib rename to project/addons/discord-rpc-gd/lib/discord_game_sdk.dylib diff --git a/src/discord-game-sdk-cpp/lib/discord_game_sdk.dll.lib b/project/addons/discord-rpc-gd/lib/discord_game_sdk.lib similarity index 100% rename from src/discord-game-sdk-cpp/lib/discord_game_sdk.dll.lib rename to project/addons/discord-rpc-gd/lib/discord_game_sdk.lib diff --git a/src/discord-game-sdk-cpp/lib/discord_game_sdk.so b/project/addons/discord-rpc-gd/lib/discord_game_sdk.so similarity index 100% rename from src/discord-game-sdk-cpp/lib/discord_game_sdk.so rename to project/addons/discord-rpc-gd/lib/discord_game_sdk.so diff --git a/src/main.cpp b/src/main.cpp index 1b560ef..1740dcc 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -6,30 +6,34 @@ using namespace godot; using namespace discord; -Core* core{}; +Core *core{}; -void DiscordRPC::_bind_methods() { +void DiscordRPC::_bind_methods() +{ } -DiscordRPC::DiscordRPC() { +DiscordRPC::DiscordRPC() +{ // initialize any variables here time_passed = 0.0; } -DiscordRPC::~DiscordRPC() { +DiscordRPC::~DiscordRPC() +{ // add your cleanup here } -void DiscordRPC::_ready() { - discord::Result res /*= Core::Create(53908232506183680, DiscordCreateFlags_NoRequireDiscord, &core)*/; - Activity activity{}; +void DiscordRPC::_ready() +{ + discord::Result res = Core::Create(53908232506183680, DiscordCreateFlags_NoRequireDiscord, &core); + Activity activity{}; UtilityFunctions::print(core); - /*activity.SetState("Testing"); - activity.SetDetails("Fruit Loops"); - core->ActivityManager().UpdateActivity(activity, [](Result res) { - });*/ + activity.SetState("Testing"); + activity.SetDetails("Fruit Loops"); + core->ActivityManager().UpdateActivity(activity, [](Result res) {}); } -void DiscordRPC::_process(float delta) { - //::core->RunCallbacks(); +void DiscordRPC::_process(float delta) +{ + ::core->RunCallbacks(); } \ No newline at end of file diff --git a/src/main.windows.template_debug.x86_64.obj b/src/main.windows.template_debug.x86_64.obj new file mode 100644 index 0000000..9cf2107 Binary files /dev/null and b/src/main.windows.template_debug.x86_64.obj differ diff --git a/src/register_types.windows.template_debug.x86_64.obj b/src/register_types.windows.template_debug.x86_64.obj new file mode 100644 index 0000000..9131a9b Binary files /dev/null and b/src/register_types.windows.template_debug.x86_64.obj differ