entry_asmjs.cpp 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*
  2. * Copyright 2011-2015 Branimir Karadzic. All rights reserved.
  3. * License: http://www.opensource.org/licenses/BSD-2-Clause
  4. */
  5. #include "entry_p.h"
  6. #if BX_PLATFORM_EMSCRIPTEN
  7. #include <emscripten.h>
  8. extern "C" void entry_emscripten_yield()
  9. {
  10. // emscripten_sleep(0);
  11. }
  12. namespace entry
  13. {
  14. const Event* poll()
  15. {
  16. entry_emscripten_yield();
  17. return NULL;
  18. }
  19. const Event* poll(WindowHandle _handle)
  20. {
  21. BX_UNUSED(_handle);
  22. entry_emscripten_yield();
  23. return NULL;
  24. }
  25. void release(const Event* _event)
  26. {
  27. BX_UNUSED(_event);
  28. }
  29. WindowHandle createWindow(int32_t _x, int32_t _y, uint32_t _width, uint32_t _height, uint32_t _flags, const char* _title)
  30. {
  31. BX_UNUSED(_x, _y, _width, _height, _flags, _title);
  32. WindowHandle handle = { UINT16_MAX };
  33. return handle;
  34. }
  35. void destroyWindow(WindowHandle _handle)
  36. {
  37. BX_UNUSED(_handle);
  38. }
  39. void setWindowPos(WindowHandle _handle, int32_t _x, int32_t _y)
  40. {
  41. BX_UNUSED(_handle, _x, _y);
  42. }
  43. void setWindowSize(WindowHandle _handle, uint32_t _width, uint32_t _height)
  44. {
  45. BX_UNUSED(_handle, _width, _height);
  46. }
  47. void setWindowTitle(WindowHandle _handle, const char* _title)
  48. {
  49. BX_UNUSED(_handle, _title);
  50. }
  51. void toggleWindowFrame(WindowHandle _handle)
  52. {
  53. BX_UNUSED(_handle);
  54. }
  55. void toggleFullscreen(WindowHandle _handle)
  56. {
  57. BX_UNUSED(_handle);
  58. }
  59. void setMouseLock(WindowHandle _handle, bool _lock)
  60. {
  61. BX_UNUSED(_handle, _lock);
  62. }
  63. }
  64. int main(int _argc, char** _argv)
  65. {
  66. return entry::main(_argc, _argv);
  67. }
  68. #endif // BX_PLATFORM_EMSCRIPTEN