discord-rpc/include/discord-rpc.h

44 lines
1 KiB
C
Raw Normal View History

2017-06-23 23:04:36 +00:00
#pragma once
2017-06-29 16:38:07 +00:00
#include <stdint.h>
2017-06-23 23:04:36 +00:00
#ifdef __cplusplus
extern "C" {
#endif
typedef struct {
2017-06-29 15:58:38 +00:00
const char* state;
const char* details;
2017-06-29 16:38:07 +00:00
int64_t startTimestamp;
int64_t endTimestamp;
2017-06-29 15:58:38 +00:00
const char* largeImageKey;
const char* largeImageText;
const char* smallImageKey;
const char* smallImageText;
2017-06-23 23:04:36 +00:00
const char* partyId;
2017-06-29 15:58:38 +00:00
int partySize;
int partyMax;
const char* matchSecret;
const char* joinSecret;
const char* spectateSecret;
int8_t instance;
} DiscordRichPresence;
2017-06-23 23:04:36 +00:00
typedef struct {
2017-06-23 23:04:36 +00:00
void (*ready)();
void (*disconnected)();
void (*wantsPresence)();
void (*joinGame)(const char* joinSecret);
void (*spectateGame)(const char* spectateSecret);
} DiscordEventHandlers;
2017-06-23 23:04:36 +00:00
2017-06-29 15:58:38 +00:00
void Discord_Initialize(const char* applicationId, DiscordEventHandlers* handlers);
void Discord_Shutdown();
void Discord_UpdatePresence(const DiscordRichPresence* presence);
2017-07-07 16:41:20 +00:00
/* checks for incoming messages, dispatches callbacks */
void Discord_Update();
#ifdef __cplusplus
} /* extern "C" */
#endif