2023-05-01 12:55:49 +00:00
|
|
|
#ifndef ENGINE_INCLUDE_SYSTEMS_RENDER_H_
|
|
|
|
#define ENGINE_INCLUDE_SYSTEMS_RENDER_H_
|
2023-01-02 17:24:20 +00:00
|
|
|
|
|
|
|
#include "components/renderable.hpp"
|
2023-05-01 12:55:49 +00:00
|
|
|
#include "components/transform.hpp"
|
|
|
|
#include "ecs_system.hpp"
|
2023-03-13 17:10:46 +00:00
|
|
|
#include "gfx.hpp"
|
|
|
|
#include "gfx_device.hpp"
|
2023-05-01 12:55:49 +00:00
|
|
|
#include "log.hpp"
|
|
|
|
#include "scene.hpp"
|
2023-03-13 17:10:46 +00:00
|
|
|
|
2023-01-02 17:24:20 +00:00
|
|
|
namespace engine {
|
|
|
|
|
2023-05-01 12:55:49 +00:00
|
|
|
class RenderSystem : public System {
|
|
|
|
public:
|
|
|
|
RenderSystem(Scene* scene);
|
|
|
|
~RenderSystem();
|
2023-01-05 13:21:33 +00:00
|
|
|
|
2023-05-01 12:55:49 +00:00
|
|
|
void OnUpdate(float ts) override;
|
2023-03-13 17:10:46 +00:00
|
|
|
|
2023-05-01 12:55:49 +00:00
|
|
|
void SetCameraEntity(uint32_t entity);
|
2023-01-05 13:21:33 +00:00
|
|
|
|
2023-05-01 12:55:49 +00:00
|
|
|
private:
|
|
|
|
GFXDevice* const gfx_;
|
2023-01-05 13:21:33 +00:00
|
|
|
|
2023-05-01 12:55:49 +00:00
|
|
|
struct {
|
|
|
|
// only uses transform component, which is required for all entities anyway
|
|
|
|
uint32_t cam_entity = 0;
|
|
|
|
float vertical_fov_degrees = 70.0f;
|
|
|
|
float clip_near = 0.5f;
|
|
|
|
float clip_far = 10000.0f;
|
|
|
|
} camera_;
|
2023-03-13 17:10:46 +00:00
|
|
|
|
2023-05-01 12:55:49 +00:00
|
|
|
float viewport_aspect_ratio_ = 1.0f;
|
|
|
|
};
|
2023-01-02 17:24:20 +00:00
|
|
|
|
2023-05-01 12:55:49 +00:00
|
|
|
} // namespace engine
|
2023-01-02 17:24:20 +00:00
|
|
|
|
2023-05-01 12:55:49 +00:00
|
|
|
#endif
|