nuclear@39: /* nuclear@39: Stereoscopic tunnel for iOS. nuclear@39: Copyright (C) 2011 John Tsiombikas nuclear@39: nuclear@39: This program is free software: you can redistribute it and/or modify nuclear@39: it under the terms of the GNU General Public License as published by nuclear@39: the Free Software Foundation, either version 3 of the License, or nuclear@39: (at your option) any later version. nuclear@39: nuclear@39: This program is distributed in the hope that it will be useful, nuclear@39: but WITHOUT ANY WARRANTY; without even the implied warranty of nuclear@39: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the nuclear@39: GNU General Public License for more details. nuclear@39: nuclear@39: You should have received a copy of the GNU General Public License nuclear@39: along with this program. If not, see . nuclear@39: */ nuclear@39: nuclear@39: nuclear@1: #include nuclear@1: #include nuclear@1: #include nuclear@1: #include nuclear@1: #include "sanegl.h" nuclear@2: #include "istereo.h" nuclear@2: #include "sdr.h" nuclear@1: nuclear@1: void disp(void); nuclear@1: void keyb(unsigned char key, int x, int y); nuclear@1: nuclear@1: int main(int argc, char **argv) nuclear@1: { nuclear@1: glutInit(&argc, argv); nuclear@39: glutInitWindowSize(640, 920); nuclear@1: glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE); nuclear@1: glutCreateWindow("test"); nuclear@1: nuclear@1: glutDisplayFunc(disp); nuclear@1: glutIdleFunc(glutPostRedisplay); nuclear@1: glutReshapeFunc(reshape); nuclear@1: glutKeyboardFunc(keyb); nuclear@1: nuclear@2: glewInit(); nuclear@2: nuclear@2: if(init() == -1) { nuclear@2: return 1; nuclear@2: } nuclear@2: nuclear@1: glutMainLoop(); nuclear@1: return 0; nuclear@1: } nuclear@1: nuclear@1: void disp(void) nuclear@1: { nuclear@2: redraw(); nuclear@1: nuclear@1: glutSwapBuffers(); nuclear@1: } nuclear@1: nuclear@24: extern int stereo; nuclear@31: extern int use_bump; nuclear@24: nuclear@1: void keyb(unsigned char key, int x, int y) nuclear@1: { nuclear@1: switch(key) { nuclear@1: case 27: nuclear@1: exit(0); nuclear@1: nuclear@24: case 's': nuclear@24: stereo = !stereo; nuclear@24: break; nuclear@24: nuclear@31: case 'b': nuclear@31: use_bump = !use_bump; nuclear@31: break; nuclear@31: nuclear@24: case '`': nuclear@24: { nuclear@24: int xsz = glutGet(GLUT_WINDOW_WIDTH); nuclear@24: int ysz = glutGet(GLUT_WINDOW_HEIGHT); nuclear@24: nuclear@24: glutReshapeWindow(ysz, xsz); nuclear@24: } nuclear@24: break; nuclear@24: nuclear@1: default: nuclear@1: break; nuclear@1: } nuclear@1: }