mirror of
				https://github.com/zenorogue/hyperrogue.git
				synced 2025-10-31 14:02:59 +00:00 
			
		
		
		
	open URLs from Emscripten
This commit is contained in:
		
							
								
								
									
										4
									
								
								hyper.h
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								hyper.h
									
									
									
									
									
								
							| @@ -4026,5 +4026,9 @@ extern bool game_active, playerfound; | ||||
|  | ||||
| string bygen(reaction_t h); | ||||
|  | ||||
| #if CAP_URL | ||||
| void open_url(string s); | ||||
| #endif | ||||
|  | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -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) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Zeno Rogue
					Zeno Rogue