Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
hrydgard
GitHub Repository: hrydgard/ppsspp
Path: blob/master/UI/DiscordIntegration.h
3185 views
1
#pragma once
2
3
#include <string_view>
4
5
// Simple wrapper around the Discord api.
6
7
// All platforms should call it, but we only actually take action on
8
// platforms where we want it enabled (only PC initially).
9
10
// All you need to call is FrameCallback, Shutdown, and UpdatePresence.
11
12
class Discord {
13
public:
14
~Discord();
15
void Update(); // Call every frame or at least regularly. Will initialize if necessary.
16
void Shutdown();
17
18
void SetPresenceGame(std::string_view gameTitle);
19
void SetPresenceMenu();
20
void ClearPresence();
21
22
static bool IsAvailable();
23
24
private:
25
void Init();
26
bool IsEnabled() const;
27
28
bool initialized_ = false;
29
};
30
31
extern Discord g_Discord;
32
33