summaryrefslogtreecommitdiff
path: root/tools/camera/camexamp.h
diff options
context:
space:
mode:
authorclaude-bot <[email protected]>2026-07-13 12:40:03 +0000
committerclaude-bot <[email protected]>2026-07-13 12:40:03 +0000
commit847962910f0bff071f3bf07c9abb87764fb6cac3 (patch)
treeddcd429e134c7fd5f72ddc97ced175de8d66fcd0 /tools/camera/camexamp.h
downloadlibrw-847962910f0bff071f3bf07c9abb87764fb6cac3.tar.gz
librw-847962910f0bff071f3bf07c9abb87764fb6cac3.zip
Import aap/librw @ masterHEADmaster
Snapshot for re3/reVC vendoring, per @lzcnt. Source: https://github.com/aap/librw (master).
Diffstat (limited to 'tools/camera/camexamp.h')
-rw-r--r--tools/camera/camexamp.h62
1 files changed, 62 insertions, 0 deletions
diff --git a/tools/camera/camexamp.h b/tools/camera/camexamp.h
new file mode 100644
index 0000000..7df301f
--- /dev/null
+++ b/tools/camera/camexamp.h
@@ -0,0 +1,62 @@
+struct TextureCamera
+{
+ rw::Raster *raster;
+ rw::Raster *zRaster;
+ rw::Camera *camera;
+ rw::Texture *texture;
+};
+
+struct CameraData
+{
+ float farClipPlane;
+ float nearClipPlane;
+ rw::uint32 projection;
+ rw::V2d offset;
+ rw::V2d viewWindow;
+ rw::Camera *camera;
+ TextureCamera *cameraTexture;
+ rw::Matrix *matrix;
+};
+
+enum CameraDataType
+{
+ NONE = 0x00,
+ FARCLIPPLANE = 0x01,
+ NEARCLIPPLANE = 0x02,
+ PROJECTION = 0x04,
+ OFFSET = 0x08,
+ VIEWWINDOW = 0x10,
+ MATRIX = 0x20,
+ ALL = 0xFF
+};
+
+extern rw::Camera *MainCamera;
+extern rw::Camera *SubCamera;
+
+extern rw::int32 CameraSelected;
+extern rw::int32 ProjectionIndex;
+
+extern CameraData SubCameraData;
+
+void CameraQueryData(CameraData *data, CameraDataType type, rw::Camera *camera);
+void CameraSetData(CameraData *data, CameraDataType type);
+
+void ChangeViewOffset(float deltaX, float deltaY);
+void ChangeViewWindow(float deltaX, float deltaY);
+void ProjectionCallback(void);
+void ClipPlaneCallback(void);
+
+void CamerasCreate(rw::World *world);
+void CamerasDestroy(rw::World *world);
+void CameraSizeUpdate(rw::Rect *rect, float viewWindow, float aspectRatio);
+void RenderSubCamera(rw::RGBA *foregroundColor, rw::int32 clearMode, rw::World *world);
+void RenderTextureCamera(rw::RGBA *foregroundColor, rw::int32 clearMode, rw::World *world);
+void SubCameraMiniViewSelect(bool select);
+
+void CameraTextureInit(TextureCamera *ct);
+void CameraTextureTerm(TextureCamera *ct);
+void DrawCameraFrustum(CameraData *c);
+void DrawCameraViewplaneTexture(CameraData *c);
+
+void ViewerRotate(rw::Camera *camera, float deltaX, float deltaY);
+void ViewerTranslate(rw::Camera *camera, float deltaX, float deltaY);