1.头文件
最初的头文件是: glut.h
现在可以使用: freeglut.h
这两个头文件都包含了glu.h和gl.h
2.初始化设置接口
glutInit(int *argc,char **argv)
glutInitDisplayMode(unsigned int mode) // GLUT_DOUBLE,GLUT_RGBA,GLUT_DEPTH
glutInitWindowPosition(int x,int y) //屏幕左上角的位置
glutInitWindowSize(int width,int size) //窗口大小
glutInitContextVersion(int majorVersion,int minorVersion)//opengl版本,使用freeglut时使用
int glutCreateWindow(char *string) //窗口名称
glutMainLoop()//窗口渲染,并显示
3.回调函数
glutDisplayFunc(void (*func)(void))
glutReshapeFunc(void(*func)(int w,int h)) //窗口大小发生改变时调用
glutKeyboardFunc(void(*Func(unsigned char key,int x,int y)) //键盘
glutMouseFunc(void(*func)(int button,int state,int x,inty)) //鼠标
glutMotionFunc(void(*func)(int x,int y)//按下鼠标按钮并移动
glutIdleFunc(void(*Func)(void)) //空闲处理 ,如果输入null,则停止执行此回调接口
4.三位物体
void glutWireCube(GLdouble size) //立方体
void glutSolidCube(GLdouble size) //
void glutWireSphere(GLdouble radius,GLint slices,GLint stacks)
void glutSolidSphere(GLdouble radius,GLint slices,GLint stacks)
5.应用程序使用本地窗口系统打开窗口并处理事件, *GetProAddress() ???????????????????????
6,glFlush()
强制客户机发送网络数据包,即使没有填满,如不存在网络,则立即执行
glFinish() 同上
此接口需要接口一会图完成的指令,否则会阻塞下一条指令.因此使用过多,会降低性能 &n
最初的头文件是: glut.h
现在可以使用: freeglut.h
这两个头文件都包含了glu.h和gl.h
2.初始化设置接口
glutInit(int *argc,char **argv)
glutInitDisplayMode(unsigned int mode) // GLUT_DOUBLE,GLUT_RGBA,GLUT_DEPTH
glutInitWindowPosition(int x,int y) //屏幕左上角的位置
glutInitWindowSize(int width,int size) //窗口大小
glutInitContextVersion(int majorVersion,int minorVersion)//opengl版本,使用freeglut时使用
int glutCreateWindow(char *string) //窗口名称
glutMainLoop()//窗口渲染,并显示
3.回调函数
glutDisplayFunc(void (*func)(void))
glutReshapeFunc(void(*func)(int w,int h)) //窗口大小发生改变时调用
glutKeyboardFunc(void(*Func(unsigned char key,int x,int y)) //键盘
glutMouseFunc(void(*func)(int button,int state,int x,inty)) //鼠标
glutMotionFunc(void(*func)(int x,int y)//按下鼠标按钮并移动
glutIdleFunc(void(*Func)(void)) //空闲处理 ,如果输入null,则停止执行此回调接口
4.三位物体
void glutWireCube(GLdouble size) //立方体
void glutSolidCube(GLdouble size) //
void glutWireSphere(GLdouble radius,GLint slices,GLint stacks)
void glutSolidSphere(GLdouble radius,GLint slices,GLint stacks)
5.应用程序使用本地窗口系统打开窗口并处理事件, *GetProAddress() ???????????????????????
6,glFlush()
强制客户机发送网络数据包,即使没有填满,如不存在网络,则立即执行
glFinish() 同上
此接口需要接口一会图完成的指令,否则会阻塞下一条指令.因此使用过多,会降低性能 &n