You are on page 1of 23

1 #include<stdio.

h>
2 #include<stdlib.h>
3 #include<GL/glut.h>
4 #include<math.h>
5 #include<windows.h>
6 #include<gl.h>
7 int flag=0,ch=0,ch1=0;
8 float a=0,b=0,c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,p=0,q=0,s=0.7,x=0,y=0;
9 void create_menu(void);
10 void menu(int);
11 void disp1(void);
12 void disp2(void);
13 void disp3(void);
14 void disp4(void);
15
16 void delay(int time)
17 {
18 float i,j,k;
19
20 for(i=0;i<time;i=i+0.001);
21 for(j=0;j<time;j=j+0.001);
22 for(k=0;k<time;k=k+0.001);
23 }
24
25
26 void fish1()
27 {
28 glColor3f(1.0,0.0,0.0);//red fish
29 glBegin(GL_POLYGON);
30 glVertex2f(0.7+a,0.05);
31
32 glVertex2f(0.75+a,0.1);
33
34 glVertex2f(0.85+a,0.05);
35 glVertex2f(0.75+a,0.0);
36 glEnd();
37
38
39 glBegin(GL_TRIANGLES);
40 glColor3f(1.0,0.0,0.0);
41 glVertex2f(0.83+a,0.05);
42 glColor3f(1.0,1.0,0.0);
43 glVertex2f(0.9+a,0.09);
44 glVertex2f(0.9+a,0.01);
45 glEnd();
46
47 glBegin(GL_TRIANGLES);
48 glColor3f(1.0,1.0,0.0);
49 glVertex2f(0.75+a,0.095);
50 glColor3f(1.0,0.0,0.0);
51 glVertex2f(0.79+a,0.125);
52 glVertex2f(0.77+a,0.07);
53 glEnd();
54
55 glBegin(GL_TRIANGLES);
56 glColor3f(1.0,1.0,0.0);
57 glVertex2f(0.75+a,0.007);
58 glColor3f(1.0,0.0,0.0);
59 glVertex2f(0.795+a,-0.035);
60 glVertex2f(0.77+a,0.02);
61 glEnd();
62
63
64 glColor3f(0.0,0.0,0.0);
65 glPointSize(4.0);
66 glBegin(GL_POINTS);
67 glVertex2f(0.73+a,0.065);
68 glEnd();
69
70 }
71
72 void fish11()
73 {
74
75 glColor3f(1.0,0.0,0.0);//red fish
76 glBegin(GL_POLYGON);
77 glVertex2f(-0.7,0.05);
78 glVertex2f(-0.75,0.1);
79 glVertex2f(-0.85,0.05);
80 glVertex2f(-0.75,0.0);
81 glEnd();
82
83
84 glBegin(GL_TRIANGLES);
85 glVertex2f(-0.83,0.05);
86 glVertex2f(-0.9,0.09);
87 glVertex2f(-0.9,0.01);
88 glEnd();
89
90 glBegin(GL_TRIANGLES);
91 glVertex2f(-0.75,0.095);
92 glVertex2f(-0.79,0.125);
93 glVertex2f(-0.77,0.07);
94 glEnd();
95
96 glBegin(GL_TRIANGLES);
97 glVertex2f(-0.75,0.007);
98 glVertex2f(-0.795,-0.035);
99 glVertex2f(-0.77,0.02);
100 glEnd();
101
102
103 glColor3f(0.0,0.0,0.0);
104 glPointSize(4.0);
105 glBegin(GL_POINTS);
106 glVertex2f(-0.73,0.065);
107 glEnd();
108 }
109
110
111
112 void fish2()
113 {
114 glColor3f(1.0,1.0,0.0);//yellow fish
115 glBegin(GL_POLYGON);
116 glVertex2f(-0.7-b,-0.05);
117 glVertex2f(-0.75-b,-0.1);
118 glVertex2f(-0.85-b,-0.05);
119 glVertex2f(-0.75-b,0.0);
120 glEnd();
121
122 glBegin(GL_TRIANGLES);
123 glColor3f(0.8,0.5,0.0);
124 glVertex2f(-0.83-b,-0.05);
125 glVertex2f(-0.9-b,-0.09);
126 glVertex2f(-0.9-b,-0.01);
127 glEnd();
128
129 glBegin(GL_TRIANGLES);
130 glColor3f(0.8,0.5,0.0);
131 glVertex2f(-0.75-b,-0.095);
132 glVertex2f(-0.79-b,-0.125);
133 glVertex2f(-0.77-b,-0.07);
134 glEnd();
135
136 glBegin(GL_TRIANGLES);
137 glColor3f(0.8,0.5,0.0);
138 glVertex2f(-0.75-b,-0.007);
139 glVertex2f(-0.795-b,0.035);
140 glVertex2f(-0.77-b,-0.02);
141 glEnd();
142
143 glColor3f(0.0,0.0,0.0);
144 glPointSize(4.0);
145 glBegin(GL_POINTS);
146 glVertex2f(-0.73-b,-0.035);
147 glEnd();
148 }
149
150
151 void fish21()
152 {
153 glColor3f(1.0,1.0,0.0);//yellow fish
154 glBegin(GL_POLYGON);
155 glVertex2f(-0.7+y,-0.05);
156 glVertex2f(-0.75+y,-0.1);
157 glVertex2f(-0.85+y,-0.05);
158 glVertex2f(-0.75+y,0.0);
159 glEnd();
160
161 glBegin(GL_TRIANGLES);
162 glColor3f(0.8,0.5,0.0);
163 glVertex2f(-0.83+y,-0.05);
164 glVertex2f(-0.9+y,-0.09);
165 glVertex2f(-0.9+y,-0.01);
166 glEnd();
167
168 glBegin(GL_TRIANGLES);
169 glColor3f(0.8,0.5,0.0);
170 glVertex2f(-0.75+y,-0.095);
171 glVertex2f(-0.79+y,-0.125);
172 glVertex2f(-0.77+y,-0.07);
173 glEnd();
174
175 glBegin(GL_TRIANGLES);
176 glColor3f(0.8,0.5,0.0);
177 glVertex2f(-0.75+y,-0.007);
178 glVertex2f(-0.795+y,0.035);
179 glVertex2f(-0.77+y,-0.02);
180 glEnd();
181
182 glColor3f(0.0,0.0,0.0);
183 glPointSize(4.0);
184 glBegin(GL_POINTS);
185 glVertex2f(-0.73+y,-0.035);
186 glEnd();
187 }
188
189
190 void fish22()
191 {
192 glColor3f(1.0,1.0,0.0);//yellow fish
193 glBegin(GL_POLYGON);
194 glVertex2f(0.7,-0.05);
195 glVertex2f(0.75,-0.1);
196 glVertex2f(0.85,-0.05);
197 glVertex2f(0.75,0.0);
198 glEnd();
199
200 glBegin(GL_TRIANGLES);
201 glVertex2f(0.83,-0.05);
202 glColor3f(1.8,0.5,0.0);
203 glVertex2f(0.9,-0.09);
204 glVertex2f(0.9,-0.01);
205 glEnd();
206
207 glBegin(GL_TRIANGLES);
208 glColor3f(1.0,1.0,0.0);
209 glVertex2f(0.79,-0.125);
210 glVertex2f(0.77,-0.07);
211
212 glVertex2f(0.75,-0.095);
213
214 glEnd();
215
216 glBegin(GL_TRIANGLES);
217 glVertex2f(0.795,0.035);
218 glVertex2f(0.77,-0.02);
219
220 glVertex2f(0.75,-0.007);
221
222 glEnd();
223
224 glColor3f(0.0,0.0,0.0);
225 glPointSize(4.0);
226 glBegin(GL_POINTS);
227 glVertex2f(0.73,-0.035);
228 glEnd();
229 }
230
231
232 void fish3()
233 {
234 glColor3f(0.0,1.0,0.0);//green fish
235 glBegin(GL_POLYGON);
236 glVertex2f(0.8,0.15);
237 glVertex2f(0.85,0.2);
238 glVertex2f(0.95,0.15);
239 glVertex2f(0.85,0.10);
240 glEnd();
241
242 glBegin(GL_TRIANGLES);
243 glVertex2f(0.93,0.15);
244 glVertex2f(0.98,0.19);
245 glVertex2f(0.98,0.11);
246 glEnd();
247
248
249 glBegin(GL_TRIANGLES);
250 glVertex2f(0.855,0.2);
251 glVertex2f(0.925,0.25);
252 glVertex2f(0.87,0.15);
253 glEnd();
254
255 glBegin(GL_TRIANGLES);
256 glVertex2f(0.857,0.1);
257 glVertex2f(0.925,0.05);
258 glVertex2f(0.87,0.15);
259 glEnd();
260
261 glColor3f(0.0,0.0,0.0);
262 glPointSize(4.0);
263 glBegin(GL_POINTS);
264 glVertex2f(0.83,0.165);
265 glEnd();
266
267 }
268
269 void fish333()
270 {
271 glColor3f(0.0,1.0,0.0);//green fish
272 glBegin(GL_POLYGON);
273 glVertex2f(-0.8+x,0.15);
274 glVertex2f(-0.85+x,0.2);
275 glVertex2f(-0.95+x,0.15);
276 glVertex2f(-0.85+x,0.10);
277 glEnd();
278
279 glBegin(GL_TRIANGLES);
280 glVertex2f(-0.93+x,0.15);
281 glVertex2f(-0.98+x,0.19);
282 glVertex2f(-0.98+x,0.11);
283 glEnd();
284
285
286 glBegin(GL_TRIANGLES);
287 glVertex2f(-0.855+x,0.2);
288 glVertex2f(-0.925+x,0.25);
289 glVertex2f(-0.87+x,0.15);
290 glEnd();
291
292 glBegin(GL_TRIANGLES);
293 glVertex2f(-0.857+x,0.1);
294 glVertex2f(-0.925+x,0.05);
295 glVertex2f(-0.87+x,0.15);
296 glEnd();
297
298 glColor3f(0.0,0.0,0.0);
299 glPointSize(4.0);
300 glBegin(GL_POINTS);
301 glVertex2f(-0.83+x,0.165);
302 glEnd();
303
304
305 }
306
307
308
309 void fish33()
310 {
311 glColor3f(0.0,1.0,0.0);//green fish
312 glBegin(GL_POLYGON);
313 glVertex2f(-0.8,0.15);
314 glVertex2f(-0.85,0.2);
315 glVertex2f(-0.95,0.15);
316 glVertex2f(-0.85,0.10);
317 glEnd();
318
319 glBegin(GL_TRIANGLES);
320 glVertex2f(-0.93,0.15);
321 glVertex2f(-0.98,0.19);
322 glVertex2f(-0.98,0.11);
323 glEnd();
324
325
326 glBegin(GL_TRIANGLES);
327 glVertex2f(-0.855,0.2);
328 glVertex2f(-0.925,0.25);
329 glVertex2f(-0.87,0.15);
330 glEnd();
331
332 glBegin(GL_TRIANGLES);
333 glVertex2f(-0.857,0.1);
334 glVertex2f(-0.925,0.05);
335 glVertex2f(-0.87,0.15);
336 glEnd();
337
338 glColor3f(0.0,0.0,0.0);
339 glPointSize(4.0);
340 glBegin(GL_POINTS);
341 glVertex2f(-0.83,0.165);
342 glEnd();
343
344 }
345
346
347
348 void fish4()
349 {
350 glColor3f(0.5,0.6,0.0);// green1 fish
351 glBegin(GL_POLYGON);
352 glVertex2f(-0.7+d,-0.15);
353 glVertex2f(-0.75+d,-0.2);
354 glVertex2f(-0.85+d,-0.15);
355 glVertex2f(-0.75+d,-0.1);
356 glEnd();
357
358 glBegin(GL_TRIANGLES);
359 glVertex2f(-0.83+d,-0.15);
360 glVertex2f(-0.9+d,-0.19);
361 glVertex2f(-0.9+d,-0.11);
362 glEnd();
363
364
365 glBegin(GL_TRIANGLES);
366 glVertex2f(-0.755+d,-0.2);
367 glVertex2f(-0.795+d,-0.25);
368 glVertex2f(-0.775+d,-0.15);
369 glEnd();
370
371 glBegin(GL_TRIANGLES);
372 glVertex2f(-0.755+d,-0.1);
373 glVertex2f(-0.795+d,-0.05);
374 glVertex2f(-0.775+d,-0.15);
375 glEnd();
376
377 glColor3f(0.0,0.0,0.0);
378 glPointSize(4.0);
379 glBegin(GL_POINTS);
380 glVertex2f(-0.73+d,-0.135);
381 glEnd();
382 }
383
384
385 void fish44()
386 {
387 glColor3f(0.5,0.6,0.0);// green1 fish
388 glBegin(GL_POLYGON);
389 glVertex2f(0.7,-0.15);
390 glVertex2f(0.75,-0.2);
391 glVertex2f(0.85,-0.15);
392 glVertex2f(0.75,-0.1);
393 glEnd();
394
395 glBegin(GL_TRIANGLES);
396 glVertex2f(0.83,-0.15);
397 glVertex2f(0.9,-0.19);
398 glVertex2f(0.9,-0.11);
399 glEnd();
400
401
402 glBegin(GL_TRIANGLES);
403 glVertex2f(0.755,-0.2);
404 glVertex2f(0.795,-0.25);
405 glVertex2f(0.775,-0.15);
406 glEnd();
407
408 glBegin(GL_TRIANGLES);
409 glVertex2f(0.755,-0.1);
410 glVertex2f(0.795,-0.05);
411 glVertex2f(0.775,-0.15);
412 glEnd();
413
414 glColor3f(0.0,0.0,0.0);
415 glPointSize(4.0);
416 glBegin(GL_POINTS);
417 glVertex2f(0.73,-0.135);
418 glEnd();
419 }
420
421
422
423 void fish5()
424 {
425 glColor3f(0.0,0.0,1.0);//blue fish
426 glBegin(GL_POLYGON);
427 glVertex2f(-0.7-e,-0.25);
428 glVertex2f(-0.75-e,-0.3);
429 glVertex2f(-0.775-e,-0.3);
430 glVertex2f(-0.85-e,-0.25);
431 glVertex2f(-0.775-e,-0.2);
432 glVertex2f(-0.75-e,-0.2);
433 glEnd();
434
435 glBegin(GL_TRIANGLES);
436 glVertex2f(-0.83-e,-0.25);
437 glVertex2f(-0.9-e,-0.29);
438 glVertex2f(-0.9-e,-0.21);
439 glEnd();
440
441 glBegin(GL_TRIANGLES);
442 glVertex2f(-0.775-e,-0.2);
443 glVertex2f(-0.79-e,-0.125);
444 glVertex2f(-0.75-e,-0.2);
445 glEnd();
446
447 glBegin(GL_TRIANGLES);
448 glVertex2f(-0.75-e,-0.3);
449 glVertex2f(-0.795-e,-0.35);
450 glVertex2f(-0.775-e,-0.3);
451 glEnd();
452
453 glColor3f(0.0,0.0,0.0);
454 glPointSize(4.0);
455 glBegin(GL_POINTS);
456 glVertex2f(-0.73-e,-0.235);
457 glEnd();
458 }
459
460
461
462 void fish55()
463 {
464 glColor3f(0.0,0.0,1.0);//blue fish
465 glBegin(GL_POLYGON);
466 glVertex2f(0.7,-0.25);
467 glVertex2f(0.75,-0.3);
468 glVertex2f(0.775,-0.3);
469 glVertex2f(0.85,-0.25);
470 glVertex2f(0.775,-0.2);
471 glVertex2f(0.75,-0.2);
472 glEnd();
473
474 glBegin(GL_TRIANGLES);
475 glVertex2f(0.83,-0.25);
476 glVertex2f(0.9,-0.29);
477 glVertex2f(0.9,-0.21);
478 glEnd();
479
480 glBegin(GL_TRIANGLES);
481 glVertex2f(0.775,-0.2);
482 glVertex2f(0.79,-0.125);
483 glVertex2f(0.75,-0.2);
484 glEnd();
485
486 glBegin(GL_TRIANGLES);
487 glVertex2f(0.75,-0.3);
488 glVertex2f(0.795,-0.35);
489 glVertex2f(0.775,-0.3);
490 glEnd();
491
492 glColor3f(0.0,0.0,0.0);
493 glPointSize(4.0);
494 glBegin(GL_POINTS);
495 glVertex2f(0.73,-0.235);
496 glEnd();
497
498 }
499 void fish6()
500 {
501 glColor3f(1.0,0.0,0.0);//red1 fish
502 glBegin(GL_POLYGON);
503 glVertex2f(0.7+f,0.25);
504 glVertex2f(0.75+f,0.3);
505 glVertex2f(0.775+f,0.3);
506 glVertex2f(0.85+f,0.25);
507 glVertex2f(0.775+f,0.2);
508 glVertex2f(0.75+f,0.2);
509 glEnd();
510
511 glBegin(GL_TRIANGLES);
512 glVertex2f(0.83+f,0.25);
513 glVertex2f(0.9+f,0.29);
514 glVertex2f(0.9+f,0.21);
515 glEnd();
516
517 glBegin(GL_TRIANGLES);
518 glVertex2f(0.775+f,0.3);
519 glVertex2f(0.79+f,0.4);
520 glVertex2f(0.75+f,0.3);
521 glEnd();
522
523 glBegin(GL_TRIANGLES);
524 glVertex2f(0.775+f,0.2);
525 glVertex2f(0.79+f,0.1);
526 glVertex2f(0.75+f,0.2);
527 glEnd();
528
529 glColor3f(0.0,0.0,0.0);
530 glPointSize(4.0);
531 glBegin(GL_POINTS);
532 glVertex2f(0.73+f,0.265);
533 glEnd();
534
535 }
536
537 void fish555()
538 {if(q==0.75){
539 glColor3f(0.0,0.0,1.0);//blue fish
540 glBegin(GL_POLYGON);
541 glVertex2f(0.2,0.55);
542 glVertex2f(0.25,0.6);
543 glVertex2f(0.275,0.6);
544 glVertex2f(0.35,0.55);
545 glVertex2f(0.275,0.5);
546 glVertex2f(0.25,0.5);
547 glEnd();
548
549 glBegin(GL_TRIANGLES);
550 glVertex2f(0.23,0.55);
551 glVertex2f(0.35,0.59);
552 glVertex2f(0.35,0.51);
553 glEnd();
554
555 glBegin(GL_TRIANGLES);
556 glVertex2f(0.275,0.6);
557 glVertex2f(0.29,0.7);
558 glVertex2f(0.25,0.6);
559 glEnd();
560
561 glBegin(GL_TRIANGLES);
562 glVertex2f(0.275,0.5);
563 glVertex2f(0.29,0.4);
564 glVertex2f(0.25,0.5);
565 glEnd();
566
567 glColor3f(0.0,0.0,0.0);
568 glPointSize(4.0);
569 glBegin(GL_POINTS);
570 glVertex2f(0.23,0.565);
571 glEnd();
572 }
573 }
574
575 void plant()
576 {
577 glColor3f(0.0,1.0,0.0);
578 glLineWidth(4.0);
579 glBegin(GL_LINES);
580 glVertex2f(0.9,-0.8);
581 glVertex2f(0.8,-0.9);
582 glVertex2f(0.8,-0.8);
583 glVertex2f(0.8,-0.9);
584 glVertex2f(0.7,-0.8);
585 glVertex2f(0.8,-0.9);
586 glVertex2f(0.75,-0.8);
587 glVertex2f(0.8,-0.9);
588 glVertex2f(0.85,-0.8);
589 glVertex2f(0.8,-0.9);
590 glVertex2f(0.725,-0.8);
591 glVertex2f(0.8,-0.9);
592 glVertex2f(0.775,-0.8);
593 glVertex2f(0.8,-0.9);
594 glVertex2f(0.825,-0.8);
595 glVertex2f(0.8,-0.9);
596 glVertex2f(0.875,-0.8);
597 glVertex2f(0.8,-0.9);
598 glEnd();
599
600
601 glLineWidth(4.0);
602 glBegin(GL_LINES);
603 glVertex2f(0.5,-0.95);
604 glVertex2f(0.6,-0.85);
605 glVertex2f(0.5,-0.85);
606 glVertex2f(0.5,-0.95);
607 glVertex2f(0.4,-0.85);
608 glVertex2f(0.5,-0.95);
609 glVertex2f(0.45,-0.85);
610 glVertex2f(0.5,-0.95);
611 glVertex2f(0.55,-0.85);
612 glVertex2f(0.5,-0.95);
613 glVertex2f(0.425,-0.85);
614 glVertex2f(0.5,-0.95);
615 glVertex2f(0.475,-0.85);
616 glVertex2f(0.5,-0.95);
617 glVertex2f(0.525,-0.85);
618 glVertex2f(0.5,-0.95);
619 glVertex2f(0.575,-0.85);
620 glVertex2f(0.5,-0.95);
621 glEnd();
622
623
624
625 glLineWidth(4.0);
626 glBegin(GL_LINES);
627 glVertex2f(0.175,-0.9);
628 glVertex2f(0.275,-0.8);
629 glVertex2f(0.175,-0.8);
630 glVertex2f(0.175,-0.9);
631 glVertex2f(0.075,-0.8);
632 glVertex2f(0.175,-0.9);
633 glVertex2f(0.125,-0.8);
634 glVertex2f(0.175,-0.9);
635 glVertex2f(0.225,-0.8);
636 glVertex2f(0.175,-0.9);
637 glVertex2f(0.1,-0.8);
638 glVertex2f(0.175,-0.9);
639 glVertex2f(0.15,-0.8);
640 glVertex2f(0.175,-0.9);
641 glVertex2f(0.2,-0.8);
642 glVertex2f(0.175,-0.9);
643 glVertex2f(0.25,-0.8);
644 glVertex2f(0.175,-0.9);
645 glEnd();
646
647
648
649 glLineWidth(4.0);
650 glBegin(GL_LINES);
651 glVertex2f(-0.175,-0.95);
652 glVertex2f(-0.275,-0.85);
653 glVertex2f(-0.175,-0.85);
654 glVertex2f(-0.175,-0.95);
655 glVertex2f(-0.075,-0.85);
656 glVertex2f(-0.175,-0.95);
657 glVertex2f(-0.125,-0.85);
658 glVertex2f(-0.175,-0.95);
659 glVertex2f(-0.225,-0.85);
660 glVertex2f(-0.175,-0.95);
661 glVertex2f(-0.1,-0.85);
662 glVertex2f(-0.175,-0.95);
663 glVertex2f(-0.15,-0.85);
664 glVertex2f(-0.175,-0.95);
665 glVertex2f(-0.2,-0.85);
666 glVertex2f(-0.175,-0.95);
667 glVertex2f(-0.25,-0.85);
668 glVertex2f(-0.175,-0.95);
669 glEnd();
670
671 glLineWidth(4.0);
672 glBegin(GL_LINES);
673 glVertex2f(-0.475,-0.9);
674 glVertex2f(-0.575,-0.8);
675 glVertex2f(-0.475,-0.9);
676 glVertex2f(-0.475,-0.8);
677 glVertex2f(-0.375,-0.8);
678 glVertex2f(-0.475,-0.9);
679 glVertex2f(-0.425,-0.8);
680 glVertex2f(-0.475,-0.9);
681 glVertex2f(-0.525,-0.8);
682 glVertex2f(-0.475,-0.9);
683 glVertex2f(-0.4,-0.8);
684 glVertex2f(-0.475,-0.9);
685 glVertex2f(-0.45,-0.8);
686 glVertex2f(-0.475,-0.9);
687 glVertex2f(-0.5,-0.8);
688 glVertex2f(-0.475,-0.9);
689 glVertex2f(-0.55,-0.8);
690 glVertex2f(-0.475,-0.9);
691 glEnd();
692
693
694
695 glLineWidth(4.0);
696 glBegin(GL_LINES);
697 glVertex2f(-0.9,-0.85);
698 glVertex2f(-0.8,-0.95);
699 glVertex2f(-0.8,-0.85);
700 glVertex2f(-0.8,-0.95);
701 glVertex2f(-0.7,-0.85);
702 glVertex2f(-0.8,-0.95);
703 glVertex2f(-0.75,-0.85);
704 glVertex2f(-0.8,-0.95);
705 glVertex2f(-0.85,-0.85);
706 glVertex2f(-0.8,-0.95);
707 glVertex2f(-0.725,-0.85);
708 glVertex2f(-0.8,-0.95);
709 glVertex2f(-0.775,-0.85);
710 glVertex2f(-0.8,-0.95);
711 glVertex2f(-0.825,-0.85);
712 glVertex2f(-0.8,-0.95);
713 glVertex2f(-0.875,-0.85);
714 glVertex2f(-0.8,-0.95);
715 glEnd();
716
717 }
718
719
720 void pebbles()
721 {
722 glColor3f(0.5,0.35,0.05);
723 glBegin(GL_POLYGON);
724 glVertex2f(0.9,-0.9);
725 glVertex2f(0.9125,-0.9);
726 glVertex2f(0.925,-0.8875);
727 glVertex2f(0.925,-0.875);
728 glVertex2f(0.9125,-0.8625);
729 glVertex2f(0.9,-0.8625);
730 glVertex2f(0.8875,-0.8875);
731 glVertex2f(0.8875,-0.875);
732 glEnd();
733
734 glBegin(GL_POLYGON);
735 glVertex2f(0,-0.95);
736 glVertex2f(0.0125,-0.95);
737 glVertex2f(0.025,-0.9375);
738 glVertex2f(0.025,-0.925);
739 glVertex2f(0.0125,-0.9125);
740 glVertex2f(0,-0.9125);
741 glVertex2f(-0.0125,-0.9375);
742 glVertex2f(-0.0125,-0.925);
743 glEnd();
744
745
746 glBegin(GL_POLYGON);
747 glVertex2f(0.0125,-0.975);
748 glVertex2f(0.025,-0.975);
749 glVertex2f(0.0375,-0.9625);
750 glVertex2f(0.0375,-0.95);
751 glVertex2f(0.025,-0.9375);
752 glVertex2f(0.0125,-0.9375);
753 glVertex2f(0,-0.9625);
754 glVertex2f(0,-0.95);
755 glEnd();
756
757 glBegin(GL_POLYGON);
758 glVertex2f(0.025,-0.95);
759 glVertex2f(0.0375,-0.95);
760 glVertex2f(0.05,-0.9375);
761 glVertex2f(0.05,-0.925);
762 glVertex2f(0.0375,-0.9125);
763 glVertex2f(0.025,-0.9125);
764 glVertex2f(0.0125,-0.9375);
765 glVertex2f(0.0125,-0.925);
766 glEnd();
767
768
769 glBegin(GL_POLYGON);
770 glVertex2f(0.65,-0.95);
771 glVertex2f(0.6625,-0.95);
772 glVertex2f(0.675,-0.9375);
773 glVertex2f(0.675,-0.925);
774 glVertex2f(0.6625,-0.9125);
775 glVertex2f(0.65,-0.9125);
776 glVertex2f(0.6375,-0.9375);
777 glVertex2f(0.6375,-0.925);
778 glEnd();
779
780
781 glBegin(GL_POLYGON);
782 glVertex2f(0.675,-0.95);
783 glVertex2f(0.6875,-0.95);
784 glVertex2f(0.7,-0.9375);
785 glVertex2f(0.7,-0.925);
786 glVertex2f(0.6875,-0.9125);
787 glVertex2f(0.675,-0.9125);
788 glVertex2f(0.6625,-0.9375);
789 glVertex2f(0.6625,-0.925);
790 glEnd();
791
792
793 glBegin(GL_POLYGON);
794 glVertex2f(0.6625,-0.985);
795 glVertex2f(0.675,-0.985);
796 glVertex2f(0.6875,-0.9725);
797 glVertex2f(0.6875,-0.96);
798 glVertex2f(0.675,-0.9475);
799 glVertex2f(0.6625,-0.9475);
800 glVertex2f(0.65,-0.9525);
801 glVertex2f(0.65,-0.96);
802 glEnd();
803
804
805
806 glBegin(GL_POLYGON);
807 glVertex2f(0.6875,-0.985);
808 glVertex2f(0.7,-0.985);
809 glVertex2f(0.7125,-0.9725);
810 glVertex2f(0.7125,-0.96);
811 glVertex2f(0.7,-0.9475);
812 glVertex2f(0.6875,-0.9475);
813 glVertex2f(0.675,-0.9475);
814 glVertex2f(0.675,-0.96);
815 glEnd();
816
817
818 glBegin(GL_POLYGON);
819 glVertex2f(0.6375,-0.985);
820 glVertex2f(0.65,-0.985);
821 glVertex2f(0.6625,-0.9725);
822 glVertex2f(0.6625,-0.96);
823 glVertex2f(0.65,-0.9475);
824 glVertex2f(0.6375,-0.9475);
825 glVertex2f(0.625,-0.9475);
826 glVertex2f(0.625,-0.96);
827 glEnd();
828
829
830
831 glBegin(GL_POLYGON);
832 glVertex2f(0.25,-0.95);
833 glVertex2f(0.2625,-0.95);
834 glVertex2f(0.275,-0.9375);
835 glVertex2f(0.275,-0.925);
836 glVertex2f(0.2625,-0.9125);
837 glVertex2f(0.25,-0.9125);
838 glVertex2f(0.2375,-0.9375);
839 glVertex2f(0.2375,-0.925);
840 glEnd();
841
842
843 glBegin(GL_POLYGON);
844 glVertex2f(0.275,-0.95);
845 glVertex2f(0.2875,-0.95);
846 glVertex2f(0.3,-0.9375);
847 glVertex2f(0.3,-0.925);
848 glVertex2f(0.2875,-0.9125);
849 glVertex2f(0.275,-0.9125);
850 glVertex2f(0.2625,-0.9375);
851 glVertex2f(0.2625,-0.925);
852 glEnd();
853
854
855 glBegin(GL_POLYGON);
856 glVertex2f(0.2625,-0.985);
857 glVertex2f(0.275,-0.985);
858 glVertex2f(0.2875,-0.9725);
859 glVertex2f(0.2875,-0.96);
860 glVertex2f(0.275,-0.9475);
861 glVertex2f(0.2625,-0.9475);
862 glVertex2f(0.25,-0.9525);
863 glVertex2f(0.25,-0.96);
864 glEnd();
865
866 glBegin(GL_POLYGON);
867 glVertex2f(0.2875,-0.985);
868 glVertex2f(0.3,-0.985);
869 glVertex2f(0.3125,-0.9725);
870 glVertex2f(0.3125,-0.96);
871 glVertex2f(0.3,-0.9475);
872 glVertex2f(0.2825,-0.9475);
873 glVertex2f(0.275,-0.9525);
874 glVertex2f(0.275,-0.96);
875 glEnd();
876
877
878
879 glBegin(GL_POLYGON);
880 glVertex2f(-0.35,-0.95);
881 glVertex2f(-0.3625,-0.95);
882 glVertex2f(-0.375,-0.9375);
883 glVertex2f(-0.375,-0.925);
884 glVertex2f(-0.3625,-0.9125);
885 glVertex2f(-0.35,-0.9125);
886 glVertex2f(-0.3375,-0.9375);
887 glVertex2f(-0.3375,-0.925);
888 glEnd();
889
890
891 glBegin(GL_POLYGON);
892 glVertex2f(-0.375,-0.95);
893 glVertex2f(-0.3875,-0.95);
894 glVertex2f(-0.4,-0.9375);
895 glVertex2f(-0.4,-0.925);
896 glVertex2f(-0.3875,-0.9125);
897 glVertex2f(-0.375,-0.9125);
898 glVertex2f(-0.3625,-0.9375);
899 glVertex2f(-0.3625,-0.925);
900 glEnd();
901
902
903 glBegin(GL_POLYGON);
904 glVertex2f(-0.3625,-0.985);
905 glVertex2f(-0.375,-0.985);
906 glVertex2f(-0.3875,-0.9725);
907 glVertex2f(-0.3875,-0.96);
908 glVertex2f(-0.375,-0.9475);
909 glVertex2f(-0.3625,-0.9475);
910 glVertex2f(-0.35,-0.9525);
911 glVertex2f(-0.35,-0.96);
912 glEnd();
913
914 glBegin(GL_POLYGON);
915 glVertex2f(-0.3875,-0.985);
916 glVertex2f(-0.4,-0.985);
917 glVertex2f(-0.4125,-0.9725);
918 glVertex2f(-0.4125,-0.96);
919 glVertex2f(-0.4,-0.9475);
920 glVertex2f(-0.3825,-0.9475);
921 glVertex2f(-0.375,-0.9525);
922 glVertex2f(-0.375,-0.96);
923 glEnd();
924
925 glBegin(GL_POLYGON);
926 glVertex2f(-0.3375,-0.985);
927 glVertex2f(-0.35,-0.985);
928 glVertex2f(-0.3625,-0.9725);
929 glVertex2f(-0.3625,-0.96);
930 glVertex2f(-0.35,-0.9475);
931 glVertex2f(-0.3375,-0.9475);
932 glVertex2f(-0.325,-0.9525);
933 glVertex2f(-0.325,-0.96);
934 glEnd();
935
936 glBegin(GL_POLYGON);
937 glVertex2f(-0.65,-0.95);
938 glVertex2f(-0.6625,-0.95);
939 glVertex2f(-0.675,-0.9375);
940 glVertex2f(-0.675,-0.925);
941 glVertex2f(-0.6625,-0.9125);
942 glVertex2f(-0.65,-0.9125);
943 glVertex2f(-0.6375,-0.9375);
944 glVertex2f(-0.6375,-0.925);
945 glEnd();
946
947
948 glBegin(GL_POLYGON);
949 glVertex2f(-0.675,-0.95);
950 glVertex2f(-0.6875,-0.95);
951 glVertex2f(-0.7,-0.9375);
952 glVertex2f(-0.7,-0.925);
953 glVertex2f(-0.6875,-0.9125);
954 glVertex2f(-0.675,-0.9125);
955 glVertex2f(-0.6625,-0.9375);
956 glVertex2f(-0.6625,-0.925);
957 glEnd();
958
959
960 glBegin(GL_POLYGON);
961 glVertex2f(-0.6625,-0.985);
962 glVertex2f(-0.675,-0.985);
963 glVertex2f(-0.6875,-0.9725);
964 glVertex2f(-0.6875,-0.96);
965 glVertex2f(-0.675,-0.9475);
966 glVertex2f(-0.6625,-0.9475);
967 glVertex2f(-0.65,-0.9525);
968 glVertex2f(-0.65,-0.96);
969 glEnd();
970
971 glBegin(GL_POLYGON);
972 glVertex2f(-0.9,-0.9);
973 glVertex2f(-0.9125,-0.9);
974 glVertex2f(-0.925,-0.8875);
975 glVertex2f(-0.925,-0.875);
976 glVertex2f(-0.9125,-0.8625);
977 glVertex2f(-0.9,-0.8625);
978 glVertex2f(-0.8875,-0.8875);
979 glVertex2f(-0.8875,-0.875);
980 glEnd();
981
982
983 glBegin(GL_POLYGON);
984 glVertex2f(0.9,-0.95);
985 glVertex2f(0.9125,-0.95);
986 glVertex2f(0.925,-0.9375);
987 glVertex2f(0.925,-0.925);
988 glVertex2f(0.9125,-0.9125);
989 glVertex2f(0.9,-0.9125);
990 glVertex2f(0.8875,-0.9375);
991 glVertex2f(0.8875,-0.925);
992 glEnd();
993
994
995 glBegin(GL_POLYGON);
996 glVertex2f(0.925,-0.95);
997 glVertex2f(0.9375,-0.95);
998 glVertex2f(0.95,-0.9375);
999 glVertex2f(0.95,-0.925);
1000 glVertex2f(0.9375,-0.9125);
1001 glVertex2f(0.925,-0.9125);
1002 glVertex2f(0.9125,-0.9375);
1003 glVertex2f(0.9125,-0.925);
1004 glEnd();
1005
1006
1007 glBegin(GL_POLYGON);
1008 glVertex2f(-0.9,-0.95);
1009 glVertex2f(-0.9125,-0.95);
1010 glVertex2f(-0.925,-0.9375);
1011 glVertex2f(-0.925,-0.925);
1012 glVertex2f(-0.9125,-0.9125);
1013 glVertex2f(-0.9,-0.9125);
1014 glVertex2f(-0.8875,-0.9375);
1015 glVertex2f(-0.8875,-0.925);
1016 glEnd();
1017
1018
1019 glBegin(GL_POLYGON);
1020 glVertex2f(-0.925,-0.95);
1021 glVertex2f(-0.9375,-0.95);
1022 glVertex2f(-0.95,-0.9375);
1023 glVertex2f(-0.95,-0.925);
1024 glVertex2f(-0.9375,-0.9125);
1025 glVertex2f(-0.925,-0.9125);
1026 glVertex2f(-0.9125,-0.9375);
1027 glVertex2f(-0.9125,-0.925);
1028 glEnd();
1029 }
1030
1031
1032 void food()
1033 {
1034 glColor3f(0.5,0.9,0.3);
1035 glPointSize(8);
1036 glBegin(GL_POINTS);
1037 glVertex2f(-0.65,0.5);
1038 glEnd();
1039
1040 }
1041
1042
1043 void food_mul()
1044 {
1045 glColor3f(1.0,0.0,1.0);
1046 glPointSize(8);
1047 glBegin(GL_POINTS);
1048 glVertex2f(0.235,0.4);
1049 glEnd();
1050 }
1051
1052
1053 void poisonfood()
1054 {
1055 glColor3f(1.0,0.0,0.0);
1056 glPointSize(8);
1057 glBegin(GL_POINTS);
1058 glVertex2f(0.48,0.66);
1059 glEnd();
1060 }
1061
1062
1063 /*void sand()
1064 {
1065 glColor3f(1.0,1.0,0.7);
1066 glBegin(GL_POLYGON);
1067 glVertex2f(-1.0,-1.0);
1068 glVertex2f(-1.0,-0.849);
1069 glVertex2f(1.0,-0.849);
1070 glVertex2f(1.0,-1.0);
1071 glEnd();
1072 glFlush();
1073 }*/
1074
1075 void draw_pixel(GLint cx,GLint cy)
1076 {
1077 glColor3f(1.0,0.0,0.0);
1078 glBegin(GL_POINTS);
1079 glVertex2i(cx,cy);
1080 glEnd();
1081 }
1082
1083 void plotpixels(GLint h,GLint k,GLint x,GLint y)
1084 {
1085 draw_pixel(x+h,y+k);
1086 draw_pixel(-x+h,y+k);
1087 draw_pixel(x+h,-y+k);
1088 draw_pixel(-x+h,-y+k);
1089 draw_pixel(y+h,x+k);
1090 draw_pixel(-y+h,x+k);
1091 draw_pixel(y+h,-x+k);
1092 draw_pixel(-y+h,-x+k);
1093
1094 }
1095
1096 void circle_draw(GLint h,GLint k,GLint r)
1097 {
1098 GLint d=1-r,x=0,y=r;
1099 while(y>x)
1100 {
1101 plotpixels(h,k,x,y);
1102 if(d<0)
1103 d+=2*x+3;
1104 else
1105 {
1106 d+=2*(x-y)+5;
1107 --y;
1108 }
1109 ++x;
1110 }
1111 plotpixels(h,k,x,y);
1112 }
1113
1114
1115 void myinit()
1116 {
1117 glClearColor(0.4,1.0,1.0,0.0);
1118 glColor3f(1.0,1.0,0.0);
1119 //gluOrtho2D(0.0,499.0,0.0,499.0);
1120 }
1121
1122
1123 void idle()
1124 {
1125
1126 g+=0.00024;
1127
1128
1129 h+=0.0002;
1130
1131
1132 i-=0.00024;
1133
1134
1135 j+=0.0002;
1136
1137
1138 k+=0.00009;
1139
1140
1141 l+=0.0002;
1142
1143
1144 m+=0.000055;
1145
1146
1147 n+=0.0002;
1148
1149
1150 p+=0.00007;
1151
1152
1153 q+=0.0001;
1154
1155
1156 x-=0.0001;
1157
1158 s-=0.001;
1159 y+=0.0002;
1160
1161
1162 glutPostRedisplay();
1163
1164 }
1165
1166
1167 void play1(){
1168 glPushMatrix();
1169 if(h<0.6){
1170 glTranslatef(g,h,0);}
1171 else
1172 {
1173 glTranslatef(g,1.2-h,0);
1174 }
1175 fish11();
1176 glPopMatrix();
1177
1178 }
1179
1180
1181 void play2(){
1182 glPushMatrix();
1183 if(j<0.6)
1184 {
1185 glTranslatef(i,j,0);
1186 }
1187 else
1188 {
1189 glTranslatef(i,1.2-j,0);
1190 }
1191 fish22();
1192 glPopMatrix();
1193 }
1194
1195
1196
1197
1198 void display(void)
1199 {
1200 glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
1201 glColor3f(1.0,0.0,0.0);
1202 glPointSize(2.0);
1203 circle_draw(0.2,-0.1,0.5);
1204
1205 // sand();
1206 plant();
1207 pebbles();
1208
1209
1210 if(a>=-1.99)
1211 a=a-0.0005;
1212 else
1213 a=0;
1214
1215
1216 if(b>=-1.99)
1217 b=b-0.0004;
1218 else
1219 b=0;
1220
1221 if(c>=-1.99)
1222 c=c-0.0003;
1223 else
1224 c=0;
1225
1226 if(d>=-1.99)
1227 d=d+0.0007;
1228 else
1229 d=0;
1230
1231 if(e>=-1.99)
1232 e=e-0.0005;
1233 else
1234 e=0;
1235
1236
1237 if(f>=-1.99)
1238 f=f-0.0002;
1239 else
1240 f=0;
1241
1242 fish1();
1243 fish2();
1244 //fish3();
1245 fish4();
1246 fish5();
1247 fish33();
1248 fish44();
1249 fish55();
1250 fish6();
1251
1252 glutPostRedisplay();
1253 glFlush();
1254 glutSwapBuffers();
1255
1256 }
1257
1258 void create_menu(void)
1259 {
1260 glutCreateMenu(menu);
1261 glutAttachMenu(GLUT_LEFT_BUTTON);
1262 glutAttachMenu(GLUT_RIGHT_BUTTON);
1263 glutAddMenuEntry("Food", 1);
1264 glutAddMenuEntry("Play", 2);
1265 glutAddMenuEntry("Assemble", 3);
1266 glutAddMenuEntry("Poison Food", 4);
1267 glutAddMenuEntry("Exit", 5);
1268
1269 }
1270 void menu(int val)
1271 {
1272
1273
1274 switch (val) {
1275 case 1:
1276 glutDisplayFunc(disp1);;
1277 break;
1278 case 2:
1279 glutDisplayFunc(disp2);
1280 break;
1281 case 3:
1282 glutDisplayFunc(disp3);
1283 break;
1284 case 4:
1285 glutDisplayFunc(disp4);;
1286 break;
1287 case 5: exit(0);
1288
1289
1290
1291
1292 }
1293
1294 }
1295
1296
1297 void disp1(void)
1298 {
1299 glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
1300 glColor3f(1.0,0.0,0.0);
1301
1302
1303
1304 glPushMatrix();
1305 if(l<0.35)
1306 {
1307 food();
1308 glTranslatef(k,l,0);
1309 }
1310 else
1311 {
1312 glTranslatef(k,0.35,0);
1313 glColor3f(0.0,0.0,1.0);
1314 glPointSize(8);
1315 glBegin(GL_POINTS);
1316 glVertex2f(-0.5,0.5);
1317 }
1318 fish33();
1319 glPopMatrix();
1320
1321
1322 glPushMatrix();
1323 if(n<=0.8)
1324 {
1325 poisonfood();
1326 glTranslatef(-m,n,0);}
1327 else
1328 {
1329 glTranslatef(-m,0.8,0);
1330 glColor3f(0.0,0.0,1.0);
1331 glPointSize(8);
1332 glBegin(GL_POINTS);
1333 glVertex2f(0.55,0.5);
1334 }
1335
1336 fish44();
1337 glPopMatrix();
1338
1339 glPushMatrix();
1340 if(q<0.65)
1341 {
1342 food_mul();
1343 glTranslatef(-p,q,0);
1344 }
1345 else
1346 {
1347 glTranslatef(-p,0.65,0);
1348 glColor3f(0.0,0.0,1.0);
1349 glPointSize(8);
1350 glBegin(GL_POINTS);
1351 glVertex2f(0.25,0.5);
1352 }
1353 fish55();
1354 glPopMatrix();
1355
1356 if(a>=-1.99)
1357 a=a-0.0005;
1358 else
1359 a=0;
1360
1361
1362 if(b>=-1.99)
1363 b=b-0.0004;
1364 else
1365 b=0;
1366
1367 if(c>=-1.99)
1368 c=c-0.0003;
1369 else
1370 c=0;
1371
1372 if(d>=-1.99)
1373 d=d+0.0007;
1374 else
1375 d=0;
1376
1377 if(e>=-1.99)
1378 e=e-0.0005;
1379 else
1380 e=0;
1381
1382
1383 if(f>=-1.99)
1384 f=f-0.0002;
1385 else
1386 f=0;
1387
1388 fish1();
1389 fish2();
1390 //fish3();
1391 fish4();
1392 fish5();
1393
1394 fish6();
1395
1396 plant();
1397 pebbles();
1398
1399 glutPostRedisplay();
1400 glFlush();
1401
1402
1403 }
1404
1405
1406
1407
1408 void disp2(void)
1409 {
1410
1411
1412 glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
1413 glColor3f(1.0,0.0,0.0);
1414
1415 plant();
1416 pebbles();
1417
1418 if(a>=-1.99)
1419 a=a-0.0005;
1420 else
1421 a=0;
1422
1423
1424 if(b>=-1.99)
1425 b=b-0.0004;
1426 else
1427 b=0;
1428
1429 if(c>=-1.99)
1430 c=c-0.0003;
1431 else
1432 c=0;
1433
1434 if(d>=-1.99)
1435 d=d+0.0007;
1436 else
1437 d=0;
1438
1439 if(e>=-1.99)
1440 e=e-0.0005;
1441 else
1442 e=0;
1443
1444
1445 if(f>=-1.99)
1446 f=f-0.0002;
1447 else
1448 f=0;
1449
1450 fish1();
1451 fish2();
1452
1453 fish4();
1454 fish5();
1455
1456 fish6();
1457 play1();
1458 play2();
1459 glutPostRedisplay();
1460 glFlush();
1461
1462 }
1463
1464 void disp3(void)
1465 {
1466
1467 glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
1468 glColor3f(1.0,0.0,0.0);
1469
1470 plant();
1471 pebbles();
1472
1473
1474 if(a>=-1.99)
1475 a=a-0.0005;
1476 else
1477 a=0;
1478
1479
1480 if(b>=-1.99)
1481 b=b-0.0004;
1482 else
1483 b=0;
1484
1485 if(c>=-1.99)
1486 c=c-0.0003;
1487 else
1488 c=0;
1489
1490 if(d>=-1.99)
1491 d=d+0.0007;
1492 else
1493 d=0;
1494
1495 if(e>=-1.99)
1496 e=e-0.0005;
1497 else
1498 e=0;
1499
1500
1501 if(f>=-1.99)
1502 f=f-0.0002;
1503 else
1504 f=0;
1505
1506
1507 fish1();
1508 fish2();
1509
1510 fish4();
1511 fish5();
1512
1513 fish6();
1514
1515 glutPostRedisplay();
1516 glFlush();
1517 }
1518
1519 void disp4(void)
1520 {
1521 glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
1522 glColor3f(1.0,0.0,0.0);
1523
1524
1525
1526 glPushMatrix();
1527 if(x>-0.8)
1528 {
1529 glColor3f(1.0,0.0,0.0);
1530 glPointSize(10.0);
1531 glBegin(GL_POINTS);
1532 glVertex2f(0.0,0.30);
1533 glEnd();
1534 glTranslatef(x,0.35,0);
1535 }
1536 else
1537 {
1538 glTranslatef(x,1.95-y,0.0);
1539 glColor3f(1.0,1.0,0.0);
1540 glPointSize(8);
1541 glBegin(GL_POINTS);
1542 glVertex2f(0.0,0.30);
1543 //glEnd();
1544 }
1545 fish21();
1546
1547 glPopMatrix();
1548
1549
1550 plant();
1551 pebbles();
1552
1553
1554 if(a>=-1.99)
1555 a=a-0.0005;
1556 else
1557 a=0;
1558
1559
1560 if(b>=-1.99)
1561 b=b-0.0004;
1562 else
1563 b=0;
1564
1565 if(c>=-1.99)
1566 c=c-0.0003;
1567 else
1568 c=0;
1569
1570 if(d>=-1.99)
1571 d=d+0.0007;
1572 else
1573 d=0;
1574
1575 if(e>=-1.99)
1576 e=e-0.0005;
1577 else
1578 e=0;
1579
1580
1581 if(f>=-1.99)
1582 f=f-0.0002;
1583 else
1584 f=0;
1585
1586
1587 fish1();
1588 fish2();
1589 fish4();
1590 fish5();
1591 fish6();
1592
1593 glutPostRedisplay();
1594 glFlush();
1595 }
1596
1597 void main(int argc,char **argv)
1598 {
1599 glutInit(&argc,argv);
1600 glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB);
1601 glutInitWindowPosition(0,0);
1602 glutInitWindowSize(500,500);
1603 glutCreateWindow("fish");
1604 myinit();
1605 create_menu();
1606 glutIdleFunc(idle);
1607 glutDisplayFunc(display);
1608 glutMainLoop();
1609 }

You might also like