|
sphore 0.0.1
SPH openGL rendering engine
|
Code handeling viewports corresponding to plots. More...
Go to the source code of this file.
Typedefs | |
| typedef struct _viewport | viewport_t |
| Public handel to viewport. | |
Functions | |
| viewport_t * | viewport_create (void) |
| Creates a viewport object. | |
| void | viewport_destroy (viewport_t *vp) |
| Destroys the given viewport. | |
| void | viewport_calculate_pixels (viewport_t *vp, int *left_x, int *bottom_y, int *width, int *height) |
| Calculates the position (in pixels) of the viewport. | |
| void | viewport_update (viewport_t *vp, int old_width, int old_height, int new_width, int new_height) |
| Updates the viewport after a change in device size. | |
| void | viewport_set (viewport_t *vp, float bottom, float left, float width, float height) |
| void | viewport_set_keep_ratio (viewport_t *vp, SREbool value) |
| void | viewport_get (viewport_t *vp, float *x, float *y, float *width, float *height) |
Code handeling viewports corresponding to plots.
| typedef struct _viewport viewport_t |
Public handel to viewport.
Memory managment handeled with viewport_create and viewport_destroy.
| void viewport_calculate_pixels | ( | viewport_t * | vp, |
| int * | left_x, | ||
| int * | bottom_y, | ||
| int * | width, | ||
| int * | height | ||
| ) |
Calculates the position (in pixels) of the viewport.
| [in] | vp | The viewport to query. |
| [in] | device | The device the viewport is accossiated with. |
| [out] | left_x | The x position of the bottom left corner of the viewport. |
| [out] | bottom_y | The y position of the bottom left corner of the viewport. |
| [out] | width | The width of the viewport. |
| [out] | height | The height of the viewport. |
| viewport_t* viewport_create | ( | void | ) |
Creates a viewport object.
| void viewport_destroy | ( | viewport_t * | vp | ) |
Destroys the given viewport.
| [in] | vp | The viewport to destroy. |
| void viewport_get | ( | viewport_t * | vp, |
| float * | x, | ||
| float * | y, | ||
| float * | width, | ||
| float * | height | ||
| ) |
| void viewport_set | ( | viewport_t * | vp, |
| float | bottom, | ||
| float | left, | ||
| float | width, | ||
| float | height | ||
| ) |
| void viewport_set_keep_ratio | ( | viewport_t * | vp, |
| SREbool | value | ||
| ) |
| void viewport_update | ( | viewport_t * | vp, |
| int | old_width, | ||
| int | old_height, | ||
| int | new_width, | ||
| int | new_height | ||
| ) |
Updates the viewport after a change in device size.
| [in] | vp | The viewport to update. |
| [in] | old_width | The previous width of the device. |
| [in] | old_height | The previous height of the device. |
| [in] | new_width | The new width of the device. |
| [in] | new_height | The new height of the device. |