Opengl Installation Steps
Opengl Installation Steps
Part-1 Prepare your Linux Mint operating system for OpenGL Development
1 Open a terminal and enter the following commands to install the necessary
libraries for OpenGL development:
Type/Copy/Paste following commands:
$ sudo apt-get update
$ sudo apt-get install freeglut3
$ sudo apt-get install freeglut3-dev
$ sudo apt-get install binutils-gold
$ sudo apt-get install g++ cmake
$ sudo apt-get install libglew-dev
$ sudo apt-get install g++
$ sudo apt-get install mesa-common-dev
$ sudo apt-get install build-essential
$ sudo apt-get install libglew1.5-dev libglm-dev
2 Get information about the OpenGL and GLX implementations running or not?
1. #include <GL/freeglut.h>
2. #include <GL/gl.h>
3.
4. void renderFunction()
5. {
6. glClearColor(0.0, 0.0, 0.0, 0.0);
7. glClear(GL_COLOR_BUFFER_BIT);
8. glColor3f(1.0, 1.0, 1.0);
9. glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0);
10. glBegin(GL_POLYGON);
11. glVertex2f(-0.5, -0.5);
12. glVertex2f(-0.5, 0.5);
Page 1 of 2
13. glVertex2f(0.5, 0.5);
14. glVertex2f(0.5, -0.5);
15. glEnd();
16. glFlush();
17. }
18. int main(int argc, char** argv)
19. {
20. glutInit(&argc, argv);
21. glutInitDisplayMode(GLUT_SINGLE);
22. glutInitWindowSize(500,500);
23. glutInitWindowPosition(100,100);
24. glutCreateWindow("OpenGL - First window demo");
25. glutDisplayFunc(renderFunction);
26. glutMainLoop();
27. return 0;
28. }
Page 2 of 2