如果想出发,就不要等到明天!
全部博文(317)
分类: LINUX
2013-06-15 01:31:09
- sudo apt-get install mesa-common-dev libgl1-mesa-dev libglu1-mesa-dev
- sudo apt-get install freeglut3-dev freeglut3
- sudo apt-get install build-essential gdb subversion
- sudo apt-get install automake autoconf libtool
- sudo apt-get install libgtk2.0-dev libxmu-dev libxxf86vm-dev
- sudo apt-get install binutils-gold
- sudo apt-get install build-essential
- sudo apt-get install vim
g++ -L/usr/lib -lGL -L/usr/lib -lglut main.cpp -o test
- #include <GL/gl.h>
- #include <GL/glut.h>
- void draw(void)
- {
- // Black background
- glClearColor(0.0f,0.0f,0.0f,1.0f);
- glClear(GL_COLOR_BUFFER_BIT);
- //Draw i
- glFlush();
- }
- //Main program
- int main(int argc, char **argv)
- {
- glutInit(&argc, argv);
- /*Setting up The Display
- / -RGB color model + Alpha Channel = GLUT_RGBA
- */
- glutInitDisplayMode(GLUT_RGBA|GLUT_SINGLE);
- //Configure Window Postion
- glutInitWindowPosition(50, 25);
- //Configure Window Size
- glutInitWindowSize(480,480);
- //Create Window
- glutCreateWindow("Hello OpenGL");
- //Call to the drawing function
- glutDisplayFunc(draw);
- // Loop require by OpenGL
- glutMainLoop();
- return 0;
- }