|
@@ -33,6 +33,8 @@
|
|
|
|
|
|
#include "servers/display_server.h"
|
|
#include "servers/display_server.h"
|
|
|
|
|
|
|
|
+#include "godot_js.h"
|
|
|
|
+
|
|
#include <emscripten.h>
|
|
#include <emscripten.h>
|
|
#include <emscripten/html5.h>
|
|
#include <emscripten/html5.h>
|
|
|
|
|
|
@@ -88,28 +90,28 @@ private:
|
|
static const char *godot2dom_cursor(DisplayServer::CursorShape p_shape);
|
|
static const char *godot2dom_cursor(DisplayServer::CursorShape p_shape);
|
|
|
|
|
|
// events
|
|
// events
|
|
- static void fullscreen_change_callback(int p_fullscreen);
|
|
|
|
- static int mouse_button_callback(int p_pressed, int p_button, double p_x, double p_y, int p_modifiers);
|
|
|
|
- static void mouse_move_callback(double p_x, double p_y, double p_rel_x, double p_rel_y, int p_modifiers);
|
|
|
|
- static int mouse_wheel_callback(double p_delta_x, double p_delta_y);
|
|
|
|
- static void touch_callback(int p_type, int p_count);
|
|
|
|
- static void key_callback(int p_pressed, int p_repeat, int p_modifiers);
|
|
|
|
- static void vk_input_text_callback(const char *p_text, int p_cursor);
|
|
|
|
- static void gamepad_callback(int p_index, int p_connected, const char *p_id, const char *p_guid);
|
|
|
|
|
|
+ WASM_EXPORT static void fullscreen_change_callback(int p_fullscreen);
|
|
|
|
+ WASM_EXPORT static int mouse_button_callback(int p_pressed, int p_button, double p_x, double p_y, int p_modifiers);
|
|
|
|
+ WASM_EXPORT static void mouse_move_callback(double p_x, double p_y, double p_rel_x, double p_rel_y, int p_modifiers);
|
|
|
|
+ WASM_EXPORT static int mouse_wheel_callback(double p_delta_x, double p_delta_y);
|
|
|
|
+ WASM_EXPORT static void touch_callback(int p_type, int p_count);
|
|
|
|
+ WASM_EXPORT static void key_callback(int p_pressed, int p_repeat, int p_modifiers);
|
|
|
|
+ WASM_EXPORT static void vk_input_text_callback(const char *p_text, int p_cursor);
|
|
|
|
+ WASM_EXPORT static void gamepad_callback(int p_index, int p_connected, const char *p_id, const char *p_guid);
|
|
void process_joypads();
|
|
void process_joypads();
|
|
- static void _js_utterance_callback(int p_event, int p_id, int p_pos);
|
|
|
|
|
|
+ WASM_EXPORT static void _js_utterance_callback(int p_event, int p_id, int p_pos);
|
|
|
|
|
|
static Vector<String> get_rendering_drivers_func();
|
|
static Vector<String> get_rendering_drivers_func();
|
|
static DisplayServer *create_func(const String &p_rendering_driver, WindowMode p_window_mode, VSyncMode p_vsync_mode, uint32_t p_flags, const Vector2i *p_position, const Vector2i &p_resolution, int p_screen, Error &r_error);
|
|
static DisplayServer *create_func(const String &p_rendering_driver, WindowMode p_window_mode, VSyncMode p_vsync_mode, uint32_t p_flags, const Vector2i *p_position, const Vector2i &p_resolution, int p_screen, Error &r_error);
|
|
|
|
|
|
static void _dispatch_input_event(const Ref<InputEvent> &p_event);
|
|
static void _dispatch_input_event(const Ref<InputEvent> &p_event);
|
|
|
|
|
|
- static void request_quit_callback();
|
|
|
|
- static void window_blur_callback();
|
|
|
|
- static void update_voices_callback(int p_size, const char **p_voice);
|
|
|
|
- static void update_clipboard_callback(const char *p_text);
|
|
|
|
- static void send_window_event_callback(int p_notification);
|
|
|
|
- static void drop_files_js_callback(char **p_filev, int p_filec);
|
|
|
|
|
|
+ WASM_EXPORT static void request_quit_callback();
|
|
|
|
+ WASM_EXPORT static void window_blur_callback();
|
|
|
|
+ WASM_EXPORT static void update_voices_callback(int p_size, const char **p_voice);
|
|
|
|
+ WASM_EXPORT static void update_clipboard_callback(const char *p_text);
|
|
|
|
+ WASM_EXPORT static void send_window_event_callback(int p_notification);
|
|
|
|
+ WASM_EXPORT static void drop_files_js_callback(char **p_filev, int p_filec);
|
|
|
|
|
|
protected:
|
|
protected:
|
|
int get_current_video_driver() const;
|
|
int get_current_video_driver() const;
|