1
0
Fork 0
mirror of https://github.com/Detanup01/gbe_fork.git synced 2025-06-07 17:55:55 +02:00
gbe_fork/example_plugin/main.cpp
Detanup01 d7fe629407
fix linux related void* insert and stuff
add real logic to example plugin.
2025-02-06 12:44:50 +01:00

30 lines
No EOL
1.1 KiB
C++

#include "pdk.h"
#define PRINT_DEBUG_PLUGIN(a, ...) do {FILE *t = fopen("example_debug.txt", "a"); fprintf(t, "%u " a, GetCurrentThreadId(), __VA_ARGS__); fclose(t);} while (0)
#define EXPORT extern "C" __declspec( dllexport )
EXPORT void GBE_Load()
{
PRINT_DEBUG_PLUGIN("GBE_Load");
PRINT_DEBUG_PLUGIN("Version of PDK: %d", PDK::GetPDKVersion());
// Which one should be good? idk
//PDK::RegisterInterface(TestCreate, "STEAMAPPLIST_INTERFACE_VERSION001");
int success = PDK::RegisterInterface(&TestCreate, "STEAMAPPLIST_INTERFACE_VERSION001");
PRINT_DEBUG_PLUGIN("Finished registering interfaces! Is Success: %d", success);
}
EXPORT void GBE_UnLoad()
{
PRINT_DEBUG_PLUGIN("GBE_UnLoad");
int success = PDK::UnRegisterInterface(&TestCreate);
PRINT_DEBUG_PLUGIN("Finished registering interfaces! Is Success: %d", success);
}
void* TestCreate(HSteamUser hSteamUser, HSteamPipe hSteamPipe)
{
PRINT_DEBUG_PLUGIN("Test create with STEAMAPPLIST_INTERFACE_VERSION001");
PRINT_DEBUG_PLUGIN("Args: %d %d", hSteamUser, hSteamPipe);
return nullptr;
}