Files Classes Functions Hierarchy
00001 #include <openwindowresource.h> 00002 00003 #include <GL/glut.h> 00004 #include <GL/gl.h> 00005 00006 #include <zpr.h> 00007 00008 #include <gobj.h> 00009 #include <graphmisc.h> 00010 00011 00012 gobjContainer xGraphics; 00013 00014 00015 void keyboard(unsigned char key, int x, int y) 00016 { 00017 switch (key) 00018 { 00019 case 27: 00020 exit(0); 00021 break; 00022 00023 } 00024 } 00025 00026 void display() 00027 { 00028 glPushMatrix(); // save 00029 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 00030 00031 axes(1.0); 00032 00033 gobj::global->draw(); 00034 00035 glerrordisplay(); 00036 00037 glutSwapBuffers(); 00038 glPopMatrix(); // restore 00039 } 00040 00041 openwindowresource::openwindowresource 00042 ( 00043 int argc, 00044 char** & argv 00045 ) 00046 { 00047 glutInit(&argc,argv); 00048 glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH); 00049 wx=600; 00050 wy=600; 00051 00052 glutInitWindowSize(wx,wy); 00053 00054 glutCreateWindow(""); 00055 00056 glutDisplayFunc(display); 00057 glutKeyboardFunc(keyboard); 00058 00059 OpenGLinitialisation(); 00060 00061 glEnable(GL_DEPTH_TEST); 00062 glEnable(GL_CULL_FACE); 00063 00064 xGraphics.set(); 00065 } 00066 00067 openwindowresource::~openwindowresource() 00068 { 00069 00070 // zpr::setViewVolumeFromXaxis(wx,wy,-2.0,10.0,-2.0,-1.0,1.0); 00071 00072 // zprInit(); 00073 zpr zz; 00074 zz.update(); 00075 glutMainLoop(); 00076 } 00077 00078 00079
1.5.8