2023-04-11 20:49:16 +02:00
|
|
|
#pragma once
|
|
|
|
#include "plugin_abi.h"
|
|
|
|
|
|
|
|
#include <queue>
|
|
|
|
#include <mutex>
|
|
|
|
|
|
|
|
enum PluginDataRequestType
|
|
|
|
{
|
|
|
|
END = 0,
|
|
|
|
};
|
|
|
|
|
|
|
|
union PluginRespondDataCallable
|
|
|
|
{
|
|
|
|
// Empty for now
|
|
|
|
void* UNUSED;
|
|
|
|
};
|
|
|
|
|
|
|
|
class PluginDataRequest
|
|
|
|
{
|
2023-12-20 15:20:02 +01:00
|
|
|
public:
|
2023-04-11 20:49:16 +02:00
|
|
|
PluginDataRequestType type;
|
|
|
|
PluginRespondDataCallable func;
|
|
|
|
PluginDataRequest(PluginDataRequestType type, PluginRespondDataCallable func) : type(type), func(func) {}
|
|
|
|
};
|
|
|
|
|
|
|
|
class PluginCommunicationHandler
|
|
|
|
{
|
2023-12-20 15:20:02 +01:00
|
|
|
public:
|
2023-04-11 20:49:16 +02:00
|
|
|
void RunFrame();
|
|
|
|
void PushRequest(PluginDataRequestType type, PluginRespondDataCallable func);
|
|
|
|
|
2023-12-20 15:20:02 +01:00
|
|
|
public:
|
2023-10-15 21:57:41 +02:00
|
|
|
std::queue<PluginDataRequest> requestQueue = {};
|
2023-04-11 20:49:16 +02:00
|
|
|
std::mutex requestMutex;
|
|
|
|
|
|
|
|
PluginEngineData m_sEngineData {};
|
|
|
|
};
|
|
|
|
|
2023-11-06 02:21:50 +01:00
|
|
|
void InformPluginsDLLLoad(fs::path dllPath, void* address);
|
2023-04-11 20:49:16 +02:00
|
|
|
extern PluginCommunicationHandler* g_pPluginCommunicationhandler;
|