psOff_public/tools/gamereport/gamereport.h
2024-04-14 21:39:03 +03:00

57 lines
1.0 KiB
C++

#pragma once
#include "SDL2/SDL.h"
#include "utility/utility.h"
#define GAMEREPORT_USER_SEND_SCANCODE SDL_SCANCODE_F11
#define GAMEREPORT_REPO_NAME "SysRay/psOff_compatibility"
class IGameReport {
CLASS_NO_COPY(IGameReport);
CLASS_NO_MOVE(IGameReport);
protected:
bool m_bEnabled = true;
IGameReport() = default;
public:
virtual ~IGameReport() = default;
enum Type {
USER,
EXCEPTION,
MISSING_SYMBOL,
};
union AdditionalData {
std::exception* ex;
const char* message;
const void* ptr;
};
struct Info {
const char* title;
const char* title_id;
const char* app_ver;
const char* emu_ver;
SDL_Window* wnd;
Type type;
AdditionalData add;
};
void SetStatus(bool enabled) { m_bEnabled = enabled; };
virtual void ShowReportWindow(const Info&) = 0;
};
#ifdef __APICALL_EXTERN
#define __APICALL __declspec(dllexport)
#else
#define __APICALL __declspec(dllimport)
#endif
__APICALL IGameReport& accessGameReport();
#undef __APICALL