1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-20 15:40:26 +00:00

open URLs from Emscripten

This commit is contained in:
Zeno Rogue 2018-09-05 15:34:13 +02:00
parent 3e1cb1ba6d
commit ec84643070
2 changed files with 11 additions and 0 deletions

View File

@ -4026,5 +4026,9 @@ extern bool game_active, playerfound;
string bygen(reaction_t h);
#if CAP_URL
void open_url(string s);
#endif
}

View File

@ -12,6 +12,7 @@
#define CAP_SHMUP 0
#define CAP_RUG 1
#define CAP_INV 0
#define CAP_URL 1
#define GLES_ONLY
#ifndef CAP_ORIENTATION
@ -43,6 +44,12 @@ namespace hr {
// -- demo --
void open_url(string s) {
EM_ASM_({
window.open(Pointer_stringify($0));
}, s.c_str());
}
bool demoanim;
void toggleanim(bool v) {