Skip to content

Instantly share code, notes, and snippets.

@oskar-szulc
Last active December 4, 2015 00:33
Show Gist options
  • Save oskar-szulc/1a5b225da4c694ce3736 to your computer and use it in GitHub Desktop.
Save oskar-szulc/1a5b225da4c694ce3736 to your computer and use it in GitHub Desktop.
#include <emscripten.h>
#include "Game.h"
extern "C"
{
Game* game;
void EMSCRIPTEN_KEEPALIVE start(char* data, int size)
{
game = new Game();
char* move = game->input(data);
emscripten_worker_respond(move, strlen(move) + 1);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment