11 |
12 |
--------------------------------------------------------------------------------
/OpenGLNDK/README.md:
--------------------------------------------------------------------------------
1 | #OpenGL with NDK
2 |
3 | An OpenGL® ES 3.0 app in C++ using [VSL](http://www.lighthouse3d.com/very-simple-libs/). [Assimp](http://www.assimp.org/) is used to load models. Textures are loaded using JNI.
4 |
5 | The starting point for this app was the code from hello-gl2, hello-libs, and gles3jni, available in [googlesamples/android-ndk](https://developer.android.com/training/graphics/opengl/index.html). The added/changed features are:
6 | * arcball to control camera
7 | * texture loading
8 | * model loading with Assimp
9 | * using VSL to speed up demo development
10 |
11 | Move a finger to rotate the box.
12 |
13 | 
14 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 24
5 | buildToolsVersion "24.0.1"
6 | defaultConfig {
7 | applicationId "com.lighthouse3d.android.openglndk"
8 | minSdkVersion 21
9 | targetSdkVersion 24
10 | versionCode 1
11 | versionName "1.0"
12 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
13 | externalNativeBuild {
14 | cmake {
15 | cppFlags "-frtti -fexceptions -std=c++11"
16 | arguments "-DANDROID_TOOLCHAIN=clang", "-DANDROID_ARM_MODE=arm"
17 | }
18 | ndk {
19 | // Specifies the ABI configurations of your native
20 | // libraries Gradle should build and package with your APK.
21 | abiFilters 'x86', 'x86_64', 'armeabi', 'armeabi-v7a', 'arm64-v8a'
22 | }
23 | }
24 | }
25 | buildTypes {
26 | release {
27 | minifyEnabled false
28 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
29 | }
30 | }
31 | externalNativeBuild {
32 | cmake {
33 | path "CMakeLists.txt"
34 | }
35 | }
36 | }
37 |
38 | dependencies {
39 | compile fileTree(dir: 'libs', include: ['*.jar'])
40 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
41 | exclude group: 'com.android.support', module: 'support-annotations'
42 | })
43 | compile 'com.android.support:appcompat-v7:24.0.0'
44 | testCompile 'junit:junit:4.12'
45 | }
46 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in D:\Android\SDK/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/androidTest/java/com/lighthouse3d/android/openglndk/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.lighthouse3d.android.openglndk;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumentation test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.lighthouse3d.android.openglndk", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
12 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assets/CM/README.md:
--------------------------------------------------------------------------------
1 | This cube map from the Vasa museum in Stockholm is the work of Emil Persson, aka Humus (http://www.humus.name), who kindly provides it under a Creative Commons Attribution 3.0 Unported License (http://creativecommons.org/licenses/by/3.0/)
2 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assets/CM/negx.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lighthouse3d/AndroidGL/7e749e05894d9d443179f00ca796a50c015c4131/OpenGLNDK/app/src/main/assets/CM/negx.jpg
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assets/CM/negy.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lighthouse3d/AndroidGL/7e749e05894d9d443179f00ca796a50c015c4131/OpenGLNDK/app/src/main/assets/CM/negy.jpg
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assets/CM/negz.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lighthouse3d/AndroidGL/7e749e05894d9d443179f00ca796a50c015c4131/OpenGLNDK/app/src/main/assets/CM/negz.jpg
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assets/CM/posx.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lighthouse3d/AndroidGL/7e749e05894d9d443179f00ca796a50c015c4131/OpenGLNDK/app/src/main/assets/CM/posx.jpg
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assets/CM/posy.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lighthouse3d/AndroidGL/7e749e05894d9d443179f00ca796a50c015c4131/OpenGLNDK/app/src/main/assets/CM/posy.jpg
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assets/CM/posz.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lighthouse3d/AndroidGL/7e749e05894d9d443179f00ca796a50c015c4131/OpenGLNDK/app/src/main/assets/CM/posz.jpg
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assets/README.md:
--------------------------------------------------------------------------------
1 | The teapot model was downloaded from Geoff Leach [site](http://goanna.cs.rmit.edu.au/~pknowles/models.html) at RMIT
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assets/plane.mtl:
--------------------------------------------------------------------------------
1 | newmtl initialShadingGroup
2 | Kd 0.8 0.8 0.8 1.0
3 | Ka 0.2 0.2 0.2 1.0
4 | Ks 0.8 0.8 0.8 1.0
5 | Ns 128.0
6 |
7 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assets/plane.obj:
--------------------------------------------------------------------------------
1 | # This file uses centimeters as units for non-parametric coordinates.
2 |
3 | mtllib plane.mtl
4 | g default
5 | v -1.000000 -0.000000 1.000000
6 | v 1.000000 -0.000000 1.000000
7 | v -1.000000 0.000000 -1.000000
8 | v 1.000000 0.000000 -1.000000
9 |
10 | vt 0.000000 0.000000
11 | vt 1.000000 0.000000
12 | vt 0.000000 1.000000
13 | vt 1.000000 1.000000
14 |
15 | vn 0.000000 1.000000 0.000000
16 |
17 | s off
18 | g pPlane1
19 | usemtl initialShadingGroup
20 | f 1/1/1 2/2/1 4/4/1
21 | f 1/1/1/ 4/4/1 3/3/1
22 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assets/shaders/color.frag:
--------------------------------------------------------------------------------
1 | #version 300 es
2 |
3 | precision mediump float;
4 |
5 | uniform sampler2D texUnit;
6 |
7 | in vec4 texCoordV;
8 |
9 | out vec4 outputF;
10 |
11 | void main() {
12 | outputF = texture(texUnit, texCoordV.xy);
13 | }
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assets/shaders/color.vert:
--------------------------------------------------------------------------------
1 | #version 300 es
2 |
3 | layout (std140) uniform Matrices {
4 | mat4 m_pvm;
5 | mat4 m_model;
6 | mat4 m_vm;
7 | mat3 m_normalM;
8 | mat3 m_normal;
9 | };
10 |
11 | in vec4 position;
12 | in vec4 texCoord;
13 |
14 | out vec4 texCoordV;
15 |
16 |
17 | void main()
18 | {
19 | texCoordV = texCoord;
20 | gl_Position = m_pvm * position ;
21 | }
22 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assets/shaders/cubemap1.frag:
--------------------------------------------------------------------------------
1 | #version 300 es
2 |
3 | precision mediump float;
4 | precision mediump samplerCube;
5 |
6 | uniform samplerCube texUnit;
7 |
8 | in vec3 normalV;
9 | in vec3 eyeV;
10 |
11 | out vec4 color1;
12 |
13 |
14 | void main() {
15 |
16 | vec3 n = normalize(normalV);
17 | vec3 e = normalize(eyeV);
18 |
19 | // Reflection vector provides texture coordinates
20 | vec3 t = reflect(e, n);
21 |
22 | color1 = texture(texUnit, t);
23 | }
24 |
25 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assets/shaders/cubemap1.vert:
--------------------------------------------------------------------------------
1 | #version 300 es
2 |
3 | layout (std140) uniform Matrices {
4 | mat4 m_pvm;
5 | mat4 m_model;
6 | mat4 m_vm;
7 | mat3 m_normalM;
8 | mat3 m_normal;
9 | };
10 |
11 | uniform vec3 camPosWorld;
12 |
13 | in vec4 position;
14 | in vec3 normal;
15 |
16 | out vec3 normalV;
17 | out vec3 eyeV;
18 |
19 |
20 | void main () {
21 |
22 | normalV = normalize(m_normalM * normal);
23 |
24 | vec3 pos = vec3(m_model * position);
25 | eyeV = pos - camPosWorld;
26 |
27 | gl_Position = m_pvm * position;
28 | }
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assets/shaders/pixeldirdifambspec.frag:
--------------------------------------------------------------------------------
1 | #version 300 es
2 |
3 | precision mediump float;
4 |
5 | layout (std140) uniform Material {
6 | vec4 diffuse;
7 | vec4 ambient;
8 | vec4 specular;
9 | vec4 emissive;
10 | float shininess;
11 | int texCount;
12 | };
13 |
14 |
15 | in vec3 normalV;
16 | in vec2 texCoordV;
17 | in vec3 eyeV;
18 |
19 |
20 | uniform vec3 lightDir;
21 | uniform sampler2D texUnit;
22 |
23 | out vec4 colorOut;
24 |
25 | void main() {
26 |
27 | vec4 dif;
28 | vec4 spec;
29 |
30 | float intensity = max(dot(normalize(normalV),lightDir), 0.3);
31 |
32 | vec3 h = normalize(lightDir + normalize(eyeV));
33 | float intSpec = max(dot(h,normalize(normalV)), 0.0);
34 | spec = specular * pow(intSpec,100.0f);
35 | dif = diffuse;
36 |
37 | if (texCount != 0)
38 | dif = dif * texture(texUnit, texCoordV);
39 | colorOut = intensity * dif + spec + emissive;
40 | //colorOut=diffuse;
41 | }
42 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assets/shaders/pixeldirdifambspec.vert:
--------------------------------------------------------------------------------
1 | #version 300 es
2 |
3 | layout (std140) uniform Matrices {
4 | mat4 projModelViewMatrix;
5 | mat4 projectionMatrix;
6 | mat4 modelMatrix;
7 | mat4 viewMatrix;
8 | mat4 modelViewMatrix;
9 | mat3 normalMatrix;
10 | mat3 normalViewMatrix;
11 | };
12 |
13 |
14 | uniform vec3 lightDir;
15 |
16 | in vec4 position;
17 | in vec2 texCoord;
18 | in vec3 normal;
19 |
20 |
21 | in vec3 normalV;
22 | in vec2 texCoordV;
23 | in vec3 eyeV;
24 |
25 |
26 | void main () {
27 |
28 | texCoordV = texCoord;
29 |
30 | normalV = normalize(normalMatrix * normal);
31 |
32 |
33 | vec3 pos = vec3(modelViewMatrix * position);
34 | eyeV = normalize(-pos);
35 |
36 | gl_Position = projModelViewMatrix * position;
37 | }
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assimp/assimp/.editorconfig:
--------------------------------------------------------------------------------
1 | # See for details
2 |
3 | [*.{h,hpp,inl}]
4 | end_of_line = lf
5 | insert_final_newline = true
6 | trim_trailing_whitespace = true
7 | indent_size = 4
8 | indent_style = space
9 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assimp/assimp/AssbinExporter.h:
--------------------------------------------------------------------------------
1 | /*
2 | Open Asset Import Library (assimp)
3 | ----------------------------------------------------------------------
4 |
5 | Copyright (c) 2006-2016, assimp team
6 | All rights reserved.
7 |
8 | Redistribution and use of this software in source and binary forms,
9 | with or without modification, are permitted provided that the
10 | following conditions are met:
11 |
12 | * Redistributions of source code must retain the above
13 | copyright notice, this list of conditions and the
14 | following disclaimer.
15 |
16 | * Redistributions in binary form must reproduce the above
17 | copyright notice, this list of conditions and the
18 | following disclaimer in the documentation and/or other
19 | materials provided with the distribution.
20 |
21 | * Neither the name of the assimp team, nor the names of its
22 | contributors may be used to endorse or promote products
23 | derived from this software without specific prior
24 | written permission of the assimp team.
25 |
26 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
27 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
29 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
30 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
31 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
32 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
33 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
34 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
35 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
36 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 |
38 | ----------------------------------------------------------------------
39 | */
40 |
41 | /** @file AssbinExporter.h
42 | * ASSBIN Exporter Main Header
43 | */
44 | #ifndef AI_ASSBINEXPORTER_H_INC
45 | #define AI_ASSBINEXPORTER_H_INC
46 |
47 | // nothing really needed here - reserved for future use like properties
48 |
49 | #endif
50 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assimp/assimp/AssxmlExporter.h:
--------------------------------------------------------------------------------
1 | /*
2 | Open Asset Import Library (assimp)
3 | ----------------------------------------------------------------------
4 |
5 | Copyright (c) 2006-2016, assimp team
6 | All rights reserved.
7 |
8 | Redistribution and use of this software in source and binary forms,
9 | with or without modification, are permitted provided that the
10 | following conditions are met:
11 |
12 | * Redistributions of source code must retain the above
13 | copyright notice, this list of conditions and the
14 | following disclaimer.
15 |
16 | * Redistributions in binary form must reproduce the above
17 | copyright notice, this list of conditions and the
18 | following disclaimer in the documentation and/or other
19 | materials provided with the distribution.
20 |
21 | * Neither the name of the assimp team, nor the names of its
22 | contributors may be used to endorse or promote products
23 | derived from this software without specific prior
24 | written permission of the assimp team.
25 |
26 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
27 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
29 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
30 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
31 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
32 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
33 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
34 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
35 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
36 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 |
38 | ----------------------------------------------------------------------
39 | */
40 |
41 | /** @file AssxmlExporter.h
42 | * ASSXML Exporter Main Header
43 | */
44 | #ifndef AI_ASSXMLEXPORTER_H_INC
45 | #define AI_ASSXMLEXPORTER_H_INC
46 |
47 | // nothing really needed here - reserved for future use like properties
48 |
49 | #endif
50 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assimp/assimp/Compiler/poppack1.h:
--------------------------------------------------------------------------------
1 |
2 | // ===============================================================================
3 | // May be included multiple times - resets structure packing to the defaults
4 | // for all supported compilers. Reverts the changes made by #include
5 | //
6 | // Currently this works on the following compilers:
7 | // MSVC 7,8,9
8 | // GCC
9 | // BORLAND (complains about 'pack state changed but not reverted', but works)
10 | // ===============================================================================
11 |
12 | #ifndef AI_PUSHPACK_IS_DEFINED
13 | # error pushpack1.h must be included after poppack1.h
14 | #endif
15 |
16 | // reset packing to the original value
17 | #if defined(_MSC_VER) || defined(__BORLANDC__) || defined (__BCPLUSPLUS__)
18 | # pragma pack( pop )
19 | #endif
20 | #undef PACK_STRUCT
21 |
22 | #undef AI_PUSHPACK_IS_DEFINED
23 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assimp/assimp/Compiler/pushpack1.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | // ===============================================================================
4 | // May be included multiple times - sets structure packing to 1
5 | // for all supported compilers. #include reverts the changes.
6 | //
7 | // Currently this works on the following compilers:
8 | // MSVC 7,8,9
9 | // GCC
10 | // BORLAND (complains about 'pack state changed but not reverted', but works)
11 | // Clang
12 | //
13 | //
14 | // USAGE:
15 | //
16 | // struct StructToBePacked {
17 | // } PACK_STRUCT;
18 | //
19 | // ===============================================================================
20 |
21 | #ifdef AI_PUSHPACK_IS_DEFINED
22 | # error poppack1.h must be included after pushpack1.h
23 | #endif
24 |
25 | #if defined(_MSC_VER) || defined(__BORLANDC__) || defined (__BCPLUSPLUS__)
26 | # pragma pack(push,1)
27 | # define PACK_STRUCT
28 | #elif defined( __GNUC__ )
29 | # if !defined(HOST_MINGW)
30 | # define PACK_STRUCT __attribute__((__packed__))
31 | # else
32 | # define PACK_STRUCT __attribute__((gcc_struct, __packed__))
33 | # endif
34 | #else
35 | # error Compiler not supported
36 | #endif
37 |
38 | #if defined(_MSC_VER)
39 |
40 | // C4103: Packing was changed after the inclusion of the header, probably missing #pragma pop
41 | # pragma warning (disable : 4103)
42 | #endif
43 |
44 | #define AI_PUSHPACK_IS_DEFINED
45 |
46 |
47 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assimp/assimp/D3MFImporter.h:
--------------------------------------------------------------------------------
1 | /*
2 | Open Asset Import Library (assimp)
3 | ----------------------------------------------------------------------
4 |
5 | Copyright (c) 2006-2016, assimp team
6 | All rights reserved.
7 |
8 | Redistribution and use of this software in source and binary forms,
9 | with or without modification, are permitted provided that the
10 | following conditions are met:
11 |
12 | * Redistributions of source code must retain the above
13 | copyright notice, this list of conditions and the
14 | following disclaimer.
15 |
16 | * Redistributions in binary form must reproduce the above
17 | copyright notice, this list of conditions and the
18 | following disclaimer in the documentation and/or other
19 | materials provided with the distribution.
20 |
21 | * Neither the name of the assimp team, nor the names of its
22 | contributors may be used to endorse or promote products
23 | derived from this software without specific prior
24 | written permission of the assimp team.
25 |
26 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
27 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
29 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
30 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
31 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
32 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
33 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
34 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
35 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
36 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 |
38 | ----------------------------------------------------------------------
39 | */
40 |
41 | #ifndef AI_D3MFLOADER_H_INCLUDED
42 | #define AI_D3MFLOADER_H_INCLUDED
43 |
44 | #include
45 | #include
46 |
47 | #include "BaseImporter.h"
48 |
49 | namespace Assimp {
50 |
51 | class D3MFImporter : public BaseImporter
52 | {
53 | public:
54 | D3MFImporter();
55 | ~D3MFImporter();
56 |
57 | // BaseImporter interface
58 | public:
59 | bool CanRead(const std::string &pFile, IOSystem *pIOHandler, bool checkSig) const;
60 | void SetupProperties(const Importer *pImp);
61 | const aiImporterDesc *GetInfo() const;
62 |
63 | protected:
64 | void InternReadFile(const std::string &pFile, aiScene *pScene, IOSystem *pIOHandler);
65 |
66 | };
67 | }
68 | #endif // AI_D3MFLOADER_H_INCLUDED
69 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assimp/assimp/D3MFOpcPackage.h:
--------------------------------------------------------------------------------
1 | /*
2 | Open Asset Import Library (assimp)
3 | ----------------------------------------------------------------------
4 |
5 | Copyright (c) 2006-2016, assimp team
6 | All rights reserved.
7 |
8 | Redistribution and use of this software in source and binary forms,
9 | with or without modification, are permitted provided that the
10 | following conditions are met:
11 |
12 | * Redistributions of source code must retain the above
13 | copyright notice, this list of conditions and the
14 | following disclaimer.
15 |
16 | * Redistributions in binary form must reproduce the above
17 | copyright notice, this list of conditions and the
18 | following disclaimer in the documentation and/or other
19 | materials provided with the distribution.
20 |
21 | * Neither the name of the assimp team, nor the names of its
22 | contributors may be used to endorse or promote products
23 | derived from this software without specific prior
24 | written permission of the assimp team.
25 |
26 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
27 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
29 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
30 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
31 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
32 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
33 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
34 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
35 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
36 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 |
38 | ----------------------------------------------------------------------
39 | */
40 |
41 | #ifndef D3MFOPCPACKAGE_H
42 | #define D3MFOPCPACKAGE_H
43 |
44 | #include
45 | #include
46 |
47 | #include
48 | #include "irrXMLWrapper.h"
49 |
50 | namespace Assimp {
51 |
52 | namespace D3MF {
53 |
54 | typedef irr::io::IrrXMLReader XmlReader;
55 | typedef std::shared_ptr XmlReaderPtr;
56 |
57 | class D3MFZipArchive;
58 |
59 | class D3MFOpcPackage
60 | {
61 | public:
62 | D3MFOpcPackage(IOSystem* pIOHandler, const std::string& rFile);
63 | ~D3MFOpcPackage();
64 |
65 | IOStream* RootStream() const;
66 | private:
67 | std::string ReadPackageRootRelationship(IOStream* stream);
68 | private:
69 | IOStream* m_RootStream;
70 | std::unique_ptr zipArchive;
71 | };
72 |
73 | }
74 | }
75 |
76 | #endif // D3MFOPCPACKAGE_H
77 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assimp/assimp/DefaultProgressHandler.h:
--------------------------------------------------------------------------------
1 | /*
2 | Open Asset Import Library (assimp)
3 | ----------------------------------------------------------------------
4 |
5 | Copyright (c) 2006-2016, assimp team
6 | All rights reserved.
7 |
8 | Redistribution and use of this software in source and binary forms,
9 | with or without modification, are permitted provided that the
10 | following conditions are met:
11 |
12 | * Redistributions of source code must retain the above
13 | copyright notice, this list of conditions and the
14 | following disclaimer.
15 |
16 | * Redistributions in binary form must reproduce the above
17 | copyright notice, this list of conditions and the
18 | following disclaimer in the documentation and/or other
19 | materials provided with the distribution.
20 |
21 | * Neither the name of the assimp team, nor the names of its
22 | contributors may be used to endorse or promote products
23 | derived from this software without specific prior
24 | written permission of the assimp team.
25 |
26 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
27 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
29 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
30 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
31 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
32 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
33 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
34 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
35 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
36 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 |
38 | ----------------------------------------------------------------------
39 | */
40 |
41 | /** @file ProgressHandler.hpp
42 | * @brief Abstract base class 'ProgressHandler'.
43 | */
44 | #ifndef INCLUDED_AI_DEFAULTPROGRESSHANDLER_H
45 | #define INCLUDED_AI_DEFAULTPROGRESSHANDLER_H
46 |
47 | #include
48 |
49 | namespace Assimp {
50 |
51 | // ------------------------------------------------------------------------------------
52 | /** @brief Internal default implementation of the #ProgressHandler interface. */
53 | class DefaultProgressHandler
54 | : public ProgressHandler {
55 |
56 |
57 | virtual bool Update(float /*percentage*/) {
58 | return false;
59 | }
60 |
61 |
62 | }; // !class DefaultProgressHandler
63 | } // Namespace Assimp
64 |
65 | #endif
66 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assimp/assimp/Defines.h:
--------------------------------------------------------------------------------
1 | /*
2 | Open Asset Import Library (assimp)
3 | ----------------------------------------------------------------------
4 |
5 | Copyright (c) 2006-2012, assimp team
6 | All rights reserved.
7 |
8 | Redistribution and use of this software in source and binary forms,
9 | with or without modification, are permitted provided that the
10 | following conditions are met:
11 |
12 | * Redistributions of source code must retain the above
13 | copyright notice, this list of conditions and the
14 | following disclaimer.
15 |
16 | * Redistributions in binary form must reproduce the above
17 | copyright notice, this list of conditions and the
18 | following disclaimer in the documentation and/or other
19 | materials provided with the distribution.
20 |
21 | * Neither the name of the assimp team, nor the names of its
22 | contributors may be used to endorse or promote products
23 | derived from this software without specific prior
24 | written permission of the assimp team.
25 |
26 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
27 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
29 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
30 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
31 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
32 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
33 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
34 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
35 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
36 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 |
38 | ----------------------------------------------------------------------
39 | */
40 |
41 | // We need those constants, workaround for any platforms where nobody defined them yet
42 | #if (!defined SIZE_MAX)
43 | # define SIZE_MAX (~((size_t)0))
44 | #endif
45 |
46 | #if (!defined UINT_MAX)
47 | # define UINT_MAX (~((unsigned int)0))
48 | #endif
49 |
50 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assimp/assimp/FBXCompileConfig.h:
--------------------------------------------------------------------------------
1 | /*
2 | Open Asset Import Library (assimp)
3 | ----------------------------------------------------------------------
4 |
5 | Copyright (c) 2006-2016, assimp team
6 | All rights reserved.
7 |
8 | Redistribution and use of this software in source and binary forms,
9 | with or without modification, are permitted provided that the
10 | following conditions are met:
11 |
12 | * Redistributions of source code must retain the above
13 | copyright notice, this list of conditions and the
14 | following disclaimer.
15 |
16 | * Redistributions in binary form must reproduce the above
17 | copyright notice, this list of conditions and the
18 | following disclaimer in the documentation and/or other
19 | materials provided with the distribution.
20 |
21 | * Neither the name of the assimp team, nor the names of its
22 | contributors may be used to endorse or promote products
23 | derived from this software without specific prior
24 | written permission of the assimp team.
25 |
26 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
27 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
29 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
30 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
31 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
32 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
33 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
34 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
35 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
36 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 |
38 | ----------------------------------------------------------------------
39 | */
40 |
41 | /** @file FBXCompileConfig.h
42 | * @brief FBX importer compile-time switches
43 | */
44 | #ifndef INCLUDED_AI_FBX_COMPILECONFIG_H
45 | #define INCLUDED_AI_FBX_COMPILECONFIG_H
46 |
47 | //
48 | #if _MSC_VER > 1500 || (defined __GNUC___)
49 | # define ASSIMP_FBX_USE_UNORDERED_MULTIMAP
50 | # else
51 | # define fbx_unordered_map map
52 | # define fbx_unordered_multimap multimap
53 | #endif
54 |
55 | #ifdef ASSIMP_FBX_USE_UNORDERED_MULTIMAP
56 | # include
57 | # if _MSC_VER > 1600
58 | # define fbx_unordered_map unordered_map
59 | # define fbx_unordered_multimap unordered_multimap
60 | # else
61 | # define fbx_unordered_map tr1::unordered_map
62 | # define fbx_unordered_multimap tr1::unordered_multimap
63 | # endif
64 | #endif
65 |
66 | #endif
67 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assimp/assimp/FBXConverter.h:
--------------------------------------------------------------------------------
1 | /*
2 | Open Asset Import Library (assimp)
3 | ----------------------------------------------------------------------
4 |
5 | Copyright (c) 2006-2016, assimp team
6 | All rights reserved.
7 |
8 | Redistribution and use of this software in source and binary forms,
9 | with or without modification, are permitted provided that the
10 | following conditions are met:
11 |
12 | * Redistributions of source code must retain the above
13 | copyright notice, this list of conditions and the
14 | following disclaimer.
15 |
16 | * Redistributions in binary form must reproduce the above
17 | copyright notice, this list of conditions and the
18 | following disclaimer in the documentation and/or other
19 | materials provided with the distribution.
20 |
21 | * Neither the name of the assimp team, nor the names of its
22 | contributors may be used to endorse or promote products
23 | derived from this software without specific prior
24 | written permission of the assimp team.
25 |
26 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
27 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
29 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
30 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
31 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
32 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
33 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
34 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
35 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
36 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 |
38 | ----------------------------------------------------------------------
39 | */
40 |
41 | /** @file FBXDConverter.h
42 | * @brief FBX DOM to aiScene conversion
43 | */
44 | #ifndef INCLUDED_AI_FBX_CONVERTER_H
45 | #define INCLUDED_AI_FBX_CONVERTER_H
46 |
47 | struct aiScene;
48 |
49 | namespace Assimp {
50 | namespace FBX {
51 |
52 | class Document;
53 |
54 | /**
55 | * Convert a FBX #Document to #aiScene
56 | * @param out Empty scene to be populated
57 | * @param doc Parsed FBX document
58 | */
59 | void ConvertToAssimpScene(aiScene* out, const Document& doc);
60 |
61 | }
62 | }
63 |
64 | #endif // INCLUDED_AI_FBX_CONVERTER_H
65 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assimp/assimp/FileLogStream.h:
--------------------------------------------------------------------------------
1 | #ifndef ASSIMP_FILELOGSTREAM_H_INC
2 | #define ASSIMP_FILELOGSTREAM_H_INC
3 |
4 | #include
5 | #include
6 | #include "DefaultIOSystem.h"
7 |
8 | namespace Assimp {
9 |
10 | // ----------------------------------------------------------------------------------
11 | /** @class FileLogStream
12 | * @brief Logstream to write into a file.
13 | */
14 | class FileLogStream :
15 | public LogStream
16 | {
17 | public:
18 | FileLogStream( const char* file, IOSystem* io = NULL );
19 | ~FileLogStream();
20 | void write( const char* message );
21 |
22 | private:
23 | IOStream *m_pStream;
24 | };
25 |
26 | // ----------------------------------------------------------------------------------
27 | // Constructor
28 | inline FileLogStream::FileLogStream( const char* file, IOSystem* io ) :
29 | m_pStream(NULL)
30 | {
31 | if ( !file || 0 == *file )
32 | return;
33 |
34 | // If no IOSystem is specified: take a default one
35 | if (!io)
36 | {
37 | DefaultIOSystem FileSystem;
38 | m_pStream = FileSystem.Open( file, "wt");
39 | }
40 | else m_pStream = io->Open( file, "wt" );
41 | }
42 |
43 | // ----------------------------------------------------------------------------------
44 | // Destructor
45 | inline FileLogStream::~FileLogStream()
46 | {
47 | // The virtual d'tor should destroy the underlying file
48 | delete m_pStream;
49 | }
50 |
51 | // ----------------------------------------------------------------------------------
52 | // Write method
53 | inline void FileLogStream::write( const char* message )
54 | {
55 | if (m_pStream != NULL)
56 | {
57 | m_pStream->Write(message, sizeof(char), ::strlen(message));
58 | m_pStream->Flush();
59 | }
60 | }
61 |
62 | // ----------------------------------------------------------------------------------
63 | } // !Namespace Assimp
64 |
65 | #endif // !! ASSIMP_FILELOGSTREAM_H_INC
66 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assimp/assimp/IFCBoolean.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lighthouse3d/AndroidGL/7e749e05894d9d443179f00ca796a50c015c4131/OpenGLNDK/app/src/main/assimp/assimp/IFCBoolean.cpp
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assimp/assimp/Macros.h:
--------------------------------------------------------------------------------
1 | /*
2 | ---------------------------------------------------------------------------
3 | Open Asset Import Library (assimp)
4 | ---------------------------------------------------------------------------
5 |
6 | Copyright (c) 2006-2012, assimp team
7 |
8 | All rights reserved.
9 |
10 | Redistribution and use of this software in source and binary forms,
11 | with or without modification, are permitted provided that the following
12 | conditions are met:
13 |
14 | * Redistributions of source code must retain the above
15 | copyright notice, this list of conditions and the
16 | following disclaimer.
17 |
18 | * Redistributions in binary form must reproduce the above
19 | copyright notice, this list of conditions and the
20 | following disclaimer in the documentation and/or other
21 | materials provided with the distribution.
22 |
23 | * Neither the name of the assimp team, nor the names of its
24 | contributors may be used to endorse or promote products
25 | derived from this software without specific prior
26 | written permission of the assimp team.
27 |
28 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
31 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
32 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
33 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
34 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
35 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
36 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
38 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39 | ---------------------------------------------------------------------------
40 | */
41 |
42 | /* Helper macro to set a pointer to NULL in debug builds
43 | */
44 | #if (defined ASSIMP_BUILD_DEBUG)
45 | # define AI_DEBUG_INVALIDATE_PTR(x) x = NULL;
46 | #else
47 | # define AI_DEBUG_INVALIDATE_PTR(x)
48 | #endif
49 |
50 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assimp/assimp/OpenGEXExporter.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | Open Asset Import Library (assimp)
3 | ----------------------------------------------------------------------
4 |
5 | Copyright (c) 2006-2016, assimp team
6 | All rights reserved.
7 |
8 | Redistribution and use of this software in source and binary forms,
9 | with or without modification, are permitted provided that the
10 | following conditions are met:
11 |
12 | * Redistributions of source code must retain the above
13 | copyright notice, this list of conditions and the
14 | following disclaimer.
15 |
16 | * Redistributions in binary form must reproduce the above
17 | copyright notice, this list of conditions and the
18 | following disclaimer in the documentation and/or other
19 | materials provided with the distribution.
20 |
21 | * Neither the name of the assimp team, nor the names of its
22 | contributors may be used to endorse or promote products
23 | derived from this software without specific prior
24 | written permission of the assimp team.
25 |
26 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
27 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
29 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
30 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
31 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
32 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
33 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
34 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
35 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
36 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 |
38 | ----------------------------------------------------------------------
39 | */
40 | #include "OpenGEXExporter.h"
41 |
42 | namespace Assimp {
43 | namespace OpenGEX {
44 |
45 | #ifndef ASSIMP_BUILD_NO_OPENGEX_EXPORTER
46 |
47 | OpenGEXExporter::OpenGEXExporter() {
48 | }
49 |
50 | OpenGEXExporter::~OpenGEXExporter() {
51 | }
52 |
53 | #endif // ASSIMP_BUILD_NO_OPENGEX_EXPORTER
54 |
55 | } // Namespace OpenGEX
56 | } // Namespace Assimp
57 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assimp/assimp/OpenGEXExporter.h:
--------------------------------------------------------------------------------
1 | /*
2 | Open Asset Import Library (assimp)
3 | ----------------------------------------------------------------------
4 |
5 | Copyright (c) 2006-2016, assimp team
6 | All rights reserved.
7 |
8 | Redistribution and use of this software in source and binary forms,
9 | with or without modification, are permitted provided that the
10 | following conditions are met:
11 |
12 | * Redistributions of source code must retain the above
13 | copyright notice, this list of conditions and the
14 | following disclaimer.
15 |
16 | * Redistributions in binary form must reproduce the above
17 | copyright notice, this list of conditions and the
18 | following disclaimer in the documentation and/or other
19 | materials provided with the distribution.
20 |
21 | * Neither the name of the assimp team, nor the names of its
22 | contributors may be used to endorse or promote products
23 | derived from this software without specific prior
24 | written permission of the assimp team.
25 |
26 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
27 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
29 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
30 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
31 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
32 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
33 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
34 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
35 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
36 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 |
38 | ----------------------------------------------------------------------
39 | */
40 | #ifndef AI_OPENGEX_EXPORTER_H
41 | #define AI_OPENGEX_EXPORTER_H
42 |
43 | #include
44 |
45 | #ifndef ASSIMP_BUILD_NO_OPENGEX_EXPORTER
46 |
47 | namespace Assimp {
48 |
49 | struct aiScene;
50 |
51 | namespace OpenGEX {
52 |
53 | class OpenGEXExporter {
54 | public:
55 | OpenGEXExporter();
56 | ~OpenGEXExporter();
57 | bool exportScene( const char *filename, const aiScene* pScene );
58 | };
59 |
60 | } // Namespace OpenGEX
61 | } // Namespace Assimp
62 |
63 | #endif // ASSIMP_BUILD_NO_OPENGEX_EXPORTER
64 |
65 | #endif // AI_OPENGEX_EXPORTER_H
66 |
67 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assimp/assimp/STEPFileEncoding.h:
--------------------------------------------------------------------------------
1 | /*
2 | Open Asset Import Library (assimp)
3 | ----------------------------------------------------------------------
4 |
5 | Copyright (c) 2006-2016, assimp team
6 | All rights reserved.
7 |
8 | Redistribution and use of this software in source and binary forms,
9 | with or without modification, are permitted provided that the
10 | following conditions are met:
11 |
12 | * Redistributions of source code must retain the above
13 | copyright notice, this list of conditions and the
14 | following disclaimer.
15 |
16 | * Redistributions in binary form must reproduce the above
17 | copyright notice, this list of conditions and the
18 | following disclaimer in the documentation and/or other
19 | materials provided with the distribution.
20 |
21 | * Neither the name of the assimp team, nor the names of its
22 | contributors may be used to endorse or promote products
23 | derived from this software without specific prior
24 | written permission of the assimp team.
25 |
26 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
27 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
29 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
30 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
31 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
32 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
33 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
34 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
35 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
36 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 |
38 | ----------------------------------------------------------------------
39 | */
40 |
41 | #ifndef INCLUDED_AI_STEPFILEENCODING_H
42 | #define INCLUDED_AI_STEPFILEENCODING_H
43 |
44 | #include
45 |
46 | namespace Assimp {
47 | namespace STEP {
48 |
49 |
50 | // --------------------------------------------------------------------------
51 | // Convert an ASCII STEP identifier with possibly escaped character
52 | // sequences using foreign encodings to plain UTF8.
53 | //
54 | // Return false if an error occurs, s may or may not be modified in
55 | // this case and could still contain escape sequences (even partly
56 | // escaped ones).
57 | bool StringToUTF8(std::string& s);
58 |
59 |
60 | } // ! STEP
61 | } // ! Assimp
62 |
63 | #endif
64 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assimp/assimp/Win32DebugLogStream.h:
--------------------------------------------------------------------------------
1 | #ifndef AI_WIN32DEBUGLOGSTREAM_H_INC
2 | #define AI_WIN32DEBUGLOGSTREAM_H_INC
3 |
4 | #ifdef WIN32
5 |
6 | #include
7 | #include "windows.h"
8 |
9 | namespace Assimp {
10 |
11 | // ---------------------------------------------------------------------------
12 | /** @class Win32DebugLogStream
13 | * @brief Logs into the debug stream from win32.
14 | */
15 | class Win32DebugLogStream :
16 | public LogStream
17 | {
18 | public:
19 | /** @brief Default constructor */
20 | Win32DebugLogStream();
21 |
22 | /** @brief Destructor */
23 | ~Win32DebugLogStream();
24 |
25 | /** @brief Writer */
26 | void write(const char* messgae);
27 | };
28 |
29 | // ---------------------------------------------------------------------------
30 | // Default constructor
31 | inline Win32DebugLogStream::Win32DebugLogStream()
32 | {}
33 |
34 | // ---------------------------------------------------------------------------
35 | // Default constructor
36 | inline Win32DebugLogStream::~Win32DebugLogStream()
37 | {}
38 |
39 | // ---------------------------------------------------------------------------
40 | // Write method
41 | inline void Win32DebugLogStream::write(const char* message)
42 | {
43 | OutputDebugStringA( message);
44 | }
45 |
46 | // ---------------------------------------------------------------------------
47 | } // Namespace Assimp
48 |
49 | #endif // ! WIN32
50 | #endif // guard
51 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assimp/assimp/a.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lighthouse3d/AndroidGL/7e749e05894d9d443179f00ca796a50c015c4131/OpenGLNDK/app/src/main/assimp/assimp/a.txt
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assimp/assimp/ai_assert.h:
--------------------------------------------------------------------------------
1 | /*
2 | ---------------------------------------------------------------------------
3 | Open Asset Import Library (assimp)
4 | ---------------------------------------------------------------------------
5 |
6 | Copyright (c) 2006-2016, assimp team
7 |
8 | All rights reserved.
9 |
10 | Redistribution and use of this software in source and binary forms,
11 | with or without modification, are permitted provided that the following
12 | conditions are met:
13 |
14 | * Redistributions of source code must retain the above
15 | copyright notice, this list of conditions and the
16 | following disclaimer.
17 |
18 | * Redistributions in binary form must reproduce the above
19 | copyright notice, this list of conditions and the
20 | following disclaimer in the documentation and/or other
21 | materials provided with the distribution.
22 |
23 | * Neither the name of the assimp team, nor the names of its
24 | contributors may be used to endorse or promote products
25 | derived from this software without specific prior
26 | written permission of the assimp team.
27 |
28 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
31 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
32 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
33 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
34 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
35 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
36 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
38 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39 | ---------------------------------------------------------------------------
40 | */
41 | #ifndef AI_DEBUG_H_INC
42 | #define AI_DEBUG_H_INC
43 |
44 | #ifdef ASSIMP_BUILD_DEBUG
45 | # include
46 | # define ai_assert(expression) assert(expression)
47 | #else
48 | # define ai_assert(expression)
49 | #endif
50 |
51 |
52 | #endif
53 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assimp/assimp/assimp/.editorconfig:
--------------------------------------------------------------------------------
1 | # See for details
2 |
3 | [*.{h,hpp,inl}]
4 | end_of_line = lf
5 | insert_final_newline = true
6 | trim_trailing_whitespace = true
7 | indent_size = 4
8 | indent_style = space
9 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assimp/assimp/assimp/Compiler/poppack1.h:
--------------------------------------------------------------------------------
1 |
2 | // ===============================================================================
3 | // May be included multiple times - resets structure packing to the defaults
4 | // for all supported compilers. Reverts the changes made by #include
5 | //
6 | // Currently this works on the following compilers:
7 | // MSVC 7,8,9
8 | // GCC
9 | // BORLAND (complains about 'pack state changed but not reverted', but works)
10 | // ===============================================================================
11 |
12 | #ifndef AI_PUSHPACK_IS_DEFINED
13 | # error pushpack1.h must be included after poppack1.h
14 | #endif
15 |
16 | // reset packing to the original value
17 | #if defined(_MSC_VER) || defined(__BORLANDC__) || defined (__BCPLUSPLUS__)
18 | # pragma pack( pop )
19 | #endif
20 | #undef PACK_STRUCT
21 |
22 | #undef AI_PUSHPACK_IS_DEFINED
23 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assimp/assimp/assimp/Compiler/pushpack1.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | // ===============================================================================
4 | // May be included multiple times - sets structure packing to 1
5 | // for all supported compilers. #include reverts the changes.
6 | //
7 | // Currently this works on the following compilers:
8 | // MSVC 7,8,9
9 | // GCC
10 | // BORLAND (complains about 'pack state changed but not reverted', but works)
11 | // Clang
12 | //
13 | //
14 | // USAGE:
15 | //
16 | // struct StructToBePacked {
17 | // } PACK_STRUCT;
18 | //
19 | // ===============================================================================
20 |
21 | #ifdef AI_PUSHPACK_IS_DEFINED
22 | # error poppack1.h must be included after pushpack1.h
23 | #endif
24 |
25 | #if defined(_MSC_VER) || defined(__BORLANDC__) || defined (__BCPLUSPLUS__)
26 | # pragma pack(push,1)
27 | # define PACK_STRUCT
28 | #elif defined( __GNUC__ )
29 | # if !defined(HOST_MINGW)
30 | # define PACK_STRUCT __attribute__((__packed__))
31 | # else
32 | # define PACK_STRUCT __attribute__((gcc_struct, __packed__))
33 | # endif
34 | #else
35 | # error Compiler not supported
36 | #endif
37 |
38 | #if defined(_MSC_VER)
39 |
40 | // C4103: Packing was changed after the inclusion of the header, probably missing #pragma pop
41 | # pragma warning (disable : 4103)
42 | #endif
43 |
44 | #define AI_PUSHPACK_IS_DEFINED
45 |
46 |
47 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assimp/assimp/assimp/ai_assert.h:
--------------------------------------------------------------------------------
1 | /*
2 | ---------------------------------------------------------------------------
3 | Open Asset Import Library (assimp)
4 | ---------------------------------------------------------------------------
5 |
6 | Copyright (c) 2006-2016, assimp team
7 |
8 | All rights reserved.
9 |
10 | Redistribution and use of this software in source and binary forms,
11 | with or without modification, are permitted provided that the following
12 | conditions are met:
13 |
14 | * Redistributions of source code must retain the above
15 | copyright notice, this list of conditions and the
16 | following disclaimer.
17 |
18 | * Redistributions in binary form must reproduce the above
19 | copyright notice, this list of conditions and the
20 | following disclaimer in the documentation and/or other
21 | materials provided with the distribution.
22 |
23 | * Neither the name of the assimp team, nor the names of its
24 | contributors may be used to endorse or promote products
25 | derived from this software without specific prior
26 | written permission of the assimp team.
27 |
28 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
31 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
32 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
33 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
34 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
35 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
36 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
38 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39 | ---------------------------------------------------------------------------
40 | */
41 | #ifndef AI_DEBUG_H_INC
42 | #define AI_DEBUG_H_INC
43 |
44 | #ifdef ASSIMP_BUILD_DEBUG
45 | # include
46 | # define ai_assert(expression) assert(expression)
47 | #else
48 | # define ai_assert(expression)
49 | #endif
50 |
51 |
52 | #endif
53 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assimp/assimp/revision.h:
--------------------------------------------------------------------------------
1 | #ifndef ASSIMP_REVISION_H_INC
2 | #define ASSIMP_REVISION_H_INC
3 |
4 | #define GitVersion 0x0
5 | #define GitBranch ""
6 |
7 | #endif // ASSIMP_REVISION_H_INC
8 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assimp/contrib/ConvertUTF/readme.txt:
--------------------------------------------------------------------------------
1 |
2 | The accompanying C source code file "ConvertUTF.c" and the associated header
3 | file "ConvertUTF.h" provide for conversion between various transformation
4 | formats of Unicode characters. The following conversions are supported:
5 |
6 | UTF-32 to UTF-16
7 | UTF-32 to UTF-8
8 | UTF-16 to UTF-32
9 | UTF-16 to UTF-8
10 | UTF-8 to UTF-16
11 | UTF-8 to UTF-32
12 |
13 | In addition, there is a test harness which runs various tests.
14 |
15 | The files "CVTUTF7.C" and "CVTUTF7.H" are for archival and historical purposes
16 | only. They have not been updated to Unicode 3.0 or later and should be
17 | considered obsolescent. "CVTUTF7.C" contains two functions that can convert
18 | between UCS2 (i.e., the BMP characters only) and UTF-7. Surrogates are
19 | not supported, the code has not been tested, and should be considered
20 | unsuitable for general purpose use.
21 |
22 | Please submit any bug reports about these programs here:
23 |
24 | http://www.unicode.org/unicode/reporting.html
25 |
26 | Version 1.0: initial version.
27 |
28 | Version 1.1: corrected some minor problems; added stricter checks.
29 |
30 | Version 1.2: corrected switch statements associated with "extraBytesToRead"
31 | in 4 & 5 byte cases, in functions for conversion from UTF8.
32 | Note: formally, the 4 & 5 byte cases are illegal in the latest
33 | UTF8, but the table and this code has always catered for those,
34 | cases since at one time they were legal.
35 |
36 | Version 1.3: Updated UTF-8 legality check;
37 | updated to use UNI_MAX_LEGAL_UTF32 in UTF-32 conversions
38 | Updated UTF-8 legality tests in harness.c
39 |
40 |
41 | Last update: October 19, 2004
42 |
43 |
44 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assimp/contrib/clipper/License.txt:
--------------------------------------------------------------------------------
1 | The Clipper code library, the "Software" (that includes Delphi, C++ & C#
2 | source code, accompanying samples and documentation), has been released
3 | under the following license, terms and conditions:
4 |
5 | Boost Software License - Version 1.0 - August 17th, 2003
6 | http://www.boost.org/LICENSE_1_0.txt
7 |
8 | Permission is hereby granted, free of charge, to any person or organization
9 | obtaining a copy of the software and accompanying documentation covered by
10 | this license (the "Software") to use, reproduce, display, distribute,
11 | execute, and transmit the Software, and to prepare derivative works of the
12 | Software, and to permit third-parties to whom the Software is furnished to
13 | do so, all subject to the following:
14 |
15 | The copyright notices in the Software and this entire statement, including
16 | the above license grant, this restriction and the following disclaimer,
17 | must be included in all copies of the Software, in whole or in part, and
18 | all derivative works of the Software, unless such copies or derivative
19 | works are solely in the form of machine-executable object code generated by
20 | a source language processor.
21 |
22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24 | FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
25 | SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
26 | FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
27 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
28 | DEALINGS IN THE SOFTWARE.
29 |
30 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assimp/contrib/irrXML/heapsort.h:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt
2 | // This file is part of the "Irrlicht Engine".
3 | // For conditions of distribution and use, see copyright notice in irrlicht.h
4 |
5 | #ifndef __IRR_HEAPSORT_H_INCLUDED__
6 | #define __IRR_HEAPSORT_H_INCLUDED__
7 |
8 | #include "irrTypes.h"
9 |
10 | namespace irr
11 | {
12 | namespace core
13 | {
14 |
15 | //! Sinks an element into the heap.
16 | template
17 | inline void heapsink(T*array, s32 element, s32 max)
18 | {
19 | while ((element<<1) < max) // there is a left child
20 | {
21 | s32 j = (element<<1);
22 |
23 | if (j+1 < max && array[j] < array[j+1])
24 | j = j+1; // take right child
25 |
26 | if (array[element] < array[j])
27 | {
28 | T t = array[j]; // swap elements
29 | array[j] = array[element];
30 | array[element] = t;
31 | element = j;
32 | }
33 | else
34 | return;
35 | }
36 | }
37 |
38 |
39 | //! Sorts an array with size 'size' using heapsort.
40 | template
41 | inline void heapsort(T* array_, s32 size)
42 | {
43 | // for heapsink we pretent this is not c++, where
44 | // arrays start with index 0. So we decrease the array pointer,
45 | // the maximum always +2 and the element always +1
46 |
47 | T* virtualArray = array_ - 1;
48 | s32 virtualSize = size + 2;
49 | s32 i;
50 |
51 | // build heap
52 |
53 | for (i=((size-1)/2); i>=0; --i)
54 | heapsink(virtualArray, i+1, virtualSize-1);
55 |
56 | // sort array
57 |
58 | for (i=size-1; i>=0; --i)
59 | {
60 | T t = array_[0];
61 | array_[0] = array_[i];
62 | array_[i] = t;
63 | heapsink(virtualArray, 1, i + 1);
64 | }
65 | }
66 |
67 | } // end namespace core
68 | } // end namespace irr
69 |
70 |
71 |
72 | #endif
73 |
74 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assimp/contrib/irrXML/irrString.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lighthouse3d/AndroidGL/7e749e05894d9d443179f00ca796a50c015c4131/OpenGLNDK/app/src/main/assimp/contrib/irrXML/irrString.h
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assimp/contrib/irrXML_note.txt:
--------------------------------------------------------------------------------
1 |
2 | IrrXML
3 | Downloaded September 2008
4 |
5 | - fixed a minor compiler warning (vs 2005, shift too large)
6 | - fixed an issue regarding wchar_t/unsigned short
7 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assimp/contrib/openddlparser/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | CMAKE_MINIMUM_REQUIRED( VERSION 2.6 )
2 | PROJECT( OpenDDL-Parser )
3 | SET ( OPENDDL_PARSER_VERSION_MAJOR 0 )
4 | SET ( OPENDDL_PARSER_VERSION_MINOR 1 )
5 | SET ( OPENDDL_PARSER_VERSION_PATCH 0 )
6 | SET ( OPENDDL_PARSER_VERSION ${CPPCORE_VERSION_MAJOR}.${CPPCORE_VERSION_MINOR}.${CPPCORE_VERSION_PATCH} )
7 | SET ( PROJECT_VERSION "${OPENDDL_PARSER_VERSION}" )
8 |
9 | if( CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX )
10 | find_package(Threads)
11 | else()
12 | add_definitions( -D_CRT_SECURE_NO_WARNINGS )
13 | endif()
14 |
15 | add_definitions( -DOPENDDLPARSER_BUILD )
16 | add_definitions( -DOPENDDL_NO_USE_CPP11 )
17 | add_definitions( -D_VARIADIC_MAX=10 )
18 |
19 | INCLUDE_DIRECTORIES(
20 | ./
21 | include/
22 | contrib/gtest-1.7.0/include
23 | contrib/gtest-1.7.0/
24 | )
25 |
26 | link_directories(
27 | ./
28 | )
29 |
30 | SET( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_HOME_DIRECTORY}/lib )
31 | SET( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_HOME_DIRECTORY}/lib )
32 | SET( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_HOME_DIRECTORY}/bin )
33 |
34 | if( WIN32 AND NOT CYGWIN )
35 | set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc" ) # Force to always compile with W4
36 | if( CMAKE_CXX_FLAGS MATCHES "/W[0-4]" )
37 | string( REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" )
38 | else()
39 | set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4" )
40 | endif()
41 | elseif( CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX )
42 | # Update if necessary
43 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-long-long -pedantic -std=c++0x")
44 | elseif ( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" )
45 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-long-long -pedantic -std=c++11")
46 | endif()
47 |
48 | SET ( openddl_parser_src
49 | code/OpenDDLParser.cpp
50 | code/DDLNode.cpp
51 | code/Value.cpp
52 | include/openddlparser/OpenDDLParser.h
53 | include/openddlparser/OpenDDLParserUtils.h
54 | include/openddlparser/OpenDDLCommon.h
55 | include/openddlparser/DDLNode.h
56 | include/openddlparser/Value.h
57 | README.md
58 | )
59 |
60 | SOURCE_GROUP( code FILES ${openddl_parser_src} )
61 |
62 | ADD_LIBRARY( openddl_parser SHARED
63 | ${openddl_parser_src}
64 | )
65 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assimp/contrib/openddlparser/CREDITS:
--------------------------------------------------------------------------------
1 | ===============================================================
2 | OpenDDL-Parser
3 | Developers and Contributors
4 | ===============================================================
5 |
6 | - Kim Kulling ( kimmi ):
7 | Founder
8 |
9 | - Fredrik Hansson ( FredrikHson ):
10 | Improvements value interface, serveral bugfixes.
11 |
12 | - Henry Read ( henrya2 ):
13 | Static build option, Interface improvements
14 |
15 | - Paul Holland ( pkholland ):
16 | Bugfixes.
17 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assimp/contrib/openddlparser/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2014 Kim Kulling
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
23 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assimp/contrib/openddlparser/code/a.txt:
--------------------------------------------------------------------------------
1 | src/main/contrib/opengglparser/DDLNode.cpp
2 | src/main/contrib/opengglparser/OpenDDLCommon.cpp
3 | src/main/contrib/opengglparser/OpenDDLExport.cpp
4 | src/main/contrib/opengglparser/OpenDDLParser.cpp
5 | src/main/contrib/opengglparser/Value.cpp
6 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assimp/contrib/poly2tri/AUTHORS:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lighthouse3d/AndroidGL/7e749e05894d9d443179f00ca796a50c015c4131/OpenGLNDK/app/src/main/assimp/contrib/poly2tri/AUTHORS
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assimp/contrib/poly2tri/LICENSE:
--------------------------------------------------------------------------------
1 | Poly2Tri Copyright (c) 2009-2010, Poly2Tri Contributors
2 | http://code.google.com/p/poly2tri/
3 |
4 | All rights reserved.
5 | Redistribution and use in source and binary forms, with or without modification,
6 | are permitted provided that the following conditions are met:
7 |
8 | * Redistributions of source code must retain the above copyright notice,
9 | this list of conditions and the following disclaimer.
10 | * Redistributions in binary form must reproduce the above copyright notice,
11 | this list of conditions and the following disclaimer in the documentation
12 | and/or other materials provided with the distribution.
13 | * Neither the name of Poly2Tri nor the names of its contributors may be
14 | used to endorse or promote products derived from this software without specific
15 | prior written permission.
16 |
17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
21 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
22 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
23 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
24 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assimp/contrib/poly2tri/README:
--------------------------------------------------------------------------------
1 | ==================
2 | INSTALLATION GUIDE
3 | ==================
4 |
5 | ------------
6 | Dependencies
7 | ------------
8 |
9 | Core poly2tri lib:
10 | - Standard Template Library (STL)
11 |
12 | Testbed:
13 | - gcc
14 | - OpenGL
15 | - GLFW (http://glfw.sf.net)
16 | - Python
17 |
18 | Waf (http://code.google.com/p/waf/) is used to compile the testbed.
19 | A waf script (86kb) is included in the repositoty.
20 |
21 | ----------------------------------------------
22 | Building the Testbed
23 | ----------------------------------------------
24 |
25 | Posix/MSYS environment:
26 |
27 | ./waf configure
28 | ./waf build
29 |
30 | Windows command line:
31 |
32 | python waf configure
33 | python waf build
34 |
35 | ----------------------------------------------
36 | Running the Examples
37 | ----------------------------------------------
38 |
39 | Load data points from a file:
40 | p2t
41 |
42 | Random distribution of points inside a consrained box:
43 | p2t random
44 |
45 | Examples:
46 |
47 | ./p2t dude.dat 300 500 2
48 | ./p2t nazca_monkey.dat 0 0 9
49 |
50 | ./p2t random 10 100 5.0
51 | ./p2t random 1000 20000 0.025
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assimp/contrib/poly2tri/poly2tri/poly2tri.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Poly2Tri Copyright (c) 2009-2010, Poly2Tri Contributors
3 | * http://code.google.com/p/poly2tri/
4 | *
5 | * All rights reserved.
6 | *
7 | * Redistribution and use in source and binary forms, with or without modification,
8 | * are permitted provided that the following conditions are met:
9 | *
10 | * * Redistributions of source code must retain the above copyright notice,
11 | * this list of conditions and the following disclaimer.
12 | * * Redistributions in binary form must reproduce the above copyright notice,
13 | * this list of conditions and the following disclaimer in the documentation
14 | * and/or other materials provided with the distribution.
15 | * * Neither the name of Poly2Tri nor the names of its contributors may be
16 | * used to endorse or promote products derived from this software without specific
17 | * prior written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
23 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
26 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
27 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | #ifndef POLY2TRI_H
33 | #define POLY2TRI_H
34 |
35 | #include "common/shapes.h"
36 | #include "sweep/cdt.h"
37 |
38 | #endif
39 |
40 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assimp/contrib/poly2tri/poly2tri/sweep/cdt.cc:
--------------------------------------------------------------------------------
1 | /*
2 | * Poly2Tri Copyright (c) 2009-2010, Poly2Tri Contributors
3 | * http://code.google.com/p/poly2tri/
4 | *
5 | * All rights reserved.
6 | *
7 | * Redistribution and use in source and binary forms, with or without modification,
8 | * are permitted provided that the following conditions are met:
9 | *
10 | * * Redistributions of source code must retain the above copyright notice,
11 | * this list of conditions and the following disclaimer.
12 | * * Redistributions in binary form must reproduce the above copyright notice,
13 | * this list of conditions and the following disclaimer in the documentation
14 | * and/or other materials provided with the distribution.
15 | * * Neither the name of Poly2Tri nor the names of its contributors may be
16 | * used to endorse or promote products derived from this software without specific
17 | * prior written permission.
18 | *
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
23 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
26 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
27 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 | #include "cdt.h"
32 |
33 | namespace p2t {
34 |
35 | CDT::CDT(std::vector polyline)
36 | {
37 | sweep_context_ = new SweepContext(polyline);
38 | sweep_ = new Sweep;
39 | }
40 |
41 | void CDT::AddHole(std::vector polyline)
42 | {
43 | sweep_context_->AddHole(polyline);
44 | }
45 |
46 | void CDT::AddPoint(Point* point) {
47 | sweep_context_->AddPoint(point);
48 | }
49 |
50 | void CDT::Triangulate()
51 | {
52 | sweep_->Triangulate(*sweep_context_);
53 | }
54 |
55 | std::vector CDT::GetTriangles()
56 | {
57 | return sweep_context_->GetTriangles();
58 | }
59 |
60 | std::list CDT::GetMap()
61 | {
62 | return sweep_context_->GetMap();
63 | }
64 |
65 | CDT::~CDT()
66 | {
67 | delete sweep_context_;
68 | delete sweep_;
69 | }
70 |
71 | }
72 |
73 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assimp/contrib/poly2tri/poly2tri/sweep/sweep.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lighthouse3d/AndroidGL/7e749e05894d9d443179f00ca796a50c015c4131/OpenGLNDK/app/src/main/assimp/contrib/poly2tri/poly2tri/sweep/sweep.h
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assimp/contrib/rapidjson/include/rapidjson/internal/strfunc.h:
--------------------------------------------------------------------------------
1 | // Tencent is pleased to support the open source community by making RapidJSON available.
2 | //
3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
4 | //
5 | // Licensed under the MIT License (the "License"); you may not use this file except
6 | // in compliance with the License. You may obtain a copy of the License at
7 | //
8 | // http://opensource.org/licenses/MIT
9 | //
10 | // Unless required by applicable law or agreed to in writing, software distributed
11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the
13 | // specific language governing permissions and limitations under the License.
14 |
15 | #ifndef RAPIDJSON_INTERNAL_STRFUNC_H_
16 | #define RAPIDJSON_INTERNAL_STRFUNC_H_
17 |
18 | #include "../rapidjson.h"
19 |
20 | RAPIDJSON_NAMESPACE_BEGIN
21 | namespace internal {
22 |
23 | //! Custom strlen() which works on different character types.
24 | /*! \tparam Ch Character type (e.g. char, wchar_t, short)
25 | \param s Null-terminated input string.
26 | \return Number of characters in the string.
27 | \note This has the same semantics as strlen(), the return value is not number of Unicode codepoints.
28 | */
29 | template
30 | inline SizeType StrLen(const Ch* s) {
31 | const Ch* p = s;
32 | while (*p) ++p;
33 | return SizeType(p - s);
34 | }
35 |
36 | } // namespace internal
37 | RAPIDJSON_NAMESPACE_END
38 |
39 | #endif // RAPIDJSON_INTERNAL_STRFUNC_H_
40 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assimp/contrib/rapidjson/include/rapidjson/internal/swap.h:
--------------------------------------------------------------------------------
1 | // Tencent is pleased to support the open source community by making RapidJSON available.
2 | //
3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
4 | //
5 | // Licensed under the MIT License (the "License"); you may not use this file except
6 | // in compliance with the License. You may obtain a copy of the License at
7 | //
8 | // http://opensource.org/licenses/MIT
9 | //
10 | // Unless required by applicable law or agreed to in writing, software distributed
11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the
13 | // specific language governing permissions and limitations under the License.
14 |
15 | #ifndef RAPIDJSON_INTERNAL_SWAP_H_
16 | #define RAPIDJSON_INTERNAL_SWAP_H_
17 |
18 | #include "../rapidjson.h"
19 |
20 | RAPIDJSON_NAMESPACE_BEGIN
21 | namespace internal {
22 |
23 | //! Custom swap() to avoid dependency on C++ header
24 | /*! \tparam T Type of the arguments to swap, should be instantiated with primitive C++ types only.
25 | \note This has the same semantics as std::swap().
26 | */
27 | template
28 | inline void Swap(T& a, T& b) RAPIDJSON_NOEXCEPT {
29 | T tmp = a;
30 | a = b;
31 | b = tmp;
32 | }
33 |
34 | } // namespace internal
35 | RAPIDJSON_NAMESPACE_END
36 |
37 | #endif // RAPIDJSON_INTERNAL_SWAP_H_
38 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assimp/contrib/zlib/gzclose.c:
--------------------------------------------------------------------------------
1 | /* gzclose.c -- zlib gzclose() function
2 | * Copyright (C) 2004, 2010 Mark Adler
3 | * For conditions of distribution and use, see copyright notice in zlib.h
4 | */
5 |
6 | #include "gzguts.h"
7 |
8 | /* gzclose() is in a separate file so that it is linked in only if it is used.
9 | That way the other gzclose functions can be used instead to avoid linking in
10 | unneeded compression or decompression routines. */
11 | int ZEXPORT gzclose(file)
12 | gzFile file;
13 | {
14 | #ifndef NO_GZCOMPRESS
15 | gz_statep state;
16 |
17 | if (file == NULL)
18 | return Z_STREAM_ERROR;
19 | state = (gz_statep)file;
20 |
21 | return state->mode == GZ_READ ? gzclose_r(file) : gzclose_w(file);
22 | #else
23 | return gzclose_r(file);
24 | #endif
25 | }
26 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assimp/contrib/zlib/inffast.h:
--------------------------------------------------------------------------------
1 | /* inffast.h -- header to use inffast.c
2 | * Copyright (C) 1995-2003, 2010 Mark Adler
3 | * For conditions of distribution and use, see copyright notice in zlib.h
4 | */
5 |
6 | /* WARNING: this file should *not* be used by applications. It is
7 | part of the implementation of the compression library and is
8 | subject to change. Applications should only use zlib.h.
9 | */
10 |
11 | void ZLIB_INTERNAL inflate_fast OF((z_streamp strm, unsigned start));
12 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assimp/contrib/zlib/uncompr.c:
--------------------------------------------------------------------------------
1 | /* uncompr.c -- decompress a memory buffer
2 | * Copyright (C) 1995-2003, 2010 Jean-loup Gailly.
3 | * For conditions of distribution and use, see copyright notice in zlib.h
4 | */
5 |
6 | /* @(#) $Id$ */
7 |
8 | #define ZLIB_INTERNAL
9 | #include "zlib.h"
10 |
11 | /* ===========================================================================
12 | Decompresses the source buffer into the destination buffer. sourceLen is
13 | the byte length of the source buffer. Upon entry, destLen is the total
14 | size of the destination buffer, which must be large enough to hold the
15 | entire uncompressed data. (The size of the uncompressed data must have
16 | been saved previously by the compressor and transmitted to the decompressor
17 | by some mechanism outside the scope of this compression library.)
18 | Upon exit, destLen is the actual size of the compressed buffer.
19 |
20 | uncompress returns Z_OK if success, Z_MEM_ERROR if there was not
21 | enough memory, Z_BUF_ERROR if there was not enough room in the output
22 | buffer, or Z_DATA_ERROR if the input data was corrupted.
23 | */
24 | int ZEXPORT uncompress (dest, destLen, source, sourceLen)
25 | Bytef *dest;
26 | uLongf *destLen;
27 | const Bytef *source;
28 | uLong sourceLen;
29 | {
30 | z_stream stream;
31 | int err;
32 |
33 | stream.next_in = (z_const Bytef *)source;
34 | stream.avail_in = (uInt)sourceLen;
35 | /* Check for source > 64K on 16-bit machine: */
36 | if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR;
37 |
38 | stream.next_out = dest;
39 | stream.avail_out = (uInt)*destLen;
40 | if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR;
41 |
42 | stream.zalloc = (alloc_func)0;
43 | stream.zfree = (free_func)0;
44 |
45 | err = inflateInit(&stream);
46 | if (err != Z_OK) return err;
47 |
48 | err = inflate(&stream, Z_FINISH);
49 | if (err != Z_STREAM_END) {
50 | inflateEnd(&stream);
51 | if (err == Z_NEED_DICT || (err == Z_BUF_ERROR && stream.avail_in == 0))
52 | return Z_DATA_ERROR;
53 | return err;
54 | }
55 | *destLen = stream.total_out;
56 |
57 | err = inflateEnd(&stream);
58 | return err;
59 | }
60 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assimp/contrib/zlib/win32/VisualC.txt:
--------------------------------------------------------------------------------
1 |
2 | To build zlib using the Microsoft Visual C++ environment,
3 | use the appropriate project from the projects/ directory.
4 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assimp/contrib/zlib/win32/zlib.def:
--------------------------------------------------------------------------------
1 | ; zlib data compression library
2 | EXPORTS
3 | ; basic functions
4 | zlibVersion
5 | deflate
6 | deflateEnd
7 | inflate
8 | inflateEnd
9 | ; advanced functions
10 | deflateSetDictionary
11 | deflateCopy
12 | deflateReset
13 | deflateParams
14 | deflateTune
15 | deflateBound
16 | deflatePending
17 | deflatePrime
18 | deflateSetHeader
19 | inflateSetDictionary
20 | inflateGetDictionary
21 | inflateSync
22 | inflateCopy
23 | inflateReset
24 | inflateReset2
25 | inflatePrime
26 | inflateMark
27 | inflateGetHeader
28 | inflateBack
29 | inflateBackEnd
30 | zlibCompileFlags
31 | ; utility functions
32 | compress
33 | compress2
34 | compressBound
35 | uncompress
36 | gzopen
37 | gzdopen
38 | gzbuffer
39 | gzsetparams
40 | gzread
41 | gzwrite
42 | gzprintf
43 | gzvprintf
44 | gzputs
45 | gzgets
46 | gzputc
47 | gzgetc
48 | gzungetc
49 | gzflush
50 | gzseek
51 | gzrewind
52 | gztell
53 | gzoffset
54 | gzeof
55 | gzdirect
56 | gzclose
57 | gzclose_r
58 | gzclose_w
59 | gzerror
60 | gzclearerr
61 | ; large file functions
62 | gzopen64
63 | gzseek64
64 | gztell64
65 | gzoffset64
66 | adler32_combine64
67 | crc32_combine64
68 | ; checksum functions
69 | adler32
70 | crc32
71 | adler32_combine
72 | crc32_combine
73 | ; various hacks, don't look :)
74 | deflateInit_
75 | deflateInit2_
76 | inflateInit_
77 | inflateInit2_
78 | inflateBackInit_
79 | gzgetc_
80 | zError
81 | inflateSyncPoint
82 | get_crc_table
83 | inflateUndermine
84 | inflateResetKeep
85 | deflateResetKeep
86 | gzopen_w
87 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assimp/contrib/zlib/win32/zlib1.rc:
--------------------------------------------------------------------------------
1 | #include
2 | #include "../zlib.h"
3 |
4 | #ifdef GCC_WINDRES
5 | VS_VERSION_INFO VERSIONINFO
6 | #else
7 | VS_VERSION_INFO VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE
8 | #endif
9 | FILEVERSION ZLIB_VER_MAJOR,ZLIB_VER_MINOR,ZLIB_VER_REVISION,0
10 | PRODUCTVERSION ZLIB_VER_MAJOR,ZLIB_VER_MINOR,ZLIB_VER_REVISION,0
11 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
12 | #ifdef _DEBUG
13 | FILEFLAGS 1
14 | #else
15 | FILEFLAGS 0
16 | #endif
17 | FILEOS VOS__WINDOWS32
18 | FILETYPE VFT_DLL
19 | FILESUBTYPE 0 // not used
20 | BEGIN
21 | BLOCK "StringFileInfo"
22 | BEGIN
23 | BLOCK "040904E4"
24 | //language ID = U.S. English, char set = Windows, Multilingual
25 | BEGIN
26 | VALUE "FileDescription", "zlib data compression library\0"
27 | VALUE "FileVersion", ZLIB_VERSION "\0"
28 | VALUE "InternalName", "zlib1.dll\0"
29 | VALUE "LegalCopyright", "(C) 1995-2013 Jean-loup Gailly & Mark Adler\0"
30 | VALUE "OriginalFilename", "zlib1.dll\0"
31 | VALUE "ProductName", "zlib\0"
32 | VALUE "ProductVersion", ZLIB_VERSION "\0"
33 | VALUE "Comments", "For more information visit http://www.zlib.net/\0"
34 | END
35 | END
36 | BLOCK "VarFileInfo"
37 | BEGIN
38 | VALUE "Translation", 0x0409, 1252
39 | END
40 | END
41 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assimp/contrib/zlib/zlib.pc.cmakein:
--------------------------------------------------------------------------------
1 | prefix=@CMAKE_INSTALL_PREFIX@
2 | exec_prefix=@CMAKE_INSTALL_PREFIX@
3 | libdir=@INSTALL_LIB_DIR@
4 | sharedlibdir=@INSTALL_LIB_DIR@
5 | includedir=@INSTALL_INC_DIR@
6 |
7 | Name: zlib
8 | Description: zlib compression library
9 | Version: @VERSION@
10 |
11 | Requires:
12 | Libs: -L${libdir} -L${sharedlibdir} -lz
13 | Cflags: -I${includedir}
14 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assimp/contrib/zlib_note.txt:
--------------------------------------------------------------------------------
1 | This is a heavily modified and shrinked version of zlib 1.2.3
2 |
3 | - Removed comments from zlib.h
4 | - Removed gzip/zip archive I/O
5 | - Removed infback.c
6 | - Added Assimp #idefs to exclude it if not needed
7 | - Disabled debug macros in zutil.h
8 |
9 | Assimp itself does not use the compression part yet, so
10 | it needn't be compiled (trees.c, deflate.c, compress.c).
11 | Currently these units are just used by assimp_cmd.
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assimp/include/assimp/.editorconfig:
--------------------------------------------------------------------------------
1 | # See for details
2 |
3 | [*.{h,hpp,inl}]
4 | end_of_line = lf
5 | insert_final_newline = true
6 | trim_trailing_whitespace = true
7 | indent_size = 4
8 | indent_style = space
9 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assimp/include/assimp/Compiler/poppack1.h:
--------------------------------------------------------------------------------
1 |
2 | // ===============================================================================
3 | // May be included multiple times - resets structure packing to the defaults
4 | // for all supported compilers. Reverts the changes made by #include
5 | //
6 | // Currently this works on the following compilers:
7 | // MSVC 7,8,9
8 | // GCC
9 | // BORLAND (complains about 'pack state changed but not reverted', but works)
10 | // ===============================================================================
11 |
12 | #ifndef AI_PUSHPACK_IS_DEFINED
13 | # error pushpack1.h must be included after poppack1.h
14 | #endif
15 |
16 | // reset packing to the original value
17 | #if defined(_MSC_VER) || defined(__BORLANDC__) || defined (__BCPLUSPLUS__)
18 | # pragma pack( pop )
19 | #endif
20 | #undef PACK_STRUCT
21 |
22 | #undef AI_PUSHPACK_IS_DEFINED
23 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assimp/include/assimp/Compiler/pushpack1.h:
--------------------------------------------------------------------------------
1 |
2 |
3 | // ===============================================================================
4 | // May be included multiple times - sets structure packing to 1
5 | // for all supported compilers. #include reverts the changes.
6 | //
7 | // Currently this works on the following compilers:
8 | // MSVC 7,8,9
9 | // GCC
10 | // BORLAND (complains about 'pack state changed but not reverted', but works)
11 | // Clang
12 | //
13 | //
14 | // USAGE:
15 | //
16 | // struct StructToBePacked {
17 | // } PACK_STRUCT;
18 | //
19 | // ===============================================================================
20 |
21 | #ifdef AI_PUSHPACK_IS_DEFINED
22 | # error poppack1.h must be included after pushpack1.h
23 | #endif
24 |
25 | #if defined(_MSC_VER) || defined(__BORLANDC__) || defined (__BCPLUSPLUS__)
26 | # pragma pack(push,1)
27 | # define PACK_STRUCT
28 | #elif defined( __GNUC__ )
29 | # if !defined(HOST_MINGW)
30 | # define PACK_STRUCT __attribute__((__packed__))
31 | # else
32 | # define PACK_STRUCT __attribute__((gcc_struct, __packed__))
33 | # endif
34 | #else
35 | # error Compiler not supported
36 | #endif
37 |
38 | #if defined(_MSC_VER)
39 |
40 | // C4103: Packing was changed after the inclusion of the header, probably missing #pragma pop
41 | # pragma warning (disable : 4103)
42 | #endif
43 |
44 | #define AI_PUSHPACK_IS_DEFINED
45 |
46 |
47 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/assimp/include/assimp/ai_assert.h:
--------------------------------------------------------------------------------
1 | /*
2 | ---------------------------------------------------------------------------
3 | Open Asset Import Library (assimp)
4 | ---------------------------------------------------------------------------
5 |
6 | Copyright (c) 2006-2016, assimp team
7 |
8 | All rights reserved.
9 |
10 | Redistribution and use of this software in source and binary forms,
11 | with or without modification, are permitted provided that the following
12 | conditions are met:
13 |
14 | * Redistributions of source code must retain the above
15 | copyright notice, this list of conditions and the
16 | following disclaimer.
17 |
18 | * Redistributions in binary form must reproduce the above
19 | copyright notice, this list of conditions and the
20 | following disclaimer in the documentation and/or other
21 | materials provided with the distribution.
22 |
23 | * Neither the name of the assimp team, nor the names of its
24 | contributors may be used to endorse or promote products
25 | derived from this software without specific prior
26 | written permission of the assimp team.
27 |
28 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
31 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
32 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
33 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
34 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
35 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
36 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
38 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39 | ---------------------------------------------------------------------------
40 | */
41 | #ifndef AI_DEBUG_H_INC
42 | #define AI_DEBUG_H_INC
43 |
44 | #ifdef ASSIMP_BUILD_DEBUG
45 | # include
46 | # define ai_assert(expression) assert(expression)
47 | #else
48 | # define ai_assert(expression)
49 | #endif
50 |
51 |
52 | #endif
53 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/cpp/AAIOStream.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by ARF on 14/11/2016.
3 | //
4 |
5 | #include "AAIOStream.h"
6 |
7 | AAIOStream::AAIOStream(AAsset *asset): m_Asset(asset) {
8 |
9 | }
10 |
11 |
12 | AAIOStream::~AAIOStream() {
13 |
14 | AAsset_close(m_Asset);
15 | }
16 |
17 |
18 | std::size_t
19 | AAIOStream::FileSize() const {
20 |
21 | return (size_t)AAsset_getLength64(m_Asset);
22 | }
23 |
24 | void
25 | AAIOStream::Flush() {
26 |
27 | throw "AAIOStream::Flush() is unsupported";
28 | }
29 |
30 |
31 | std::size_t
32 | AAIOStream::Read(void* buf, std::size_t size, std::size_t count) {
33 |
34 | return (size_t)AAsset_read(m_Asset, buf, size*count);
35 | }
36 |
37 |
38 | aiReturn
39 | AAIOStream::Seek (std::size_t offset, aiOrigin origin) {
40 |
41 | AAsset_seek64(m_Asset, offset, to_whence(origin));
42 | return aiReturn_SUCCESS;
43 | }
44 |
45 |
46 | std::size_t
47 | AAIOStream::Tell () const {
48 |
49 | return (size_t)(AAsset_getLength64(m_Asset) - AAsset_getRemainingLength64(m_Asset));
50 | }
51 |
52 |
53 | std::size_t
54 | AAIOStream::Write (const void*, std::size_t, std::size_t) {
55 |
56 | throw "AAIOStream::Write() is unsupported";
57 | }
58 |
59 |
60 | int AAIOStream::to_whence (aiOrigin origin) {
61 |
62 | if (origin == aiOrigin_SET) return SEEK_SET;
63 | if (origin == aiOrigin_CUR) return SEEK_CUR;
64 | if (origin == aiOrigin_END) return SEEK_END;
65 | throw "AAIOStream to_whence: invalid aiOrigin";
66 | }
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/cpp/AAIOStream.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by ARF on 14/11/2016.
3 | //
4 |
5 | #ifndef CPPTEST_AAIOSTREAM_H
6 | #define CPPTEST_AAIOSTREAM_H
7 |
8 |
9 | #include
10 | #include
11 |
12 | #include
13 |
14 | class AAIOStream: public Assimp::IOStream {
15 |
16 | public:
17 | AAIOStream(AAsset *asset);
18 | ~AAIOStream();
19 |
20 | std::size_t FileSize () const override;
21 | void Flush() override;
22 | std::size_t Read(void* buf, std::size_t size, std::size_t count) override ;
23 | aiReturn Seek (std::size_t offset, aiOrigin origin) override;
24 | std::size_t Tell () const override;
25 | std::size_t Write (const void*, std::size_t, std::size_t) override;
26 |
27 | private:
28 | AAsset *m_Asset;
29 |
30 | int to_whence (aiOrigin origin);
31 | };
32 |
33 |
34 | #endif //CPPTEST_AAIOSTREAM_H
35 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/cpp/AAIOSystem.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by ARF on 14/11/2016.
3 | //
4 |
5 | #include "AAIOSystem.h"
6 |
7 |
8 | AAIOSystem::AAIOSystem(AAssetManager *aManager):
9 | m_Manager(aManager), m_LastPath(""){
10 |
11 | }
12 |
13 |
14 | Assimp::IOStream *
15 | AAIOSystem::Open(const char* file, const char* mode) {
16 |
17 | AAsset* asset = AAssetManager_open(m_Manager, file, AASSET_MODE_UNKNOWN);
18 |
19 | if (asset == NULL)
20 | {
21 | // Workaround for issue https://github.com/assimp/assimp/issues/641
22 | // Look for the file in the directory of the previously loaded file
23 | std::string file2 = m_LastPath + "/" + file;
24 | asset = AAssetManager_open(m_Manager, file2.c_str(), AASSET_MODE_UNKNOWN);
25 | if (asset == NULL)
26 | throw "Failed opening asset file"; // replace with proper exception class
27 | }
28 | m_LastPath = getPath(file);
29 | m_Stream = new AAIOStream(asset);
30 | return m_Stream;
31 | }
32 |
33 |
34 | void
35 | AAIOSystem::Close(Assimp::IOStream *) {
36 |
37 | delete m_Stream;
38 | }
39 |
40 |
41 | bool
42 | AAIOSystem::ComparePaths (const char* a, const char* b) const {
43 |
44 | return strcmp(a,b) == 0;
45 | }
46 |
47 |
48 | bool
49 | AAIOSystem::Exists (const char* file) const {
50 |
51 | AAsset* asset = AAssetManager_open(m_Manager, file, AASSET_MODE_UNKNOWN);
52 |
53 | if (asset != NULL) {
54 | AAsset_close(asset);
55 | return true;
56 | }
57 | else
58 | return false;
59 | }
60 |
61 |
62 | char
63 | AAIOSystem::getOsSeparator () const {
64 |
65 | return '/';
66 | }
67 |
68 |
69 | std::string
70 | AAIOSystem::getPath(const std::string &fn) {
71 |
72 | size_t found = fn.find_last_of("/\\");
73 |
74 | if (found == fn.npos)
75 | return(""); // clone string
76 | else
77 | return(fn.substr(0,found));
78 | }
79 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/cpp/AAIOSystem.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by ARF on 14/11/2016.
3 | //
4 |
5 | #ifndef CPPTEST_AAIOSYSTEM_H
6 | #define CPPTEST_AAIOSYSTEM_H
7 |
8 |
9 | #include
10 | #include "AAIOStream.h"
11 | #include
12 |
13 | class AAIOSystem: public Assimp::IOSystem {
14 |
15 | private:
16 | AAssetManager *m_Manager;
17 | AAIOStream *m_Stream;
18 | std::string m_LastPath;
19 | std::string getPath(const std::string &fn);
20 |
21 | public:
22 | AAIOSystem(AAssetManager* aManager);
23 |
24 | Assimp::IOStream *Open(const char* file, const char* mode = "rb") override;
25 | void Close(Assimp::IOStream *) override;
26 | bool ComparePaths (const char*, const char*) const override;
27 | bool Exists (const char* file) const override;
28 | char getOsSeparator () const override;
29 |
30 | };
31 |
32 |
33 | #endif //CPPTEST_AAIOSYSTEM_H
34 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/cpp/AALogStream.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by ARF on 14/11/2016.
3 | //
4 |
5 | #ifndef CPPTEST_AALOGSTREAM_H
6 | #define CPPTEST_AALOGSTREAM_H
7 |
8 | #include
9 | #include
10 | #include
11 |
12 | class AALogStream :
13 | public Assimp::LogStream
14 | {
15 | public:
16 | // Constructor
17 | AALogStream()
18 | {
19 | // empty
20 | }
21 |
22 | // Destructor
23 | ~AALogStream()
24 | {
25 | // empty
26 | }
27 | // Write womethink using your own functionality
28 | void write(const char* message)
29 | {
30 | __android_log_print(ANDROID_LOG_DEBUG, "Assimp Test", "%s\n", message);
31 | }
32 | };
33 |
34 | #endif //CPPTEST_AALOGSTREAM_H
35 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/cpp/textureLoader.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by ARF on 17/11/2016.
3 | //
4 |
5 | #include
6 | #include
7 | #include
8 | #include
9 |
10 | // Android log function wrappers
11 | static const char* kTAG = "hello-jniCallback";
12 | #define LOGI(...) \
13 | ((void)__android_log_print(ANDROID_LOG_INFO, kTAG, __VA_ARGS__))
14 | #define LOGW(...) \
15 | ((void)__android_log_print(ANDROID_LOG_WARN, kTAG, __VA_ARGS__))
16 | #define LOGE(...) \
17 | ((void)__android_log_print(ANDROID_LOG_ERROR, kTAG, __VA_ARGS__))
18 |
19 |
20 | typedef struct tick_context {
21 | JavaVM *javaVM;
22 | jclass jniHelperClz;
23 | jobject jniHelperObj;
24 | jclass mainActivityClz;
25 | jobject mainActivityObj;
26 | pthread_mutex_t lock;
27 | int done;
28 | } TickContext;
29 |
30 | TickContext g_ctx;
31 | jmethodID theFunc;
32 | JNIEnv* env;
33 |
34 | JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void* reserved) {
35 | memset(&g_ctx, 0, sizeof(g_ctx));
36 |
37 | g_ctx.javaVM = vm;
38 | if ((*vm)->GetEnv(vm, (void**)&env, JNI_VERSION_1_6) != JNI_OK) {
39 | return JNI_ERR; // JNI version not supported.
40 | }
41 |
42 | jclass clz = (*env)->FindClass(env,
43 | "com/example/arf/cpptest/TextureLoader");
44 | g_ctx.jniHelperClz = (*env)->NewGlobalRef(env, clz);
45 |
46 | jmethodID jniHelperCtor = (*env)->GetMethodID(env, g_ctx.jniHelperClz,
47 | "", "()V");
48 | jobject handler = (*env)->NewObject(env, g_ctx.jniHelperClz,
49 | jniHelperCtor);
50 | g_ctx.jniHelperObj = (*env)->NewGlobalRef(env, handler);
51 |
52 | g_ctx.done = 0;
53 | g_ctx.mainActivityObj = NULL;
54 |
55 | theFunc = (*env)->GetStaticMethodID(
56 | env, g_ctx.jniHelperClz,
57 | "CreateTextureFromAssets", "()Ljava/lang/String;");
58 | if (!theFunc) {
59 | LOGE("Failed to retrieve getBuildVersion() methodID @ line %d",
60 | __LINE__);
61 | return;
62 | }
63 |
64 |
65 | return JNI_VERSION_1_6;
66 | }
67 |
68 |
69 |
70 | int LoadTexture(std::string filename) {
71 |
72 | jstring javaMsg = (*env)->NewStringUTF(env, filename.c_str());
73 | jint textureID = (*env)->CallIntMethod(env, g_ctx.jniHelperObj, theFunc, javaMsg);
74 | (*env)->DeleteLocalRef(env, javaMsg);
75 |
76 | return textureID;
77 | }
78 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/java/com/lighthouse3d/android/openglndk/GLES3JNILib.java:
--------------------------------------------------------------------------------
1 | package com.lighthouse3d.android.openglndk;
2 |
3 | import android.content.res.AssetManager;
4 |
5 | /**
6 | * Created by ARF on 16/11/2016.
7 | */
8 |
9 | public class GLES3JNILib {
10 |
11 | static {
12 | System.loadLibrary("native-lib");
13 | }
14 |
15 | public static native void init(AssetManager c);
16 | public static native void resize(int width, int height);
17 | public static native void step();
18 |
19 | public static native void startRotating(float x, float y);
20 | public static native void updateRotation(float x, float y);
21 | public static native void stopRotating();
22 |
23 | public static native void startScaling(float dist);
24 | public static native void updateScale(float dist);
25 | public static native void stopScaling();
26 | }
27 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/java/com/lighthouse3d/android/openglndk/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.lighthouse3d.android.openglndk;
2 |
3 | import android.os.Bundle;
4 | import android.support.v7.app.AppCompatActivity;
5 |
6 | public class MainActivity extends AppCompatActivity {
7 |
8 | // Used to load the 'native-lib' library on application startup.
9 | static {
10 | System.loadLibrary("native-lib");
11 | System.loadLibrary("assimp");
12 | }
13 |
14 |
15 | @Override
16 | protected void onCreate(Bundle savedInstanceState) {
17 | super.onCreate(savedInstanceState);
18 |
19 | setContentView(R.layout.activity_main);
20 | }
21 |
22 |
23 | /* @Override
24 | public boolean onCreateOptionsMenu(Menu menu) {
25 | // Inflate the menu; this adds items to the action bar if it is present.
26 | getMenuInflater().inflate(R.menu.menu_main, menu);
27 | return true;
28 | }
29 |
30 |
31 | @Override
32 | public boolean onOptionsItemSelected(MenuItem item) {
33 | // Handle action bar item clicks here. The action bar will
34 | // automatically handle clicks on the Home/Up button, so long
35 | // as you specify a parent activity in AndroidManifest.xml.
36 | int id = item.getItemId();
37 |
38 | //noinspection SimplifiableIfStatement
39 | if (id == R.id.action_settings) {
40 | return true;
41 | }
42 |
43 | return super.onOptionsItemSelected(item);
44 | }*/
45 | }
46 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
15 |
16 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lighthouse3d/AndroidGL/7e749e05894d9d443179f00ca796a50c015c4131/OpenGLNDK/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lighthouse3d/AndroidGL/7e749e05894d9d443179f00ca796a50c015c4131/OpenGLNDK/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lighthouse3d/AndroidGL/7e749e05894d9d443179f00ca796a50c015c4131/OpenGLNDK/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lighthouse3d/AndroidGL/7e749e05894d9d443179f00ca796a50c015c4131/OpenGLNDK/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lighthouse3d/AndroidGL/7e749e05894d9d443179f00ca796a50c015c4131/OpenGLNDK/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 |
6 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | OpenGLNDK
3 |
4 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/textureLoader/textureLoader.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by ARF on 17/11/2016.
3 | //
4 |
5 | #ifndef CPPTEST_TEXTURELOADER_H
6 | #define CPPTEST_TEXTURELOADER_H
7 |
8 |
9 | #include
10 | #include
11 |
12 | JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void* reserved);
13 | int LoadTexture(std::string filename);
14 | int LoadCubeMapTexture(std::string px, std::string nx, std::string py, std::string ny,
15 | std::string pz, std::string nz);
16 |
17 | #endif //CPPTEST_TEXTURELOADER_H
18 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/vsl/vsLogLib.cpp:
--------------------------------------------------------------------------------
1 | /** ----------------------------------------------------------
2 | * \class VSLogLib
3 | *
4 | * Lighthouse3D
5 | *
6 | * VSLogLib - Very Simple Log Library
7 | *
8 | * \version 0.1.0
9 | * Initial Release
10 | *
11 | * This class provides a basic logging mechanism
12 | *
13 | * Full documentation at
14 | * http://www.lighthouse3d.com/very-simple-libs
15 | *
16 | ---------------------------------------------------------------*/
17 |
18 | #include "vsLogLib.h"
19 |
20 |
21 | VSLogLib::VSLogLib(): pStreamEnabled(false) {
22 |
23 | }
24 |
25 | // cleans up
26 | VSLogLib::~VSLogLib() {
27 |
28 | pLogVector.clear();
29 | }
30 |
31 |
32 | // clears the log
33 | void
34 | VSLogLib::clear() {
35 |
36 | pLogVector.clear();
37 | }
38 |
39 |
40 | // adds a message, printf style
41 | void
42 | VSLogLib::addMessage(std::string s, ...) {
43 |
44 | va_list args;
45 | va_start(args,s);
46 | vsnprintf( pAux, 256, s.c_str(), args );
47 | //vsprintf(pAux,s.c_str(), args);
48 | va_end(args);
49 | if (pStreamEnabled)
50 | *pOuts << pAux << "\n";
51 | else
52 | pLogVector.push_back(pAux);
53 | }
54 |
55 |
56 | #ifndef __ANDROID_API__
57 | // dumps the log contents to a file
58 | void
59 | VSLogLib::dumpToFile(std::string filename) {
60 |
61 | std::ofstream file;
62 | file.open(filename.c_str());
63 |
64 | for (unsigned int i = 0; i < pLogVector.size(); ++i) {
65 | file << pLogVector[i] << "\n";
66 | }
67 | file.close();
68 | }
69 | #endif
70 |
71 |
72 | // dumps the log contents to a string
73 | std::string
74 | VSLogLib::dumpToString() {
75 |
76 | pRes = "";
77 |
78 | for (unsigned int i = 0; i < pLogVector.size(); ++i) {
79 |
80 | pRes += pLogVector[i] + "\n";
81 | }
82 |
83 | return pRes;
84 | }
85 |
86 |
87 | void
88 | VSLogLib::disableStream() {
89 |
90 | pStreamEnabled = false;
91 | }
92 |
93 |
94 | void
95 | VSLogLib::enableStream(std::ostream *outStream) {
96 |
97 | // set the output stream
98 | if (!outStream)
99 | pOuts = (std::iostream *)&std::cout;
100 | else
101 | pOuts = outStream;
102 |
103 | pStreamEnabled = true;
104 | }
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/vsl/vsLogLib.h:
--------------------------------------------------------------------------------
1 | /** ----------------------------------------------------------
2 | * \class VSLogLib
3 | *
4 | * Lighthouse3D
5 | *
6 | * VSLogLib - Very Simple Log Library
7 | *
8 | * \version 0.2.0
9 | * - added streams
10 | * - usage of a define makes it possible to remove all
11 | * logging from the application easily
12 | *
13 | * \version 0.1.0
14 | * - Initial Release
15 | *
16 | * This class provides a basic logging mechanism
17 | *
18 | * Full documentation at
19 | * http://www.lighthouse3d.com/very-simple-libs
20 | *
21 | ---------------------------------------------------------------*/
22 |
23 | #ifndef __VSLogLib__
24 | #define __VSLogLib__
25 |
26 | #ifndef VSL_MODE
27 | #define VSL_DEBUG 1
28 | #define VSL_RELEASE 0
29 | // set this value to VS_RELEASE to disable logging
30 | #define VSL_MODE VSL_DEBUG
31 | #endif
32 |
33 | #include
34 | #include
35 | #include
36 | #include
37 | #include
38 | #include
39 |
40 |
41 | class VSLogLib {
42 |
43 | public:
44 |
45 | VSLogLib();
46 | ~VSLogLib();
47 |
48 | /// set an output stream
49 | void enableStream(std::ostream *outStream);
50 | /// disable output stream, keep messages in the log
51 | void disableStream();
52 |
53 | /** Add a message, printf style
54 | * \param format the same as the first parameter of printf
55 | * \param ... the remaining params of printf
56 | */
57 | void addMessage(std::string format, ...);
58 |
59 | #ifndef __ANDROID_API__
60 | /// Writes the log to a file
61 | void dumpToFile(std::string filename);
62 | #endif
63 |
64 | /// returns a string with the logs contents
65 | std::string dumpToString();
66 |
67 | /// clear the log
68 | void clear();
69 |
70 | private:
71 |
72 | /// The log itself
73 | std::vector pLogVector;
74 | /// just a string to return values
75 | std::string pRes;
76 | /// aux string to avoid malloc/dealloc
77 | char pAux[256];
78 | /// the output stream
79 | std::ostream *pOuts;
80 | /// stream enabled status
81 | bool pStreamEnabled;
82 |
83 | };
84 |
85 | // This macro allow a simple usage of any log
86 | // and when undefined it will remove all calls
87 | // from the application
88 | #if VSL_MODE == VSL_DEBUG
89 | #define VSLOG(log, message, ...) \
90 | {\
91 | (log.addMessage(message, ## __VA_ARGS__));\
92 | };
93 | #else
94 | #define VSLOG(log, message, ...)
95 | #endif
96 |
97 |
98 | #endif
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/vsl/vsSurfRevLib.h:
--------------------------------------------------------------------------------
1 | /** ----------------------------------------------------------
2 | * \class VSSurfRevLib
3 | *
4 | * Lighthouse3D
5 | *
6 | * VSSurfRevLib - Very Simple Surfaces of Revolution Model Library
7 | *
8 | * \version 0.1.0
9 | * Initial Release
10 | *
11 | * This lib provides an interface to create models
12 | * based on surfaces of revolution
13 | *
14 | * This lib requires the following classes from VSL:
15 | * (http://www.lighthouse3d.com/very-simple-libs)
16 | *
17 | * VSModelLib
18 | * VSResourceLib
19 | * VSMathLib
20 | * VSLogLib
21 | * VSShaderLib
22 | *
23 | * and the following third party libs:
24 | *
25 | * GLEW (http://glew.sourceforge.net/),
26 | *
27 | * Full documentation at
28 | * http://www.lighthouse3d.com/very-simple-libs
29 | *
30 | ---------------------------------------------------------------*/
31 |
32 |
33 | #ifndef __VSResSurfRevLib__
34 | #define __VSResSurfRevLib__
35 |
36 | #include
37 | #include
38 |
39 | #ifdef __ANDROID_API__
40 | #include
41 | #include
42 |
43 | #else
44 | #include
45 | #endif
46 |
47 | #include "vsModelLib.h"
48 |
49 |
50 | class VSSurfRevLib : public VSModelLib{
51 |
52 | public:
53 |
54 | VSSurfRevLib();
55 | ~VSSurfRevLib();
56 |
57 | void create (float *p, int numP, int sides, int closed, float smoothCos);
58 | void createSphere(float radius, int divisions);
59 | void createTorus(float innerRadius, float outerRadius, int rings, int sides);
60 | void createCylinder(float height, float radius, int sides, int stacks);
61 | void createCone(float height, float baseRadius, int sides);
62 | void createPawn();
63 |
64 | private:
65 |
66 | void computeVAO(int numP, float *p, float *points, int sides, float smoothCos);
67 | void circularProfile(std::vector &res, float minAngle, float maxAngle, float radius, int divisions, float transX= 0.0f, float transY = 0.0f);
68 | int revSmoothNormal2(float *p, float *nx, float *ny, float smoothCos, int beginEnd);
69 | float computeSegmentLength(float *p);
70 | float computeTotalSegmentLength(float *p, int numP);
71 |
72 | };
73 | #endif
74 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/vsl/vslConfig.h:
--------------------------------------------------------------------------------
1 | #ifndef __VSConfigLibs__
2 | #define __VSConfigLibs__
3 |
4 |
5 | #define __VSL_TEXTURE_LOADING__ 1
6 |
7 | #define __VSL_MODEL_LOADING__ 1
8 |
9 |
10 | // Note: font loading requires texture loading
11 | // pick one
12 | //#define __VSL_FONT_LOADING__ 1
13 | #define __VSL_FONT_LOADING__ 0
14 |
15 | #if (__VSL_FONT_LOADING__ == 1) && (__VSL_TEXTURE_LOADING__ == 0)
16 | #error font loading requires texture loading
17 | #endif
18 |
19 | #endif
20 |
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/main/vsl/vslibs.h:
--------------------------------------------------------------------------------
1 | /** ----------------------------------------------------------
2 | * Very Simple Libraries
3 | *
4 | * Lighthouse3D
5 | *
6 | *
7 | * Full documentation at
8 | * http://www.lighthouse3d.com/very-simple-libs
9 | *
10 | *
11 | * These libs requires:
12 | * GLEW (http://glew.sourceforge.net/)
13 | * Assimp (http://assimp.sourceforge.net/)
14 | * Devil (http://openil.sourceforge.net/)
15 | * TinyXML (http://www.grinninglizard.com/tinyxml/)
16 | * (only for fonts)
17 | ---------------------------------------------------------------*/
18 |
19 |
20 |
21 | #include "vslConfig.h"
22 |
23 |
24 | #include "vsGeometryLib.h"
25 | #include "vsGLInfoLib.h"
26 | #include "vsLogLib.h"
27 | #include "vsMathLib.h"
28 | #include "vsModelLib.h"
29 | #include "vsProfileLib.h"
30 | #include "vsResourceLib.h"
31 | #include "vsShaderLib.h"
32 | #include "vsSurfRevLib.h"
33 |
34 | #if (__VSL_TEXTURE_LOADING__ == 1)
35 | #include "vsFontLib.h"
36 | #endif
--------------------------------------------------------------------------------
/OpenGLNDK/app/src/test/java/com/lighthouse3d/android/openglndk/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.lighthouse3d.android.openglndk;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/OpenGLNDK/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | }
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:2.2.3'
9 |
10 | // NOTE: Do not place your application dependencies here; they belong
11 | // in the individual module build.gradle files
12 | }
13 | }
14 |
15 | allprojects {
16 | repositories {
17 | jcenter()
18 | }
19 | }
20 |
21 | task clean(type: Delete) {
22 | delete rootProject.buildDir
23 | }
24 |
--------------------------------------------------------------------------------
/OpenGLNDK/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | org.gradle.jvmargs=-Xmx1536m
13 |
14 | # When configured, Gradle will run in incubating parallel mode.
15 | # This option should only be used with decoupled projects. More details, visit
16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
17 | # org.gradle.parallel=true
18 |
--------------------------------------------------------------------------------
/OpenGLNDK/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lighthouse3d/AndroidGL/7e749e05894d9d443179f00ca796a50c015c4131/OpenGLNDK/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/OpenGLNDK/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Mon Dec 28 10:00:20 PST 2015
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
7 |
--------------------------------------------------------------------------------
/OpenGLNDK/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/OpenGLNDK/openglndk.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lighthouse3d/AndroidGL/7e749e05894d9d443179f00ca796a50c015c4131/OpenGLNDK/openglndk.png
--------------------------------------------------------------------------------
/OpenGLNDK/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # AndroidGL
2 | Android demos for OpenGL® ES with Java and C++ (NDK)
3 |
4 | ##OpenGLJava
5 | An OpenGL® ES 3.0 app that loads a model in json format and renders it. It can deal with textures, and shaders in separate files (located in assets folder).
6 |
7 | ##OpenGLNDK
8 | [VSL](http://www.lighthouse3d.com/very-simple-libs/) has been ported to Android. This is a C++ demo app, using NDK, for OpenGL® ES 3.0. It includes Assimp for model loading. Texture loading is achieved with JNI.
9 |
10 |
--------------------------------------------------------------------------------