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