Even simpler

This commit is contained in:
Chris Marsh 2017-07-07 09:40:50 -07:00
parent 6d7e279074
commit cb34ca725f

View file

@ -1,5 +1,5 @@
/* /*
This is a simple example in C of using the rich presence API syncronously. This is a simple example in C of using the rich presence API syncronously, just sending presence.
*/ */
#define _CRT_SECURE_NO_WARNINGS /* thanks Microsoft */ #define _CRT_SECURE_NO_WARNINGS /* thanks Microsoft */
@ -24,19 +24,6 @@ static void updateDiscordPresence() {
Discord_UpdatePresence(&discordPresence); Discord_UpdatePresence(&discordPresence);
} }
static void handleDiscordReady() {
printf("Discord: ready\n");
}
static void handleDiscordDisconnected() {
printf("Discord: disconnected\n");
}
static void handleDiscordWantsPresence() {
printf("Discord: requests presence\n");
updateDiscordPresence();
}
static int prompt(char* line, size_t size) { static int prompt(char* line, size_t size) {
int res; int res;
char* nl; char* nl;
@ -76,9 +63,6 @@ static void gameLoop() {
int main() { int main() {
DiscordEventHandlers handlers; DiscordEventHandlers handlers;
memset(&handlers, 0, sizeof(handlers)); memset(&handlers, 0, sizeof(handlers));
handlers.ready = handleDiscordReady;
handlers.disconnected = handleDiscordDisconnected;
handlers.wantsPresence = handleDiscordWantsPresence;
Discord_Initialize(APPLICATION_ID, &handlers); Discord_Initialize(APPLICATION_ID, &handlers);
gameLoop(); gameLoop();