在Android上编译OSG[3.0.2 ] (转)
在Android上编译OSG[3.0.2 ]
- 分类:Android
This file contents can be applied for version OpenSceneGraph(OSG) 3.0.2 or newer.
Prerequisites for build process
To compile OSG as a standalone library you'll only need the Android NDK. To develop applications with the library you'll also need the Android SDK
- Android SDK: http://developer.android.com/sdk/index.html
- Android NDK: http://developer.android.com/sdk/ndk/index.html
The required version to compile OSG is NDK r5 or newer. We don't recommend using previous versions or modified versions although it's possible to use the Crystax NDK versions.
Device minimun requirements
OSG for Android need to use a Level 8 or newer Native ABI and a 2.2 or newer Android version. It's possible to use Android 2.1 devices succesfully but it's not recommended. Older Android versions are not supported. There are specific device models with a bug that need the application locked in landscape mode to run.
OpenSceneGraph Android known issues
- OSG for Android is a STATIC build library
- To add a plugin or module you have to use the macros: USE_OSGPLUGIN(),USE_DOTOSGWRAPPER_LIBRARY(),USE_SERIALIZER_WRAPPER_LIBRARY().
- OSG for Android uses OpenGL ES 1.X/2.0.
- There are features present in OpenGL that doesn't exist in OpenGL ES: http://www.khronos.org/opengles/
- ENVIRONMENTAL MAPPING DOESN'T WORK but you can use a E.M. Shader in GLES 2.0.
- OSG Pregenerated Shaders DON'T compile with GLES, you need to add your shaders.
- Multithreaded Viewer CRASHES the application.
- osgSim and osgShadow will crash the application if you don't link freetype.
Build Config
For the Android building in OSG, we use the CMake command line to generate the Android Makefiles. These are the variables that have to be set.
ANDROID BUILD
The first CMake variable to be set is the Android build Variable
Now, CMake needs to know where you have the NDK. That's done by setting the next variable
Right now, Android version has to be compiled in static. To do so you have to set the next variables.
OPENGL ES CONFIG
When working in Android, you have to set OSG in GLES1 OR GLES2 configuration. It's not advisable to compile with support for both at the same time. Runtime linking error may happen. To set GLES1/2 functionality you have to set the options in CMake:
GLES1
GLES2
COMPILATION OPTIONS
You can select the Android ABI hardwares to be compiled (x86,armeabi,armeabi-v7a,mips) This option is set by default to armeabi armeabi-v7a and the ABI platform version. This option is set by default to 5.
OSG requires the C++ STL library in Android there are several different STL versions static and shared. Which versión is used can be setted with the next variable. By default this variable is set to gnustl_static.
To generate the binary libraries with debug symbols you have to use the next variable.
OPTIMIZATIONS
The next variables can be set to true to enable some optimizations. Beware that not all devices are compatible with them and not on all ABI platforms.
OTHERS
To enable the -j command you have to set it in the Cmake line.
To define a install path you have to use the nex variable
Building your application
Building an application in Android withouth any prior knowledge is hard. If you don't have experience developing simple test Android NDK applications don't try to cope with OSG in Android. First learn some basics of Android/Dalvik and about Android/NDK. It's not recommendable to go to our mailing lists or google's withouth some knowledge first. For some good readins I can recommend the next books:
OPENSCENEGRAPH
- Wang Rui et Al. OpenSceneGraph Beginners Guide Published
- Wang Rui et Al. OpenSceneGraph Cookbook Published
ANDROID
- Reto Meier Professional Android 4 Application Development
- Sylvain Ratabouil Android NDK
Building an application with a native part in Android is a two step job. First you have to compile the native part with the ndk-build and second you need to compile the java part. There are some plugins in eclipse that ease this part like Sequoyah. If you want to check how to do a OsgAndroid Application then there are two examples in the OSG distribution. They are for GLES1 and GLES2. This are the characteristics implemented in the application.
- Resolution locked to landscape.
- Menu button shows a Android menu with options to load or delete models, also you can use the virtual keyboard.
- Basic state and manipulator changes by keyboard entry.
- Android UI with buttons to center view and change mode of navigation.
- Multitouch example.
3rd Party Dependencies
To ease the development of applications, there is a 3rd party dependency pack with libjpeg, libpng, libtiff, libcurl and freetype to use with OpenSceneGraph in Android. This pack only works with armeabi v5 and v7. The package can be found at the next address: http://www2.ai2.upv.es/difusion/osgAndroid/3rdpartyAndroid.zip
To use the package, put the 3rdparty directory inside the OSG root directory and run Cmake. It will be detected and configured appropiatedly.
- 点击数:1098
在Android上编译OSG[3.0.2 ] (转)的更多相关文章
- 在Linux上编译Hadoop-2.4.0
目录 目录 1 1. 前言 1 2. 安装依赖 1 2.1. 安装ProtocolBuffer 2 2.2. 安装CMake 2 2.3. 安装JDK 2 2.4. 安装Maven 3 3. 编译Ha ...
- CentOS 64位上编译 Hadoop2.6.0
由于hadoop-2.6.0.tar.gz安装包是在32位机器上编译的,64位的机器加载本地库.so文件时会出错,比如: java.lang.UnsatisfiedLinkError: org.apa ...
- 在Linux上编译Hadoop-2.4.0实践与总结
问题导读: 1.编译源码前需要安装哪些软件? 2.安装之后该如何设置环境变量? 3.为什么不要使用JDK1.8? 4.mvn package -Pdist -DskipTests -Dtar的作用是什 ...
- 在干净的ubuntu 14.10上编译Qemu2.2.0的过程
下载Qemu的源代码 从官网http://wiki.qemu.org/Main_Page 中下载最新的源代码,目前是2.2.0. 安装依赖库和编译 编译过程分两步1. ./configure 2. m ...
- FFmpeg在Android上的移植优化步骤
http://blog.csdn.net/feixiang_john/article/details/7894188 从事多媒体软件开发的人几乎没有不知道FFmpeg的,很多视频播放器都是基于FFmp ...
- FFmpeg在Android上的移植之第一步
http://blog.sina.com.cn/s/blog_69a04cf40100x1fr.html 从事多媒体软件开发的人几乎没有不知道FFmpeg的,很多视频播放器都是基于FFmpeg开发的. ...
- Yarn上运行spark-1.6.0
目录 目录 1 1. 约定 1 2. 安装Scala 1 2.1. 下载 2 2.2. 安装 2 2.3. 设置环境变量 2 3. 安装Spark 2 3.1. 下载 2 3.2. 安装 2 3.3. ...
- 编译osg for android
做osg数数已经快两年了,之前将一些opengl的代码搬到了osg上,现在将一些osg的代码搬到了android上,尝试看看效果. 首先是编译的事情,android for android在http: ...
- 编译可在Nexus5上运行的CyanogenMod13.0 ROM(基于Android6.0)
编译可在Nexus5上运行的CyanogenMod13.0 ROM (基于Android6.0) 作者:寻禹@阿里聚安全 前言 下文中无特殊说明时CM代表CyanogenMod的缩写. 下文中说的“设 ...
随机推荐
- nginx在基于域名访问的时候是下载的界面
刚才在做nginx实验时候出现访问域名的时候是下载页面一直下载了好多文件,使用IP访问就正常,在配置文件中找到一个sendfile的参数,把参数值改为off或者直接注释掉这个参数就可以访问了.
- 使用xcache加速PHP运行
XCache 是一个开源的 opcode 缓存器/优化器, 这意味着他能够提高您服务器上的 PHP 性能. 他通过把编译 PHP 后的数据缓冲到共享内存从而避免重复的编译过程, 能够直接使用缓冲区已编 ...
- 关于JavaWeb开发的一些感悟
从事JavaWeb的开发已经三年了,从最开始的啥都不会,到慢慢的能够独立做项目,从一开始的一片茫然,到现在的心中有数.对于技术.业务也有了自己的看法. JavaWeb开发所涉及到的知识点非常多,涉及到 ...
- hdu6212[区间dp] 2017青岛ACM-ICPC网络赛
原题: BZOJ1032 (原题数据有问题) /*hdu6212[区间dp] 2017青岛ACM-ICPC网络赛*/ #include <bits/stdc++.h> using name ...
- 解决报错DEFAULT_INCOMPATIBLE_IMPROVEMENTS
freemarker整合springMVC报错如下:警告: Exception encountered during context initialization - cancelling refre ...
- 浅谈后缀自动机SAM
一下是蒟蒻的个人想法,并不很严谨,仅供参考,如有缺误,敬请提出 参考资料: 陈立杰原版课件 litble 某大神 某大神 其实课件讲得最详实了 有限状态自动机 我们要学后缀自动机,我们先来了解一下自动 ...
- linux文件属性详解及文件类型
一 drwxr-xr-x的意思解释: ls -al 得到如下列表: drwxr-xr-x oracle dba May : oralog1 drwxr-x--- root root May : ro ...
- react-router路由参数
react-router会自动为路由组件插入三个参数,但是不会主动为路由组件的子组件注入 子组件当中需要在属性当中传入 不是路由组件需要注入路由参数的话,也可以使用withRouter注入,而不是从属 ...
- node系列
http://www.cnblogs.com/zhongweiv/p/nodejs.html
- Spring MVC @PathVariable 特殊字符
1.问题 SpringMVC项目中通过下面的URL进行GET请求.当version有多个小数点的时候.如version为1.0.1008.后台通过@PathVariable来获取version等于1. ...