标签:http io ar color os sp on cti amp
在Ubuntu14.04下安装OpenGL记录:
测试程序
#include <GL/glut.h> void init(void){ glClearColor(0.0,0.0,0.0,0.0); glMatrixMode(GL_PROJECTION); glOrtho(-5,5,-5,5,5,15); glMatrixMode(GL_MODELVIEW); gluLookAt(0,0,10,0,0,0,0,1,0); return; } void display(void){ glClear(GL_COLOR_BUFFER_BIT); glColor3f(1.0,0,0); glutWireTeapot(3); glFlush(); return; } int main(int argc,char *argv[]){ glutInit(&argc,argv); glutInitDisplayMode(GLUT_RGB | GLUT_SINGLE); glutInitWindowPosition(0,0); glutInitWindowSize(300,300); glutCreateWindow("OpenGL #D View"); init(); glutDisplayFunc(display); glutMainLoop(); return 0; }
编译运行
gcc test.c -o test -lGL -lGLU -lglut
./test.c
这里是调用的OpenCL的动态链接库,C和C++均可调用,调用形式均为 -lGL -lGLU -lglut
[1].http://www.linuxidc.com/Linux/2013-05/84815.htm
标签:http io ar color os sp on cti amp
原文地址:http://my.oschina.net/lvyi/blog/347143