engine/include/systems/render.h

39 lines
791 B
C
Raw Permalink Normal View History

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
2023-05-01 13:13:35 +00:00
#include "components/renderable.h"
#include "components/transform.h"
#include "ecs_system.h"
#include "gfx.h"
#include "gfx_device.h"
#include "log.h"
#include "scene.h"
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