Open Source Tomb Raider Engine
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

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 calculate();
  20. static void shutdown();
  21. static void setVisible(bool v);
  22. static bool isVisible();
  23. static void handleKeyboard(KeyboardButton key, bool pressed);
  24. static void handleText(char *text, bool notFinished);
  25. static void handleMouseClick(unsigned int x, unsigned int y, KeyboardButton button, bool released);
  26. static void handleMouseMotion(int xrel, int yrel, int xabs, int yabs);
  27. static void handleMouseScroll(int xrel, int yrel);
  28. private:
  29. static void renderImGui(ImDrawList** const draw_lists, int count);
  30. static bool visible;
  31. static unsigned int fontTex;
  32. static std::string iniFilename;
  33. static std::string logFilename;
  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