forked from Sanketwable/Graphics_Project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
menu.cpp
51 lines (31 loc) · 654 Bytes
/
menu.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include<iostream>
#include<GL/glut.h>
#include<GL/freeglut.h>
using namespace std;
// creating menu
extern int sub_menu,file,edit,view,imagemenu,color,help,sub_menu2,size;
void point_size(int id) /* to CHANGE THE PIXEL SIZE */
{
switch(id)
{
case 1:size++;
break;
case 2:if(size>1)
size--;
break;
}
}
void right(int id) /* to QUIT the editor */
{
if(id==2)
exit(0);
}
void menu() {
sub_menu=glutCreateMenu(point_size);
glutAddMenuEntry("increase",1);
glutAddMenuEntry("decrease",2);
glutCreateMenu(right);
glutAddSubMenu("Point size",sub_menu);
glutAddMenuEntry("Quit",2);
glutAttachMenu(GLUT_RIGHT_BUTTON);
}