sphore 0.0.1
SPH openGL rendering engine
|
Code handeling viewports corresponding to plots. More...
Data Structures | |
struct | _viewport |
Internal storage for viewports. More... | |
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.
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. |