engine/include/systems/render.hpp

44 lines
731 B
C++
Raw Normal View History

2023-01-02 17:24:20 +00:00
#pragma once
#include "ecs_system.hpp"
#include "scene.hpp"
#include "log.hpp"
#include "components/transform.hpp"
#include "components/renderable.hpp"
2023-03-13 17:10:46 +00:00
#include "gfx.hpp"
#include "gfx_device.hpp"
2023-01-02 17:24:20 +00:00
namespace engine {
class RenderSystem : public System {
public:
2023-01-05 13:21:33 +00:00
RenderSystem(Scene* scene);
2023-03-13 17:10:46 +00:00
~RenderSystem();
2023-01-02 17:24:20 +00:00
2023-04-29 14:22:25 +00:00
void OnUpdate(float ts) override;
2023-01-02 17:24:20 +00:00
void setCameraEntity(uint32_t entity);
2023-01-05 13:21:33 +00:00
private:
2023-03-13 17:10:46 +00:00
GFXDevice* const m_gfx;
2023-01-05 13:21:33 +00:00
struct {
// only uses transform component, which is required for all entities anyway
uint32_t camEntity = 0;
2023-01-22 18:20:10 +00:00
float verticalFovDegrees = 70.0f;
2023-02-19 13:55:08 +00:00
float clipNear = 0.5f;
float clipFar = 10000.0f;
2023-01-05 13:21:33 +00:00
} m_camera;
float m_viewportAspectRatio = 1.0f;
2023-03-13 17:10:46 +00:00
float m_value = 0.0f;
2023-01-02 17:24:20 +00:00
};
}