Open Source Tomb Raider Engine
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

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. private:
  28. static void renderImGui(ImDrawList** const draw_lists, int count);
  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