Open Source Tomb Raider Engine
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

UI.h 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*!
  2. * \file include/UI.h
  3. * \brief Abstract UI interface
  4. *
  5. * \author xythobuz
  6. */
  7. #ifndef _UI_H_
  8. #define _UI_H_
  9. #include <functional>
  10. #include <list>
  11. #include <memory>
  12. #include <tuple>
  13. #include "imgui/imgui.h"
  14. class UI {
  15. public:
  16. static int initialize();
  17. static void eventsFinished();
  18. static void display();
  19. static void shutdown();
  20. static void setVisible(bool v);
  21. static bool isVisible();
  22. static void handleKeyboard(KeyboardButton key, bool pressed);
  23. static void handleText(char* text, bool notFinished);
  24. static void handleMouseClick(unsigned int x, unsigned int y, KeyboardButton button, bool released);
  25. static void handleMouseMotion(int xrel, int yrel, int xabs, int yabs);
  26. static void handleMouseScroll(int xrel, int yrel);
  27. static void renderImGui(ImDrawList** const draw_lists, int count);
  28. private:
  29. static bool visible;
  30. static unsigned int fontTex;
  31. static std::string iniFilename;
  32. static std::string logFilename;
  33. static bool metaKeyIsActive;
  34. static std::list<std::tuple<KeyboardButton, bool>> keyboardEvents;
  35. static std::list<std::tuple<unsigned int, unsigned int, KeyboardButton, bool>> clickEvents;
  36. static std::list<std::tuple<int, int, int, int>> motionEvents;
  37. static std::list<std::tuple<int, int>> scrollEvents;
  38. };
  39. #endif