view3d

diff src/main.c @ 3:7e982a61852a

lights and shit
author John Tsiombikas <nuclear@mutantstargoat.com>
date Thu, 19 Jan 2012 06:15:10 +0200
parents 182bfd9f55c7
children 0aee5df08cfc
line diff
     1.1 --- a/src/main.c	Thu Jan 19 01:51:05 2012 +0200
     1.2 +++ b/src/main.c	Thu Jan 19 06:15:10 2012 +0200
     1.3 @@ -30,7 +30,7 @@
     1.4  int win_width, win_height;
     1.5  int stereo;
     1.6  int flip_winding;
     1.7 -int auto_rot = 1;
     1.8 +int auto_rot;
     1.9  float cam_theta, cam_phi, cam_dist = 10;
    1.10  float near_clip = 0.5;
    1.11  float far_clip = 1000.0;
    1.12 @@ -38,11 +38,13 @@
    1.13  float stereo_focus_dist = 1.0;
    1.14  float stereo_eye_sep = 1.0 / 30.0;
    1.15  
    1.16 +int verbose = 0;
    1.17 +
    1.18  struct scene scn;
    1.19  
    1.20  int main(int argc, char **argv)
    1.21  {
    1.22 -	float ldir[] = {1, -1, -1, 0};
    1.23 +	float ldir[] = {-1, 1, 1, 0};
    1.24  	float dx, dy, dz, diag;
    1.25  
    1.26  	glutInitWindowSize(800, 600);
    1.27 @@ -64,7 +66,9 @@
    1.28  	glutSpaceballMotionFunc(sball_motion);
    1.29  	glutSpaceballRotateFunc(sball_rotate);
    1.30  	glutSpaceballButtonFunc(sball_button);
    1.31 -	glutIdleFunc(glutPostRedisplay);
    1.32 +	if(auto_rot) {
    1.33 +		glutIdleFunc(glutPostRedisplay);
    1.34 +	}
    1.35  
    1.36  	glewInit();
    1.37  
    1.38 @@ -329,6 +333,10 @@
    1.39  				flip_winding = 1;
    1.40  				break;
    1.41  
    1.42 +			case 'v':
    1.43 +				verbose = !verbose;
    1.44 +				break;
    1.45 +
    1.46  			default:
    1.47  				goto inval;
    1.48  			}