# gears **Repository Path**: code-development-team/gears ## Basic Information - **Project Name**: gears - **Description**: gears用例修改,使用了不同opengl版本和窗口系统,运行可以添加命令,配置窗口大小和是否打印信息。 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-11-14 - **Last Updated**: 2020-12-23 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 总体说明 本代码是修改的mesa glxgears代码,改成不同opengl版本和不同窗口系统的代码,包含以下配置功能:设置窗口宽高、设置运行帧数、设置是否打印Opengl环境信息和FPS结果、设置是否使用offscreen绘制。 # 结构介绍 ``` botson@botson:~/gears$ tree . ├── build --- 运行cmake和make编译的目录 ├── CMakeLists.txt ├── Readme.md --- 本使用说明文件 ├── source.me --- 设置mesa opengl版本的环境变量 └── src ├── CMakeLists.txt ├── gears-egl-es11.c --- 使用egl窗口系统+opengl es 1.1版本API ├── gears-egl-es20.c --- 使用egl窗口系统+opengl es 2.0版本API ├── gears-egl-es30.c --- 使用egl窗口系统+opengl es 3.0版本API ├── gears-glut-gl13.c --- 使用glut窗口系统+opengl 1.3版本API(是原始的mesa glxgears代码,用显示列表和glBegin/End、glVertex/Normal绘制) ├── gears-glut-gl15.c --- 使用glut窗口系统+opengl 1.5版本API,替换调显示列表和glBegin/End、glVertex/Normal的绘制方式,用函数调用和glVertexointer/NormalPointer ├── gears-glut-gl20.c --- 使用glut窗口系统+opengl 2.0版本API,使用BufferData传数据,不再每帧渲染中计算顶点和法线数据,节省计算时间。 ├── gears-glut-gl23.c --- 使用glut窗口系统+opengl 2.3版本API,使用GLSL 100 ├── gears-glut-gl33.c --- 使用glut窗口系统+opengl 33版本API,使用GLSL 330 ├── gears-glx-gl13.c --- 类似上面的gears-glut-gl13.c只替换了窗口系统 ├── gears-glx-gl15.c --- 类似上面的gears-glut-gl15.c只替换了窗口系统 ├── gears-glx-gl23.c --- 类似上面的gears-glut-gl23.c只替换了窗口系统 └── gears-glx-gl33.c --- 类似上面的gears-glut-gl33.c只替换了窗口系统 ``` # 使用方法 ## 编译 cd build cmake .. make ## 运行 ./xxx [FrameNum] [windowWidth] [windowHeight] --info --offscreen 运行至少需要三个参数,后面两个参数可选 [FrameNum]: 运行帧数 [windowWidth]: 窗口长度 [windowHeight]: 窗口高度 --info : 打印OpenGL版本信息和FPS帧率 --offscreen : 使用Pbuffer做offscreen渲染