glviewvol

diff src/main.cc @ 4:04330eb80b36

lots of stuff
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 29 Dec 2014 05:41:36 +0200
parents 32c4a7160350
children f22be47a3572
line diff
     1.1 --- a/src/main.cc	Sun Dec 28 21:48:15 2014 +0200
     1.2 +++ b/src/main.cc	Mon Dec 29 05:41:36 2014 +0200
     1.3 @@ -20,6 +20,8 @@
     1.4  static void mouse(int bn, int state, int x, int y);
     1.5  static void motion(int x, int y);
     1.6  
     1.7 +static int win_width, win_height;
     1.8 +
     1.9  int main(int argc, char **argv)
    1.10  {
    1.11  	glutInit(&argc, argv);
    1.12 @@ -65,6 +67,12 @@
    1.13  	exit(0);
    1.14  }
    1.15  
    1.16 +void get_window_size(int *xsz, int *ysz)
    1.17 +{
    1.18 +	*xsz = win_width;
    1.19 +	*ysz = win_height;
    1.20 +}
    1.21 +
    1.22  static void display()
    1.23  {
    1.24  	ev_display();
    1.25 @@ -72,6 +80,8 @@
    1.26  
    1.27  static void reshape(int x, int y)
    1.28  {
    1.29 +	win_width = x;
    1.30 +	win_height = y;
    1.31  	ev_reshape(x, y);
    1.32  }
    1.33