MCPcopy Create free account
hub / github.com/OneLoneCoder/olcPixelGameEngine / touch_callback

Method touch_callback

olcPixelGameEngine.h:7871–7893  ·  view source on GitHub ↗

TY Bispoo

Source from the content-addressed store, hash-verified

7869
7870 //TY Bispoo
7871 static EM_BOOL touch_callback(int eventType, const EmscriptenTouchEvent* e, void* userData)
7872 {
7873 // Move
7874 if (eventType == EMSCRIPTEN_EVENT_TOUCHMOVE)
7875 {
7876 ptrPGE->olc_UpdateMouse(e->touches->targetX, e->touches->targetY);
7877 }
7878
7879 // Start
7880 if (eventType == EMSCRIPTEN_EVENT_TOUCHSTART)
7881 {
7882 ptrPGE->olc_UpdateMouse(e->touches->targetX, e->touches->targetY);
7883 ptrPGE->olc_UpdateMouseState(0, true);
7884 }
7885
7886 // End
7887 if (eventType == EMSCRIPTEN_EVENT_TOUCHEND)
7888 {
7889 ptrPGE->olc_UpdateMouseState(0, false);
7890 }
7891
7892 return EM_TRUE;
7893 }
7894
7895 //TY Moros
7896 static EM_BOOL mouse_callback(int eventType, const EmscriptenMouseEvent* e, void* userData)

Callers

nothing calls this directly

Calls 2

olc_UpdateMouseMethod · 0.80
olc_UpdateMouseStateMethod · 0.80

Tested by

no test coverage detected