当前位置:网站首页>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如图:

边栏推荐
- Arfoundation starts from scratch 3- create an arfoundation project
- [file download] easyexcel quick start
- scikit-learn——机器学习应用开发的步骤和理解
- 网安学习-内网安全1
- 源码编译pytorch坑
- Mysql把查询到的结果集按指定顺寻进行排序
- The latest tank battle 2022 full development notes-1
- Google GTEST event mechanism
- 自贸经济中架起的“隐形桥梁”:国货精品与中国AI力量
- Webrtc audio anti weak network technology (Part 2)
猜你喜欢

Adb常用命令列表

ODOO开发教程之图表

Activity workflow table structure learning

Unity metaverse (III), protobuf & socket realize multi person online

Getting started with solidity

向往的开源之多YOUNG新生 | 从开源到就业的避坑指南来啦!

6.2 function-parameters

2022年SPSSPRO认证杯数学建模B题第二阶段方案及赛后总结

How to add traffic statistics codes to the legendary Development Zone website

Network Security Learning - Intranet Security 1
随机推荐
Apache POI implements excel import, read data, write data and export
时间序列分析的表示学习时代来了?
[2022 freshmen learning] key points of the third week
Unity metaverse (III), protobuf & socket realize multi person online
优炫数据库启动失败,报网络错误
The latest tank battle 2022 full development notes-1
SM整合原来这么简单,步骤清晰(详细)
Numpy Foundation
网安学习-内网安全1
Sparksql inserts or updates in batches and saves data to MySQL
[from_bilibili_DR_CAN][【Advanced控制理论】9_状态观测器设计][学习记录]
Deep learning brush a bunch of tricks of SOTA
Qml类型:MouseArea
Getting started with solidity
Legend how to configure multiple versions of wechat updates on one server
什么是_GLIBCXX_VISIBILITY(default)
Let you understand several common traffic exposure schemes in kubernetes cluster
Functions in MySQL statements
Soft link & hard link
Solve the warning prompt of MySQL mapping file