osg prebuild 准备好开发工具

osg 的编译颇费周折,需要关注CMake的安装选项和一些第三方库的配置,OSG大量的代码是基于固定管线实现的,如果用GL3的选项编译,很多的例子无法正常运行,因此我们在学习阶段还是使用GL2编译选项。

GL 2 编译

 

 

 不熟悉什么是 profile的同学,可以参考我的另一篇博文 《opengl版本发展史及各种概念的厘清》

GL3编译

Here are the steps for building OSG in the OpenGL CORE Profile  once you have configured CMake as usual. 
   1. Download the GL CORE include folder from Khronos:  https://www.khronos.org/registry/OpenGL/api/GL/ 
   2. Put it in a folder somewhere. You can put it in a folder called glcore, or  you can make a "GL" folder in the include folder of the OSG repository and 
 put it there. 
   3. In CMake, set the OPENGL_PROFILE property to GLCORE. 

   4. Set the GLCORE_GLCOREARB_HEADER property to the location of your  new "GL" folder containing the CORE ARB include files. For example if your  include file is at "C:/devel/glcore/GL/glcorearb.h", set this variable to  C:/devel/glcore. 
   5. Set the following variables ON: 

  •  OSG_GL3_AVAILABLE 


   6. Set the following variables OFF: 

  •  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 

   7. Configure and build OSG. 
   8.  If you want to disable the CORE profile, set the environment variable  OSG_GL_CONTEXT_PROFILE_MASK to 2. This requests a compatibility mode  context. 
   Enjoy! 

如果要编译GL3版本的osg,  参照上面的指示,给英文不好的同学翻译一下, 大意就是从www.khronos.org网站下载头文件,放到osg的incude 目录下,按要求设置CMAKE的编译变量。

不过编译后的版本,许多例子无法运行,希望OSG的开源社区能快速跟上OPENGL标准的推出进度。下面是我提供编译好的G2版本的链接,方便大家下载

vs2015-osg3.6.5-GL2                    链接:https://pan.baidu.com/s/1G4m-O-5QW6ebAdztUPwx7Q 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值