Ogre3d Android Platform Compilation tutorial

Source: Internet
Author: User

In the previous article, we talked about the Ogre3d process method in the window platform

Click to jump

This article describes how Ogre3d compiles to the Android platform. Can be compared with the official English course.

Reprinted from Blog Http://blog.csdn.net/huutu qq:790621656

First download Ogre3d dependent library Source code and Ogre3d source code, the download method is described in the previous article, this is not repeated here.

Reprinted from Blog Http://blog.csdn.net/huutu qq:790621656

Compilation tools: NDK, Visual Studio, CMake.

Reprinted from Blog Http://blog.csdn.net/huutu qq:790621656

(i) Installation and configuration of tools

First download the NDK, CMake, Visual Studio installation.

Configuring the NDK environment variable to the NDK directory



Add CMake.exe directory to Path

C:\Program Files (x86) \cmake\bin

Reprinted from Blog Http://blog.csdn.net/huutu qq:790621656

Add Nmake.exe directory to Path

C:\Program Files (x86) \microsoft Visual Studio 11.0\vc\bin

Add Ndk-build directory to Path

D:\android-ndk-r8e-windows-x86\android-ndk-r8e-windows-x86\android-ndk-r8e


(ii) compiling Ogre3d dependent libraries

Open the Ogre3d dependent library source file directory, shift+ the right mouse button, click "Open Command Window Here" to open the cmd window.

Input command

Cmake-g "NMake makefiles"-dcmake_toolchain_file=.\cmake\android.toolchain.cmake

Once the command has been executed, enter

Nmake

Start compiling.

If you need to compile additional CPU types, you can add configuration after the command

-dandroid_abi=armeabi-v7a

After the compilation is complete, the compiled file is found in the directory of the red characters in the diagram.


This depends on the library compilation completed

Reprinted from Blog Http://blog.csdn.net/huutu qq:790621656

(c) Compiling Ogre3d

First we create a new folder under the Ogre3d directory named

Androiddependencies

Then copy the dependent library generated by the second step into this directory, and then the header folder generated in the previous blog post

Build\ogredeps\include

Copy to this folder below.

Such as:



Open the Ogre3d directory, shift+ right-click to open the console, execute the command

Cmake-g "NMake makefiles"-dcmake_toolchain_file=.\cmake\toolchain\android.toolchain.cmake-dogre_dependencies_dir =.\androiddependencies-dandroid_native_api_level=9

After the CMake generation is complete, the NMAKE compilation begins

Nmake

A multithreaded implementation of NMAKE's tool JOM, developed by the QT Development team, is recommended here. :

http://download.csdn.net/detail/cp790621656/8540375

Download website

Http://qt-project.org/wiki/jom

Using Jom

Jom

After use, a file compiled by the original NMAKE one file programmed all CPU cores to participate in the compilation.


This ogre3d compiles.


(iv) Compiling Android project

In Ogre3d, there is no discovery of a known

Samplebrowserndk

folder, which was just generated by the Android project.

Enter the JNI directory

E:\WorkSpace\Ogre\SampleBrowserNDK\jni

Execute command

Ndk-build All-j4

Install to your phone using eclipse or directly with the Ant command after compilation is complete.


Ogre3d Android Platform compilation tutorial

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.