当前位置:网站首页>01-01-osg GL3 环境搭建
01-01-osg GL3 环境搭建
2022-07-29 05:08:00 【longlongway2012】
osg GL3 配置的编译
auhor: longlongwaytogo
email: [email protected]
repo: https://github.com/longlongwaytogo/LearnOsgGL3
准备工作
下载osg最新版本
git clone [email protected]:openscenegraph/OpenSceneGraph.git
下载osg基于vs2019_x64的第三方库(感谢osg版主freesouth的编译)
下载OpengGL头文件
git clone [email protected]:KhronosGroup/OpenGL-Registry.git下载 egl头文件
git clone [email protected]:KhronosGroup/EGL-Registry.git
编译
拷贝头文件:
copy OpenGL-Registry\api\GL目录至OpenSceneGraph\include目录下
copy EGL-Registry\api\KHR目录至OpenSceneGraph\include目录下
如图:

解压第三方库
运行cmake-gui进行配置
- 在opensceneGraph目录下指定binary目录为build_vs2019_x64_GL3
- 设置ACTUAL_3RDPARTY_DIR目录为3rdparty所在路径
- search中输入opengl,设置opengl头文件为glcorearb.h,如下图:

设置osg中对OpenGL的支持:
启用的配置:
- OSG_GL3_AVAILABLE
禁用的配置:
- OSG_GL1_AVAILABLE
- OSG_GL2_AVAILABLE
- OSG_GLES1_AVAILABLE
- OSG_GLES2_AVAILABLE
- OSG_GL_DISPLAYLISTS_AVAILABLE
- OSG_GL_FIXED_FUNCTION_AVAILABLE
- OSG_GL_MATRICES_AVAILABLE
- OSG_GL_VERTEX_ARRAY_FUNCS_AVAILABLE
- OSG_GL_VERTEX_FUNCS_AVAILABLE
如图所示:

- 设置编译BUILD_OSG_EXAMPLES 选项
- 设置WIN32_USE_MP 加速编译速度
- 点击genrate,打开sln工程进行编译
错误修复:
可能出现无法编译,找不到GL_COMPRESSED_RGB_S3TC_DXT1_EXT,需要注释掉Texture头文件第60行,因为该宏被glcorearb.h已经定义过了:
//#ifndef GL_EXT_texture_compression_s3tc
#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0
#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1
#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2
#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3
#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C
#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D
#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E
#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F
//#endif
copy 第三发库 dll到bin目录下
运行 例子中的 osgsimplegl3:
osgsimplegl3 cow.osg如图:

边栏推荐
- 开区网站打开自动播放音乐的添加跟修改教程
- ODOO开发教程之透视表
- 7.3-function-templates
- SM整合原来这么简单,步骤清晰(详细)
- JS (foreach) return cannot end the function solution
- What if excel is stuck and not saved? The solution of Excel not saved but stuck
- Legend how to configure multiple versions of wechat updates on one server
- How to add a map to the legendary server
- Rimworld通过SteamCMD上传创意工坊的方法
- [wechat applet] swiper slides the page, and the left and right sides of the slider show part of the front and back, showing part of the front and back
猜你喜欢

Numpy Foundation

Webrtc audio anti weak network technology (Part 2)

How to make the characters in the photos laugh? HMS core video editing service one click smile function makes people smile more naturally

传奇开区网站如何添加流量统计代码

Unity Metaverse(三)、Protobuf & Socket 实现多人在线

ARFoundation入门教程7-url动态加载图像跟踪库
![[wechat applet -- solve the alignment problem of the last line of display:flex. (discontinuous arrangement will be divided into two sides)]](/img/ee/b424d876c64dac652d76f9f26e4b20.png)
[wechat applet -- solve the alignment problem of the last line of display:flex. (discontinuous arrangement will be divided into two sides)]

TCP三次握手四次挥手

Rimworld通过SteamCMD上传创意工坊的方法

浅谈AspectJ框架
随机推荐
Rolabelimg to data format data
[config] configure array parameters
[untitled]
C语言连连看秒杀辅助
Qt版的贪食蛇游戏项目
WDDM学习
Activity workflow table structure learning
最新坦克大战2022-全程开发笔记-1
一文带你搞懂环绕通知@Around与最终通知@After的实现
2022年泰迪杯数据挖掘挑战赛C题方案及赛后总结
【[第一次写博客]Uda课程中的P控制器实现说明】
ARFoundation从零开始8-Geospatial API(地理空间)开发
Is Huatai Securities an AA level securities company? How about this company? Is it safe to open an account?
How does WPS take quick screenshots? WPS quick screenshot method
TCP三次握手四次挥手
2022年SPSSPRO认证杯数学建模B题第二阶段方案及赛后总结
AttributeError: ‘module‘ object has no attribute ‘create_connection‘
Unity Metaverse(三)、Protobuf & Socket 实现多人在线
Ros1 dead chicken data is stored in txt and SQLite
Numpy Foundation