first_app.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #pragma once
  2. #include "coral_device.h"
  3. #include "coral_window.h"
  4. #include "coral_gameobject.h"
  5. #include "coral_renderer.h"
  6. #include "coral_descriptors.h"
  7. #include "coral_texture.h"
  8. #include "coral_cubemap.h"
  9. #include "coral_input.h"
  10. // STD
  11. #include <memory>
  12. #include <vector>
  13. namespace coral_3d
  14. {
  15. class first_app final
  16. {
  17. public:
  18. static constexpr int WIDTH{ 1280 };
  19. static constexpr int HEIGHT{ 720 };
  20. first_app();
  21. first_app(const first_app&) = delete;
  22. first_app& operator=(const first_app&) = delete;
  23. void run();
  24. private:
  25. void load_gameobjects(coral_descriptor_set_layout& material_set_layout, VkPipelineLayout pipeline_layout,
  26. coral_buffer& global_ubo);
  27. void init_imgui();
  28. std::unique_ptr<coral_descriptor_pool> imgui_pool_{};
  29. coral_window window_{ WIDTH, HEIGHT, "Coral Renderer" };
  30. coral_device device_{ window_ };
  31. coral_renderer renderer_{ window_, device_ };
  32. coral_cubemap cubemap_;
  33. std::unique_ptr<coral_descriptor_pool> descriptor_pool_{};
  34. // GLOBAL DESCRIPTOR SETS
  35. std::vector<VkDescriptorSet> global_descriptor_sets_{coral_swapchain::MAX_FRAMES_IN_FLIGHT};
  36. std::unique_ptr<coral_descriptor_set_layout> global_set_layout_;
  37. coral_gameobject::Map gameobjects_;
  38. // INPUT
  39. coral_input input{};
  40. bool show_cursor_{false};
  41. };
  42. }