2018-08-12 22:08:56 +00:00
|
|
|
#pragma once
|
|
|
|
|
2024-01-19 12:44:49 +00:00
|
|
|
#include <string_view>
|
|
|
|
|
2018-08-12 22:08:56 +00:00
|
|
|
// Simple wrapper around the Discord api.
|
|
|
|
|
|
|
|
// All platforms should call it, but we only actually take action on
|
|
|
|
// platforms where we want it enabled (only PC initially).
|
|
|
|
|
|
|
|
// All you need to call is FrameCallback, Shutdown, and UpdatePresence.
|
|
|
|
|
|
|
|
class Discord {
|
|
|
|
public:
|
|
|
|
~Discord();
|
|
|
|
void Update(); // Call every frame or at least regularly. Will initialize if necessary.
|
|
|
|
void Shutdown();
|
|
|
|
|
2024-01-19 12:44:49 +00:00
|
|
|
void SetPresenceGame(std::string_view gameTitle);
|
2018-08-12 22:08:56 +00:00
|
|
|
void SetPresenceMenu();
|
2018-11-10 15:48:04 +00:00
|
|
|
void ClearPresence();
|
2018-08-12 22:08:56 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
void Init();
|
|
|
|
bool IsEnabled() const;
|
|
|
|
|
|
|
|
bool initialized_ = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
extern Discord g_Discord;
|