fork download
  1. gray@elemental:~$ aptitude search opengl
  2. p gambas2-gb-opengl - The OpenGL component for Gambas
  3. p gambas2-gb-opengl:i386 - The OpenGL component for Gambas
  4. p gambas2-gb-qt-opengl - OpenGL with QT toolkit Gambas component
  5. p gambas2-gb-qt-opengl:i386 - OpenGL with QT toolkit Gambas component
  6. p gnash-common-opengl - dummy package for gnash-common-opengl remo
  7. p gnash-opengl - dummy package for gnash-opengl removal
  8. p klash-opengl - dummy package for klash-opengl removal
  9. p libghc-opengl-dev - Haskell OpenGL binding for GHC
  10. p libghc-opengl-dev:i386 - Haskell OpenGL binding for GHC
  11. v libghc-opengl-dev-2.2.3.1-2a936 -
  12. v libghc-opengl-dev-2.2.3.1-d355c -
  13. p libghc-opengl-doc - Haskell OpenGL binding for GHC; documentat
  14. p libghc-opengl-prof - Haskell OpenGL binding for GHC; profiling
  15. p libghc-opengl-prof:i386 - Haskell OpenGL binding for GHC; profiling
  16. v libghc-opengl-prof-2.2.3.1-2a93 -
  17. v libghc-opengl-prof-2.2.3.1-d355 -
  18. p libghc6-opengl-dev - transitional dummy package
  19. p libghc6-opengl-doc - transitional dummy package
  20. p libghc6-opengl-prof - transitional dummy package
  21. p libguichan-opengl-0.8.1-1 - small, efficient C++ GUI library (OpenGL i
  22. p libguichan-opengl-0.8.1-1:i386 - small, efficient C++ GUI library (OpenGL i
  23. v libhugs-opengl -
  24. v libhugs-opengl:i386 -
  25. p libhugs-opengl-bundled - A binding for the OpenGL graphics system
  26. p libhugs-opengl-bundled:i386 - A binding for the OpenGL graphics system
  27. p libmrpt-opengl0.9 - Mobile Robot Programming Toolkit - opengl
  28. p libmrpt-opengl0.9:i386 - Mobile Robot Programming Toolkit - opengl
  29. p libopengl-perl - Perl interface providing graphics display
  30. p libopengl-perl:i386 - Perl interface providing graphics display
  31. p libopengl-ruby - OpenGL binding for Ruby
  32. p libopengl-ruby1.8 - OpenGL binding for Ruby 1.8
  33. p libopengl-ruby1.8:i386 - OpenGL binding for Ruby 1.8
  34. p libopengl-ruby1.9.1 - OpenGL binding for Ruby 1.9.1
  35. p libopengl-ruby1.9.1:i386 - OpenGL binding for Ruby 1.9.1
  36. p libopengl-xscreensaver-perl - Perl module for writing OpenGL-based XScre
  37. p libopengl-xscreensaver-perl:i38 - Perl module for writing OpenGL-based XScre
  38. p libqt4-opengl - Qt 4 OpenGL module
  39. p libqt4-opengl:i386 - Qt 4 OpenGL module
  40. p libqt4-opengl-dev - Qt 4 OpenGL library development files
  41. p libqt4-opengl-dev:i386 - Qt 4 OpenGL library development files
  42. p libqtopengl4-perl - perl bindings for the Qt OpenGL library
  43. p libqtopengl4-perl:i386 - perl bindings for the Qt OpenGL library
  44. p libqtscript4-opengl - Qt Script bindings for the Qt 4 OpenGL lib
  45. p libqtscript4-opengl:i386 - Qt Script bindings for the Qt 4 OpenGL lib
  46. p libsmokeqtopengl4-3 - Qt OpenGL SMOKE library
  47. p libsmokeqtopengl4-3:i386 - Qt OpenGL SMOKE library
  48. p libtaoframework-opengl-cil-dev - Tao CLI binding for OpenGL and GLU - devel
  49. p libtaoframework-opengl3.0-cil - Tao CLI binding for OpenGL and GLU
  50. p libtiff-opengl - TIFF manipulation and conversion tools
  51. p libtiff-opengl:i386 - TIFF manipulation and conversion tools
  52. p mgltools-opengltk - Opengltk Python extension
  53. p mgltools-opengltk:i386 - Opengltk Python extension
  54. p python-opengl - Python bindings to OpenGL
  55. p python-pyside.qtopengl - Qt 4 OpenGL module - Python bindings
  56. p python-pyside.qtopengl:i386 - Qt 4 OpenGL module - Python bindings
  57. v python2.7-pyside.qtopengl -
  58. v python2.7-pyside.qtopengl:i386 -
  59. p python3-pyside.qtopengl - Qt 4 OpenGL module - Python3 bindings
  60. p python3-pyside.qtopengl:i386 - Qt 4 OpenGL module - Python3 bindings
  61.  
  62.  
  63. /*
  64.  * arch.c
  65.  *
  66.  * Created on: Feb 21, 2014
  67.  * Author: kamath
  68.  */
  69. #include<stdio.h>
  70. #include<GL/glut.h>
  71. #include<string.h>
  72. int maxy=600, count=0, maxx=500, n=3, m=3,r,q;
  73. int count1=0,count2=0,count3=0,count4=0,count5=0,count6=0,count7=0,count8=0,count9=0,count10=0;
  74. int x=25,y=50;
  75. char str[10];
  76. void id1();
  77. void id();
  78. void draw_target();
  79. void redraw();
  80.  
  81. /*to display bitmap char*/
  82. void bitmap_output(int x,int y,char *string,void *font)
  83. {
  84. int len,i;
  85. glRasterPos2f(x,y);
  86. len=(int)strlen(string);
  87. for(i=0;i<len;i++)
  88. {
  89. glutBitmapCharacter(font,string[i]);
  90. }
  91. return;
  92. }
  93.  
  94. /*based on count display no of arrows and result of game*/
  95. void counting()
  96. {
  97. sprintf(str,"No of arrows:%d",count);
  98. bitmap_output(400,40,str,GLUT_BITMAP_HELVETICA_18);
  99. if(count1==1 && count2==1 && count3==1 && count4==1 && count5==1 && count6==1 && count7==1 && count8==1 && count9==1 && count10==1)
  100. {
  101. bitmap_output(5,300,"CONGRATULATIONS YOU WON",GLUT_BITMAP_TIMES_ROMAN_24);
  102. glutIdleFunc(NULL);
  103. }
  104. else if(count>=15)
  105. {
  106. sprintf(str,"NO of arrows:%d,NO OF ARROWS OVER GAME LOST",count);
  107. bitmap_output(5,300,str,GLUT_BITMAP_TIMES_ROMAN_24);
  108. glutIdleFunc(NULL);
  109. }
  110. }
  111.  
  112. //TO CHECK WHETHER ARROW HITS TARGET
  113. void disa()
  114. {
  115. if((x+110==300) && (y>=435 && y<=465) && (!count1))
  116. {
  117. count1=1;
  118. x=25;
  119. y=0;
  120. count++;
  121. glutIdleFunc(id);
  122. }
  123. else if((x+110 == 375)&&(y>=385&&y<=415) && (!count2))
  124. {
  125. count2=1;
  126. x=25;
  127. y=0;
  128. count++;
  129. glutIdleFunc(id);
  130. }
  131. else if((x+110==399)&&(y>=465 &&y<=495)&&(!count3))
  132. {
  133. count3=1;
  134. x=25;
  135. y=0;
  136. count++;
  137. glutIdleFunc(id);
  138. }
  139. else if((x+110==249)&&(y>=355&&y<=385)&&(!count4))
  140.  
  141. {
  142. count4=1;
  143. x=25;
  144. y=0;
  145. count++;
  146. glutIdleFunc(id);
  147. }
  148. else if((x+110==351)&&(y>=315&&y<=345)&&(!count5))
  149. {
  150. count5=1;
  151. x=25;
  152. y=0;
  153. count++;
  154. glutIdleFunc(id);
  155. }
  156. else if((x+110==450)&&(y>=275&&y<=305)&&(!count6))
  157. {
  158. count6=1;
  159. x=25;
  160. y=0;
  161. count++;
  162. glutIdleFunc(id);
  163. }
  164. else if((x+110==330)&&(y>=230&&y<=260)&&(!count7))
  165. {
  166. count7=1;
  167. x=25;
  168. y=0;
  169. count++;
  170. glutIdleFunc(id);
  171. }
  172. else if((x+110==201)&&(y>=185&&y<=215)&&(!count8))
  173. {
  174. count8=1;
  175. x=25;
  176. y=0;
  177. count++;
  178. glutIdleFunc(id);
  179. }
  180. else if((x+110==339)&&(y>=135&&y<=165)&&(!count9))
  181. {
  182. count9=1;
  183. x=25;
  184. y=0;
  185. count++;
  186. glutIdleFunc(id);
  187. }
  188. else if((x+110==300)&&(y>=85&&y<=115)&&(!count10))
  189. {
  190. count10=1;
  191. x=25;
  192. y=0;
  193. count++;
  194. glutIdleFunc(id);
  195. }
  196. }
  197.  
  198. /*to move arrow up*/
  199. void id()
  200. {
  201. y+=n;
  202. disa();
  203. if(y>maxy)
  204. {
  205. y=0;
  206. count++;
  207. }
  208. glutPostRedisplay();
  209. }
  210. //to draw arrow
  211. void disp()
  212. {
  213. glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
  214. glLoadIdentity();
  215. glColor3f(1,1,0);
  216. bitmap_output(150,450,"BLOCKSHOOTING",GLUT_BITMAP_TIMES_ROMAN_24);
  217. counting();
  218. //Drawing of arrow
  219. glColor3f(0,1,1);
  220. glBegin(GL_LINES);
  221. glVertex2d(x,y);
  222. glVertex2d(x+100,y);
  223. glEnd();
  224. glLineWidth(2);
  225. glBegin(GL_LINES);
  226. glVertex2d(x,y+2);
  227. glVertex2d(x+100,y-2);
  228. glEnd();
  229. glBegin(GL_LINES);
  230. glVertex2d(x,y-2);
  231. glVertex2d(x+100,y-2);
  232. glEnd();
  233. glBegin(GL_TRIANGLES);
  234. glVertex2d (x+100,y+3);
  235. glVertex2d(x+110,y);
  236. glVertex2d(x+100,y-3);
  237. glEnd();
  238. glBegin(GL_QUADS);
  239. glVertex2d(x,y+3);
  240. glVertex2d(x,y-3);
  241. glVertex2d(x-10,y-5);
  242. glVertex2d(x-10,y+5);
  243. glEnd();
  244. draw_target();
  245. glFlush();
  246. glutSwapBuffers();
  247. }
  248.  
  249. void init()
  250. {
  251. glClearColor(0,0,0,1);
  252. glColor3f(1,0,0);
  253. glMatrixMode(GL_PROJECTION);
  254. glLoadIdentity();
  255. gluOrtho2D(0,500,0,500);
  256. glMatrixMode(GL_MODELVIEW);
  257. }
  258.  
  259. //to draw the target inside the loop
  260.  
  261. void draw_target()
  262. {
  263. if(count1==0)
  264. {
  265. glColor3f(1,0,1);
  266. glPointSize(30);
  267. glBegin(GL_POINTS);
  268. glVertex2d(300,450);
  269. glEnd();
  270. glBegin(GL_LINE_LOOP);
  271. glVertex2d(285,465);
  272. glVertex2d(315,465);
  273. glVertex2d(315,435);
  274. glVertex2d(285,435);
  275. glEnd();
  276. }
  277. else
  278. {
  279. glColor3f(1,1,1);
  280. glPointSize(20);
  281. glBegin(GL_POINTS);
  282. glVertex2d(300,450);
  283. glEnd();
  284. }
  285. if(count2==0)
  286. {
  287. glColor3f(1,0,1);
  288. glPointSize(30);
  289. glBegin(GL_POINTS);
  290. glVertex2d(375,400);
  291. glEnd();
  292. glBegin(GL_LINE_LOOP);
  293. glVertex2d(360,415);
  294. glVertex2d(390,415);
  295. glVertex2d(390,385);
  296. glVertex2d(360,385);
  297. glEnd();
  298. }
  299. else
  300. {
  301. glColor3f(1,1,1);
  302. glPointSize(20);
  303. glBegin(GL_POINTS);
  304. glVertex2d(375,400);
  305. glEnd();
  306. }
  307. if(count3==0)
  308. {
  309. glColor3f(1,0,1);
  310. glPointSize(30);
  311. glBegin(GL_POINTS);
  312. glVertex2d(400,480);
  313. glEnd();
  314. glBegin(GL_LINE_LOOP);
  315. glVertex2d(385,495);
  316. glVertex2d(415,495);
  317. glVertex2d(415,465);
  318. glVertex2d(385,465);
  319. glEnd();
  320. }
  321. else
  322. {
  323. glColor3f(1,1,1);
  324. glPointSize(20);
  325. glBegin(GL_POINTS);
  326. glVertex2d(400,480);
  327. glEnd();
  328. }
  329. if(count4==0)
  330. {
  331. glColor3f(1,0,1);
  332. glPointSize(30);
  333. glBegin(GL_POINTS);
  334. glVertex2d(250,370);
  335. glEnd();
  336. glBegin(GL_LINE_LOOP);
  337. glVertex2d(235,385);
  338. glVertex2d(265,385);
  339. glVertex2d(265,355);
  340. glVertex2d(235,355);
  341. glEnd();
  342. }
  343. else
  344. {
  345. glColor3f(1,1,1);
  346. glPointSize(20);
  347. glBegin(GL_POINTS);
  348. glVertex2d(250,370);
  349. glEnd();
  350. }
  351. if(count5==0)
  352. {
  353. glColor3f(1,0,1);
  354. glPointSize(30);
  355. glBegin(GL_POINTS);
  356. glVertex2d(350,330);
  357. glEnd();
  358. glBegin(GL_LINE_LOOP);
  359. glVertex2d(335,345);
  360. glVertex2d(365,345);
  361. glVertex2d(365,315);
  362. glVertex2d(335,315);
  363. glEnd();
  364. }
  365. else
  366. {
  367. glColor3f(1,1,1);
  368. glPointSize(20);
  369. glBegin(GL_POINTS);
  370. glVertex2d(350,330);
  371. glEnd();
  372. }
  373. if(count6==0)
  374. {
  375. glColor3f(1,0,1);
  376. glPointSize(30);
  377. glBegin(GL_POINTS);
  378. glVertex2d(450,290);
  379. glEnd();
  380. glBegin(GL_LINE_LOOP);
  381. glVertex2d(435,305);
  382. glVertex2d(465,305);
  383. glVertex2d(465,275);
  384. glVertex2d(435,275);
  385. glEnd();
  386. }
  387. else
  388. {
  389. glColor3f(1,1,1);
  390. glPointSize(20);
  391. glBegin(GL_POINTS);
  392. glVertex2d(450,290);
  393. glEnd();
  394. }
  395. if(count7==0)
  396. {
  397. glColor3f(1,0,1);
  398. glPointSize(30);
  399. glBegin(GL_POINTS);
  400. glVertex2d(330,245);
  401. glEnd();
  402. glBegin(GL_LINE_LOOP);
  403. glVertex2d(315,260);
  404. glVertex2d(345,260);
  405. glVertex2d(345,230);
  406. glVertex2d(315,230);
  407. glEnd();
  408. }
  409. else
  410. {
  411. glColor3f(1,1,1);
  412. glPointSize(20);
  413. glBegin(GL_POINTS);
  414. glVertex2d(330,245);
  415. glEnd();
  416. }
  417. if(count8==0)
  418. {
  419. glColor3f(1,0,1);
  420. glPointSize(30);
  421. glBegin(GL_POINTS);
  422. glVertex2d(200,200);
  423. glEnd();
  424. glBegin(GL_LINE_LOOP);
  425. glVertex2d(185,215);
  426. glVertex2d(215,215);
  427. glVertex2d(215,185);
  428. glVertex2d(185,185);
  429. glEnd();
  430. }
  431. else
  432. {
  433. glColor3f(1,1,1);
  434. glPointSize(20);
  435. glBegin(GL_POINTS);
  436. glVertex2d(200,200);
  437. glEnd();
  438. }
  439. if(count9==0)
  440. {
  441. glColor3f(1,0,1);
  442. glPointSize(30);
  443. glBegin(GL_POINTS);
  444. glVertex2d(400,150);
  445. glEnd();
  446. glBegin(GL_LINE_LOOP);
  447. glVertex2d(385,165);
  448. glVertex2d(415,165);
  449. glVertex2d(415,135);
  450. glVertex2d(385,135);
  451. glEnd();
  452. }
  453. else
  454. {
  455. glColor3f(1,1,1);
  456. glPointSize(20);
  457. glBegin(GL_POINTS);
  458. glVertex2d(400,150);
  459. glEnd();
  460. }
  461. if(count10==0)
  462. {
  463. glColor3f(1,0,1);
  464. glPointSize(30);
  465. glBegin(GL_POINTS);
  466. glVertex2d(300,100);
  467. glEnd();
  468. glBegin(GL_LINE_LOOP);
  469. glVertex2d(285,115);
  470. glVertex2d(315,115);
  471. glVertex2d(315,85);
  472. glVertex2d(285,85);
  473. glEnd();
  474. }
  475. else
  476. {
  477. glColor3f(1,1,1);
  478. glPointSize(20);
  479. glBegin(GL_POINTS);
  480. glVertex2d(300,100);
  481. glEnd();
  482. }
  483. glFlush();
  484. }
  485.  
  486. //to move the arrow left when ‘r’ pressed
  487. void id1()
  488. {
  489. x+=m;
  490. disa();
  491. if(x+110>maxx)
  492. {
  493. x=25;
  494. y=0;
  495. count++;
  496. glutIdleFunc(id);
  497. }
  498. glutPostRedisplay();
  499. }
  500.  
  501. //set key to perform desired operation
  502. void keys(unsigned char k,int r,int q)
  503. {
  504. if(k=='r')
  505. glutIdleFunc(id1);
  506. if(k=='q')
  507. exit(0);
  508. }
  509.  
  510. //sub menu to display instructions
  511. void demo_menu(int i)
  512. {
  513. switch(i)
  514. {
  515. case 5:
  516. case 6:
  517. case 7:
  518. case 8:break;
  519. }
  520. }
  521.  
  522. //sub menu to display designer names
  523. void demo(int i)
  524. {
  525. switch(i)
  526. {
  527. case 9:
  528. case 10:
  529. case 11:break;
  530. }
  531. }
  532. void game(int id)
  533. {
  534. switch(id);
  535. {
  536. }
  537. }
  538. int main(int argc,char **argv)
  539. {
  540. int sub_menu;
  541. glutInit(&argc,argv);
  542. glutInitDisplayMode(GLUT_DOUBLE|GLUT_RGB|GLUT_DEPTH);
  543. glutInitWindowSize(900,900);
  544. glutCreateWindow("BLOCK SHOOTING GAME ARCHERY");
  545. sub_menu=glutCreateMenu(demo_menu);
  546. glutAddMenuEntry(" r to move right",5);
  547. glutAddMenuEntry("A total of i5 arrows and 10 blocks are present",6);
  548. glutAddMenuEntry("You loose the game if the arrow count exceeds the blocks count",7);
  549. glutAddMenuEntry("or else you win",8);
  550. glutCreateMenu(game);
  551. glutAddSubMenu("INSTRUCTIONS",sub_menu);
  552. glutAttachMenu(GLUT_RIGHT_BUTTON);
  553. glutDisplayFunc(disp);
  554. glutIdleFunc(id);
  555. glutKeyboardFunc(keys);
  556. init();
  557. glEnable(GL_DEPTH_TEST);
  558. glutMainLoop();
  559. return 0;
  560. }
  561.  
  562.  
  563.  
  564.  
  565.  
  566.  
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:1:5: error: stray ‘@’ in program
 gray@elemental:~$ aptitude search opengl
     ^
prog.cpp:11:23: error: too many decimal points in number
 v   libghc-opengl-dev-2.2.3.1-2a936 -
                       ^~~~~~~
prog.cpp:12:23: error: too many decimal points in number
 v   libghc-opengl-dev-2.2.3.1-d355c -
                       ^~~~~~~
prog.cpp:16:24: error: too many decimal points in number
 v   libghc-opengl-prof-2.2.3.1-2a93 -
                        ^~~~~~~
prog.cpp:17:24: error: too many decimal points in number
 v   libghc-opengl-prof-2.2.3.1-d355 -
                        ^~~~~~~
prog.cpp:21:23: error: too many decimal points in number
 p   libguichan-opengl-0.8.1-1       - small, efficient C++ GUI library (OpenGL i
                       ^~~~~
prog.cpp:22:23: error: too many decimal points in number
 p   libguichan-opengl-0.8.1-1:i386  - small, efficient C++ GUI library (OpenGL i
                       ^~~~~
prog.cpp:34:20: error: too many decimal points in number
 p   libopengl-ruby1.9.1             - OpenGL binding for Ruby 1.9.1
                    ^~~~
prog.cpp:34:63: error: too many decimal points in number
 p   libopengl-ruby1.9.1             - OpenGL binding for Ruby 1.9.1
                                                               ^~~~~
prog.cpp:35:20: error: too many decimal points in number
 p   libopengl-ruby1.9.1:i386        - OpenGL binding for Ruby 1.9.1
                    ^~~~
prog.cpp:35:63: error: too many decimal points in number
 p   libopengl-ruby1.9.1:i386        - OpenGL binding for Ruby 1.9.1
                                                               ^~~~~
prog.cpp:70:20: fatal error: GL/glut.h: No such file or directory
 #include<GL/glut.h>
                    ^
compilation terminated.
stdout
Standard output is empty