#pragma once #include enum { CAMU_VIEW_NONE = 0, CAMU_VIEW_AUTOFIT, CAMU_VIEW_ZOOM, CAMU_VIEW_DETACHED }; enum { CAMU_VIEW_ROTATION_0 = 0, CAMU_VIEW_ROTATION_90, CAMU_VIEW_ROTATION_180, CAMU_VIEW_ROTATION_270, CAMU_VIEW_ROTATION_360 }; enum { CAMU_VR_DISABLED = 0, CAMU_VR_180, CAMU_VR_360 }; #define CAMU_DEFAULT_VIEW CAMU_VIEW_AUTOFIT #define CAMU_DEFAULT_FOV 80.0 struct camu_view { u8 mode; u8 rotation; u32 width; u32 height; s32 zindex; f64 zoom; f64 x_offset; f64 y_offset; f64 stretch; f64 fov; }; void camu_view_init(struct camu_view *view, u32 width, u32 height); void camu_view_calculate(struct camu_view *view, u32 window_width, u32 window_height); bool camu_view_zoom_simple(struct camu_view *view, u32 window_width, u32 window_height, f64 x, f64 y, f64 v); bool camu_view_pan_simple(struct camu_view *view, u32 window_width, u32 window_height, f64 dx, f64 dy); bool camu_view_zoom_fov(struct camu_view *view, f64 v);