vrchess

diff src/main.cc @ 11:5dc4e2b8f6f5

LibOVR is broken
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 23 Aug 2014 00:24:20 +0300
parents c2eecf764daa
children 778ed91cb7fd
line diff
     1.1 --- a/src/main.cc	Fri Aug 22 20:11:15 2014 +0300
     1.2 +++ b/src/main.cc	Sat Aug 23 00:24:20 2014 +0300
     1.3 @@ -84,6 +84,30 @@
     1.4  
     1.5  static void keyb(unsigned char key, int x, int y)
     1.6  {
     1.7 +	static bool fullscr;
     1.8 +	static int prev_xsz, prev_ysz;
     1.9 +
    1.10 +	switch(key) {
    1.11 +	case 'f':
    1.12 +		fullscr = !fullscr;
    1.13 +		if(fullscr) {
    1.14 +			int xoffs, yoffs;
    1.15 +
    1.16 +			prev_xsz = glutGet(GLUT_WINDOW_WIDTH);
    1.17 +			prev_ysz = glutGet(GLUT_WINDOW_HEIGHT);
    1.18 +
    1.19 +			xoffs = vr_get_opti(VR_OPT_WIN_XOFFS);
    1.20 +			yoffs = vr_get_opti(VR_OPT_WIN_YOFFS);
    1.21 +			if(xoffs || yoffs) {
    1.22 +				printf("repositioning: %d,%d\n", xoffs, yoffs);
    1.23 +				glutPositionWindow(xoffs + 1, yoffs + 1);
    1.24 +			}
    1.25 +			glutFullScreen();
    1.26 +		} else {
    1.27 +			glutReshapeWindow(prev_xsz, prev_ysz);
    1.28 +		}
    1.29 +		break;
    1.30 +	}
    1.31  	game_keyboard(key, true, x, y);
    1.32  }
    1.33