using Ghost.Core;
using Ghost.Entities;
using Ghost.Graphics.Core;
using Ghost.Graphics.RHI;
using Misaki.HighPerformance.Mathematics;

namespace Ghost.Engine.Components;

public unsafe struct Camera : IComponentData
{
    public float nearClipPlane;
    public float farClipPlane;

    public float2 sensorSize; // mm
    public GateFit gateFit;
    public float iso;
    public float shutterSpeed;
    public float aperture;
    public float focalLength; // mm
    public float focusDistance; // m

    public RenderingLayerMask renderingLayerMask;

    public int swapChainIndex; // The index of the swap chain to render to. -1 means render to rt only.
    public int priority;

    public Handle<GPUTexture> colorTarget;
    public Handle<GPUTexture> depthTarget;
    // TODO: Add more render targets like motion vector, etc.

    // Custim render function. If it's not null, the render system will call this function instead of the default render pipeline.
    public delegate*<ref readonly RenderContext, ref readonly RenderRequest, void> renderFunc;
}
