istereo

annotate src/glutmain.c @ 20:21d58290e634

forgot the cam files
author John Tsiombikas <nuclear@mutantstargoat.com>
date Wed, 07 Sep 2011 10:15:35 +0300
parents bb68fac22579
children 70309d71c899
rev   line source
nuclear@1 1 #include <stdio.h>
nuclear@1 2 #include <stdlib.h>
nuclear@1 3 #include <GL/glew.h>
nuclear@1 4 #include <GL/glut.h>
nuclear@1 5 #include "sanegl.h"
nuclear@2 6 #include "istereo.h"
nuclear@2 7 #include "sdr.h"
nuclear@1 8
nuclear@1 9 void disp(void);
nuclear@1 10 void keyb(unsigned char key, int x, int y);
nuclear@1 11
nuclear@1 12 int main(int argc, char **argv)
nuclear@1 13 {
nuclear@1 14 glutInit(&argc, argv);
nuclear@7 15 glutInitWindowSize(640, 960);
nuclear@1 16 glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);
nuclear@1 17 glutCreateWindow("test");
nuclear@1 18
nuclear@1 19 glutDisplayFunc(disp);
nuclear@1 20 glutIdleFunc(glutPostRedisplay);
nuclear@1 21 glutReshapeFunc(reshape);
nuclear@1 22 glutKeyboardFunc(keyb);
nuclear@1 23
nuclear@2 24 glewInit();
nuclear@2 25
nuclear@2 26 if(init() == -1) {
nuclear@2 27 return 1;
nuclear@2 28 }
nuclear@2 29
nuclear@1 30 glutMainLoop();
nuclear@1 31 return 0;
nuclear@1 32 }
nuclear@1 33
nuclear@1 34 void disp(void)
nuclear@1 35 {
nuclear@2 36 redraw();
nuclear@1 37
nuclear@1 38 glutSwapBuffers();
nuclear@1 39 }
nuclear@1 40
nuclear@1 41 void keyb(unsigned char key, int x, int y)
nuclear@1 42 {
nuclear@1 43 switch(key) {
nuclear@1 44 case 27:
nuclear@1 45 exit(0);
nuclear@1 46
nuclear@1 47 default:
nuclear@1 48 break;
nuclear@1 49 }
nuclear@1 50 }