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.

Render.h 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*!
  2. * \file include/Render.h
  3. * \brief World Renderer
  4. *
  5. * \author Mongoose
  6. * \author xythobuz
  7. */
  8. #ifndef _RENDER_H_
  9. #define _RENDER_H_
  10. #include <vector>
  11. #include <glm/gtc/type_precision.hpp>
  12. #include "Room.h"
  13. #include "TextureManager.h"
  14. enum class RenderMode {
  15. LoadScreen,
  16. Solid,
  17. Wireframe,
  18. Texture
  19. };
  20. struct RoomRenderList {
  21. RoomRenderList(Room* r, glm::vec2 pos, glm::vec2 size)
  22. : room(r), portalPos(pos), portalSize(size) { }
  23. Room* room;
  24. glm::vec2 portalPos, portalSize;
  25. };
  26. class Render {
  27. public:
  28. static void clearRoomList() { roomList.clear(); }
  29. static void display();
  30. static void displayUI();
  31. static void screenShot(const char* filenameBase);
  32. static RenderMode getMode() { return mode; }
  33. static void setMode(RenderMode m) { mode = m; }
  34. static void setDisplayViewFrustum(bool d) { displayViewFrustum = d; }
  35. static bool getDisplayViewFrustum() { return displayViewFrustum; }
  36. private:
  37. static void buildRoomList(glm::mat4 VP, int room = -2,
  38. glm::vec2 min = glm::vec2(-1.0f, -1.0f),
  39. glm::vec2 max = glm::vec2(1.0f, 1.0f));
  40. static RenderMode mode;
  41. static std::vector<RoomRenderList> roomList;
  42. static bool displayViewFrustum;
  43. static bool displayVisibilityCheck;
  44. };
  45. #endif