| 39 | int gotClick = 0; |
| 40 | |
| 41 | bool click_callback(int eventType, const EmscriptenMouseEvent *e, void *userData) { |
| 42 | if (e->screenX != 0 && e->screenY != 0 && e->clientX != 0 && e->clientY != 0 && e->canvasX != 0 && e->canvasY != 0 && e->targetX != 0 && e->targetY != 0) |
| 43 | { |
| 44 | if (eventType == EMSCRIPTEN_EVENT_CLICK && !gotClick) { |
| 45 | gotClick = 1; |
| 46 | printf("Request pointer lock...\n"); |
| 47 | EMSCRIPTEN_RESULT ret = emscripten_request_pointerlock(0, 0); |
| 48 | TEST_RESULT(ret); |
| 49 | if (ret != EMSCRIPTEN_RESULT_SUCCESS) { |
| 50 | printf("ERROR! emscripten_request_pointerlock() failure\n"); |
| 51 | report_result(1); |
| 52 | } |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | return 0; |
| 57 | } |
| 58 | |
| 59 | bool pointerlockchange_callback(int eventType, const EmscriptenPointerlockChangeEvent *e, void *userData) { |
| 60 | printf("ERROR! received 'pointerlockchange' event\n"); |
nothing calls this directly
no test coverage detected