mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-12-29 19:40:35 +00:00
open URLs from Emscripten
This commit is contained in:
parent
3e1cb1ba6d
commit
ec84643070
4
hyper.h
4
hyper.h
@ -4026,5 +4026,9 @@ extern bool game_active, playerfound;
|
|||||||
|
|
||||||
string bygen(reaction_t h);
|
string bygen(reaction_t h);
|
||||||
|
|
||||||
|
#if CAP_URL
|
||||||
|
void open_url(string s);
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
#define CAP_SHMUP 0
|
#define CAP_SHMUP 0
|
||||||
#define CAP_RUG 1
|
#define CAP_RUG 1
|
||||||
#define CAP_INV 0
|
#define CAP_INV 0
|
||||||
|
#define CAP_URL 1
|
||||||
#define GLES_ONLY
|
#define GLES_ONLY
|
||||||
|
|
||||||
#ifndef CAP_ORIENTATION
|
#ifndef CAP_ORIENTATION
|
||||||
@ -43,6 +44,12 @@ namespace hr {
|
|||||||
|
|
||||||
// -- demo --
|
// -- demo --
|
||||||
|
|
||||||
|
void open_url(string s) {
|
||||||
|
EM_ASM_({
|
||||||
|
window.open(Pointer_stringify($0));
|
||||||
|
}, s.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
bool demoanim;
|
bool demoanim;
|
||||||
|
|
||||||
void toggleanim(bool v) {
|
void toggleanim(bool v) {
|
||||||
|
Loading…
Reference in New Issue
Block a user