-
Notifications
You must be signed in to change notification settings - Fork 20
/
Create empty window.cpp
79 lines (79 loc) · 1.63 KB
/
Create empty window.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
//Black Window
#include<windows.h>
#include<GL/GLU.h>
#include<GL/glut.h>
void display()
{
glClearColor(0.0, 0.0, 0.0, 0.0);
glClear(GL_COLOR_BUFFER_BIT);
glFlush();
}
//Program to create an empty Widnow
void init()
{
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
glutInitWindowSize(400, 400);
glutInitWindowPosition(100, 200);
glutCreateWindow("empty window");
}
int main(int argc, char **argv)
{
glutInit(&argc, argv);
init();
glutDisplayFunc(display);
glutMainLoop();
return 0;
}
//************************************************************************
////White Window
#include<windows.h>
#include<GL/GLU.h>
#include<GL/glut.h>
void display()
{
glClearColor(1.0,1.0, 1.0, 0.0);
glClear(GL_COLOR_BUFFER_BIT);
glFlush();
}
//Program to create an empty Widdow
void init() {
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
glutInitWindowSize(400, 400);
glutInitWindowPosition(100, 200);
glutCreateWindow("White window");
}
int main(int argc, char **argv)
{
glutInit(&argc, argv);
init();
glutDisplayFunc(display);
glutMainLoop();
return 0;
}
//************************************************************************
//Color Window
#include<windows.h>
#include<GL/GLU.h>
#include<GL/glut.h>
void display()
{
glClearColor(0.4, 0.2, 0.1, 0.0);
glClear(GL_COLOR_BUFFER_BIT);
glFlush();
}
//Program to create an empty Widdow
void init()
{
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
glutInitWindowSize(400, 400);
glutInitWindowPosition(100, 200);
glutCreateWindow("Color window");
}
int main(int argc, char **argv)
{
glutInit(&argc, argv);
init();
glutDisplayFunc(display);
glutMainLoop();
return 0;
}