|
wx_BGI_Graphics
Classic BGI-compatible graphics API with modern OpenGL extension API
|
A 2-D camera is an orthographic camera that looks straight down at the XY ground plane (Z = 0) in the Z-up world. More...
Functions | |
| BGI_API int BGI_CALL | wxbgi_cam2d_create (const char *name) |
| Creates a 2-D overhead camera. | |
| BGI_API void BGI_CALL | wxbgi_cam2d_get_pan (const char *name, float *x, float *y) |
| Retrieves the current pan position. | |
| BGI_API void BGI_CALL | wxbgi_cam2d_get_rotation (const char *name, float *angleDeg) |
| Retrieves the current rotation in degrees. | |
| BGI_API void BGI_CALL | wxbgi_cam2d_get_zoom (const char *name, float *zoom) |
| Retrieves the current zoom level. | |
| BGI_API void BGI_CALL | wxbgi_cam2d_pan_by (const char *name, float dx, float dy) |
| Pans the 2-D camera by a world-space delta. | |
| BGI_API void BGI_CALL | wxbgi_cam2d_set_pan (const char *name, float x, float y) |
| Sets the 2-D camera pan (world-space centre of the view). | |
| BGI_API void BGI_CALL | wxbgi_cam2d_set_rotation (const char *name, float angleDeg) |
| Sets the 2-D view rotation around the Z axis. | |
| BGI_API void BGI_CALL | wxbgi_cam2d_set_world_height (const char *name, float worldUnitsHigh) |
| Sets the number of world-units visible vertically at zoom = 1. | |
| BGI_API void BGI_CALL | wxbgi_cam2d_set_zoom (const char *name, float zoom) |
| Sets the zoom level (1 = nominal, 2 = 2× magnification). | |
| BGI_API void BGI_CALL | wxbgi_cam2d_zoom_at (const char *name, float factor, float pivotX, float pivotY) |
| Zooms around a pivot point in world space. | |
A 2-D camera is an orthographic camera that looks straight down at the XY ground plane (Z = 0) in the Z-up world.
Pan, zoom, and rotation are managed through dedicated functions that keep the view always centred and aspect-correct.
Internally a 2-D camera is stored as a Camera3D with is2D = true; it participates in the same registry and all wxbgi_cam_* functions work on it as well.
Creates a 2-D overhead camera.
Returns an error if a camera with the same name already exists. The reserved name "default" is always rejected. The initial view is centred on world origin (0,0), zoom = 1, no rotation, and the window height in world-units visible vertically.
| name | Camera identifier string (must not be NULL). |
graphresult() to grDuplicateName). Retrieves the current pan position.
Retrieves the current rotation in degrees.
Retrieves the current zoom level.
Pans the 2-D camera by a world-space delta.
| name | Camera name, or NULL for the active camera. |
Sets the 2-D camera pan (world-space centre of the view).
| name | Camera name, or NULL for the active camera. |
Sets the 2-D view rotation around the Z axis.
| name | Camera name, or NULL for the active camera. |
| angleDeg | Rotation in degrees (positive = counter-clockwise). |
Sets the number of world-units visible vertically at zoom = 1.
Changing this value rescales the entire coordinate space without altering the zoom or pan. Default is 720 world-units (matching a 720-pixel-tall window at 1:1 scale).
| name | Camera name, or NULL for the active camera. |
| worldUnitsHigh | Visible world-unit height at zoom = 1. |
Sets the zoom level (1 = nominal, 2 = 2× magnification).
The zoom is clamped to a minimum of 1e-6 to prevent division by zero.
| name | Camera name, or NULL for the active camera. |
| BGI_API void BGI_CALL wxbgi_cam2d_zoom_at | ( | const char * | name, |
| float | factor, | ||
| float | pivotX, | ||
| float | pivotY | ||
| ) |
Zooms around a pivot point in world space.
The world point under pivotX / pivotY remains stationary on screen while the zoom level is multiplied by factor.
| name | Camera name, or NULL for the active camera. |
| factor | Zoom multiplier (e.g. 1.1 to zoom in 10 %). |
| pivotX | World X of the zoom pivot. |
| pivotY | World Y of the zoom pivot. |