Open Source Tomb Raider Engine
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

UI.h 1.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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 <glm/gtc/type_precision.hpp>
  14. #include "system/Shader.h"
  15. struct ImDrawList;
  16. class UI {
  17. public:
  18. static int initialize();
  19. static void eventsFinished();
  20. static void display();
  21. static void shutdown();
  22. static void setSize(glm::i32vec2 s);
  23. static void setVisible(bool v) { visible = v; }
  24. static bool isVisible() { return visible; }
  25. static void handleKeyboard(KeyboardButton key, bool pressed);
  26. static void handleText(char* text, bool notFinished);
  27. static void handleMouseClick(unsigned int x, unsigned int y, KeyboardButton button, bool released);
  28. static void handleMouseMotion(int xrel, int yrel, int xabs, int yabs);
  29. static void handleMouseScroll(int xrel, int yrel);
  30. static void handleControllerAxis(float value, KeyboardButton axis);
  31. static void handleControllerButton(KeyboardButton button, bool released);
  32. static void renderImGui(ImDrawList** const draw_lists, int count);
  33. private:
  34. static bool visible;
  35. static unsigned int fontTex;
  36. static std::string iniFilename;
  37. static std::string logFilename;
  38. static bool metaKeyIsActive;
  39. static std::list<std::tuple<KeyboardButton, bool>> keyboardEvents;
  40. static std::list<std::tuple<unsigned int, unsigned int, KeyboardButton, bool>> clickEvents;
  41. static std::list<std::tuple<int, int, int, int>> motionEvents;
  42. static std::list<std::tuple<int, int>> scrollEvents;
  43. static Shader imguiShader;
  44. static const char* imguiShaderVertex;
  45. static const char* imguiShaderFragment;
  46. };
  47. #endif