conworlds

diff src/main.cc @ 13:283cdfa7dda2

added a crapload of code from goat3dgfx
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 24 Aug 2014 09:41:24 +0300
parents 778ed91cb7fd
children c814f77d177e
line diff
     1.1 --- a/src/main.cc	Sat Aug 23 12:03:29 2014 +0300
     1.2 +++ b/src/main.cc	Sun Aug 24 09:41:24 2014 +0300
     1.3 @@ -2,6 +2,7 @@
     1.4  #include <stdlib.h>
     1.5  #include "opengl.h"
     1.6  #include "game.h"
     1.7 +#include "gameopt.h"
     1.8  #include "vr/vr.h"
     1.9  
    1.10  static bool init();
    1.11 @@ -23,8 +24,13 @@
    1.12  {
    1.13  	glutInitWindowSize(1024, 600);
    1.14  	glutInit(&argc, argv);
    1.15 -	glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);
    1.16 -	glutCreateWindow("VR Chess");
    1.17 +
    1.18 +	if(!parse_args(argc, argv)) {
    1.19 +		return 1;
    1.20 +	}
    1.21 +
    1.22 +	glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE | (opt.stereo ? GLUT_STEREO : 0));
    1.23 +	glutCreateWindow("LD48 #30 - connected worlds");
    1.24  
    1.25  	glutDisplayFunc(display);
    1.26  	glutIdleFunc(idle);
    1.27 @@ -53,10 +59,12 @@
    1.28  		return false;
    1.29  	}
    1.30  
    1.31 -	int win_xsz = vr_get_opti(VR_OPT_DISPLAY_WIDTH);
    1.32 -	int win_ysz = vr_get_opti(VR_OPT_DISPLAY_HEIGHT);
    1.33 -	if(win_xsz && win_ysz) {
    1.34 -		glutReshapeWindow(win_xsz, win_ysz);
    1.35 +	if(opt.vr) {
    1.36 +		int win_xsz = vr_get_opti(VR_OPT_DISPLAY_WIDTH);
    1.37 +		int win_ysz = vr_get_opti(VR_OPT_DISPLAY_HEIGHT);
    1.38 +		if(win_xsz && win_ysz) {
    1.39 +			glutReshapeWindow(win_xsz, win_ysz);
    1.40 +		}
    1.41  	}
    1.42  	return true;
    1.43  }
    1.44 @@ -110,8 +118,8 @@
    1.45  			if(xoffs || yoffs) {
    1.46  				printf("repositioning: %d,%d\n", xoffs, yoffs);
    1.47  				glutPositionWindow(xoffs, yoffs);
    1.48 -				fullscreen_pending = true;
    1.49  			}
    1.50 +			fullscreen_pending = true;
    1.51  		} else {
    1.52  			fullscreen_pending = false;
    1.53  			glutPositionWindow(prev_xpos, prev_ypos);