/[xforms]/xforms/demos/glwin.c
ViewVC logotype

Diff of /xforms/demos/glwin.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by leeming, Thu Apr 24 09:35:33 2003 UTC revision 1.4 by leeming, Tue Sep 9 00:28:25 2003 UTC
# Line 64  int main(int argc, char *argv[]) Line 64  int main(int argc, char *argv[])
64    
65     if(!(glwin = fl_glwincreate(config, &context, 250, 250)))     if(!(glwin = fl_glwincreate(config, &context, 250, 250)))
66     {     {
67        fprintf(stderr,"GLWin: Can't create OpenGL window\n");        fprintf(stderr,"GLWin: Can't create OpenGL window\n");
68        exit(0);        exit(0);
69     }     }
70    
# Line 140  int animate(XEvent *ev, void *data) Line 140  int animate(XEvent *ev, void *data)
140      glRotatef( xrot, 1.0, 0.0, 0.0 );      glRotatef( xrot, 1.0, 0.0, 0.0 );
141      glRotatef( yrot, 0.0, 1.0, 0.0 );      glRotatef( yrot, 0.0, 1.0, 0.0 );
142      glRotatef( zrot, 0.0, 0.0, 1.0 );      glRotatef( zrot, 0.0, 0.0, 1.0 );
143      glTranslatef(-1.0,1.2,-0.5);      glTranslatef(-1.0,1.2,-0.5);
144      draw_cube();      draw_cube();
145      glPopMatrix();      glPopMatrix();
146      glFinish();      glFinish();
# Line 162  handle_expose(XEvent *xev, void *data) Line 162  handle_expose(XEvent *xev, void *data)
162  {  {
163      FL_Coord w ,h ;      FL_Coord w ,h ;
164    
165      fl_get_winsize(glwin, &w, &h);      fl_get_winsize(glwin, &w, &h);
166      glViewport(0,0, w, h);      glViewport(0,0, w, h);
167    
168      glClearColor(0.0,0.0,0.0,0.0);      glClearColor(0.0,0.0,0.0,0.0);
169    
170      glMatrixMode( GL_PROJECTION );      glMatrixMode( GL_PROJECTION );
171      glLoadIdentity();      glLoadIdentity();
172      glFrustum( -1.0, 1.0,  -1.0, 1.0,  1.0, 10.0 );      glFrustum( -1.0, 1.0,  -1.0, 1.0,  1.0, 10.0 );
173      glTranslatef( 0.0, 0.0, -5.0 );        glTranslatef( 0.0, 0.0, -5.0 );
174    
175      glMatrixMode( GL_MODELVIEW );      glMatrixMode( GL_MODELVIEW );
176      glLoadIdentity();      glLoadIdentity();
177      glCullFace( GL_BACK );      glCullFace( GL_BACK );
178      glEnable( GL_CULL_FACE );      glEnable( GL_CULL_FACE );
179      glShadeModel( GL_FLAT );      glShadeModel( GL_FLAT );
180      animate(xev, 0);      animate(xev, 0);
181      return 0;      return 0;

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26