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 |
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 |
|
|
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 |
|
|