sphore 0.0.1
SPH openGL rendering engine
|
00001 /******************************************************************** 00002 * sphore - SPH Opengl Rendering Engine 00003 * 00004 * This file is (or was) part of sphore. 00005 * sphore comes with ABSOLUTELY NO WARRANTY. 00006 * This is free software; and you are welcome to redistribute 00007 * it under the terms of the GNU General Public License 00008 * (see LICENSE file for details) and the provision that 00009 * this notice remains intact. If you modify this file, please 00010 * note section 2a) of the GPLv2 states that: 00011 * 00012 * a) You must cause the modified files to carry prominent notices 00013 * stating that you changed the files and the date of any change. 00014 * 00015 * Copyright (C) 2011 James Wetter. All rights reserved. 00016 * Contact: wetter.j@gmail.com 00017 * 00018 ********************************************************************/ 00019 00025 #ifndef VIEWPORT_H 00026 #define VIEWPORT_H 00027 00033 typedef struct _viewport viewport_t; 00034 00040 viewport_t *viewport_create (void); 00041 00047 void viewport_destroy (viewport_t * vp); 00048 00059 void 00060 viewport_calculate_pixels (viewport_t * vp, 00061 int *left_x, int *bottom_y, int *width, 00062 int *height); 00063 00073 void 00074 viewport_update (viewport_t * vp, int old_width, int old_height, 00075 int new_width, int new_height); 00076 00077 void 00078 viewport_set (viewport_t * vp, float bottom, float left, float width, 00079 float height); 00080 00081 void viewport_set_keep_ratio (viewport_t * vp, SREbool value); 00082 00083 void 00084 viewport_get (viewport_t * vp, float *x, float *y, float *width, 00085 float *height); 00086 #endif