5 #include "../OpenGL/RenderTarget.hpp"
8 #include <unordered_map>
12 #if IV_GLPLATFORM_GLFM
44 #if IV_GLPLATFORM_GLFM
45 static void s_onSurfaceCreated( GLFMDisplay * display,
int width,
int height );
46 void onSurfaceCreated(
int width,
int height );
48 static void s_onSurfaceDestroyed( GLFMDisplay * display );
49 void onSurfaceDestroyed();
51 static void s_onSurfaceResized( GLFMDisplay * display,
int width,
int height );
52 void onSurfaceResized(
int width,
int height );
54 static bool s_TouchFunc( GLFMDisplay * display,
int touch, GLFMTouchPhase phase,
double x,
double y );
55 bool TouchFunc(
int touch, GLFMTouchPhase phase,
double x,
double y );
57 static void s_SurfaceErrorFunc( GLFMDisplay * display,
const char * message );
58 void SurfaceErrorFunc(
const char * message );
60 static void s_MemoryWarningFunc( GLFMDisplay * display );
61 void MemoryWarningFunc();
63 static void s_FocusFunc( GLFMDisplay * display,
bool focused );
64 void FocusFunc(
bool focused );
66 static void s_onFrame( GLFMDisplay * display,
double frameTime_s );
67 void onFrame(
double frameTime_s );
69 static bool s_KeyFunc( GLFMDisplay * display, GLFMKey keyCode, GLFMKeyAction action,
int modifiers );
70 bool KeyFunc( GLFMKey keyCode, GLFMKeyAction action,
int modifiers );
72 static void s_CharFunc( GLFMDisplay * display,
const char * utf8,
int modifiers );
73 void CharFunc(
const char * utf8,
int modifiers );
75 static bool s_EmscriptenKeyFunc( GLFMDisplay * display,
const char * code, GLFMKeyAction action,
int modifiers );
76 bool EmscriptenKeyFunc(
const char * code, GLFMKeyAction action,
int modifiers );
81 void PopulateEmscriptenKeyMap();
84 GLFMDisplay * display;
93 double _lastFrameTime_s;
96 std::unordered_map< int, int2 > _touches;
97 std::unordered_map< std::string, Input::Key > emscriptenKeyMap;
98 unsigned _current_character;