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

Diff of /xforms/demos/gl.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 24  Line 24 
24   * OpenGL/mesa canvas demo   * OpenGL/mesa canvas demo
25   *   *
26   * On most platforms, the mesa/OpenGL support is not compiled into   * On most platforms, the mesa/OpenGL support is not compiled into
27   * the shared library (It it in the static library). You can compile   * the shared library (It it in the static library). You can compile
28   * ../FORMS/gl.c and put it in the shared library if you have mesa/OpenGL   * ../FORMS/gl.c and put it in the shared library if you have mesa/OpenGL
29   *   *
30   *   Also you might want to make a link libGL.a to libMesaGL.a   *   Also you might want to make a link libGL.a to libMesaGL.a
# Line 112  idle_cb(XEvent *ev, void *data) Line 112  idle_cb(XEvent *ev, void *data)
112      glRotatef( xrot, 1.0, 0.0, 0.0 );      glRotatef( xrot, 1.0, 0.0, 0.0 );
113      glRotatef( yrot, 0.0, 1.0, 0.0 );      glRotatef( yrot, 0.0, 1.0, 0.0 );
114      glRotatef( zrot, 0.0, 0.0, 1.0 );      glRotatef( zrot, 0.0, 0.0, 1.0 );
115      glTranslatef(-1.0,1.2,-0.5);      glTranslatef(-1.0,1.2,-0.5);
116    
117      draw_cube();      draw_cube();
118    
# Line 141  canvas_expose(FL_OBJECT *ob, Window win, Line 141  canvas_expose(FL_OBJECT *ob, Window win,
141    
142      glMatrixMode( GL_PROJECTION );      glMatrixMode( GL_PROJECTION );
143      glLoadIdentity();      glLoadIdentity();
144      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 );
145      glTranslatef( 0.0, 0.0, -5.0 );        glTranslatef( 0.0, 0.0, -5.0 );
146    
147      glMatrixMode( GL_MODELVIEW );      glMatrixMode( GL_MODELVIEW );
148      glLoadIdentity();      glLoadIdentity();
149      glCullFace( GL_BACK );      glCullFace( GL_BACK );
150      glEnable( GL_CULL_FACE );      glEnable( GL_CULL_FACE );
151    
152      glShadeModel( GL_FLAT );      glShadeModel( GL_FLAT );
153    

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