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 |
|
|
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(); |
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; |