diff --git a/examples/osgAndroidExampleGLES1/AndroidManifest.xml b/examples/osgAndroidExampleGLES1/AndroidManifest.xml new file mode 100644 index 000000000..eac0d374a --- /dev/null +++ b/examples/osgAndroidExampleGLES1/AndroidManifest.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + diff --git a/examples/osgAndroidExampleGLES1/default.properties b/examples/osgAndroidExampleGLES1/default.properties new file mode 100644 index 000000000..e2e8061f2 --- /dev/null +++ b/examples/osgAndroidExampleGLES1/default.properties @@ -0,0 +1,11 @@ +# This file is automatically generated by Android Tools. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file must be checked in Version Control Systems. +# +# To customize properties used by the Ant build system use, +# "build.properties", and override values to adapt the script to your +# project structure. + +# Project target. +target=android-8 diff --git a/examples/osgAndroidExampleGLES1/jni/Android.mk b/examples/osgAndroidExampleGLES1/jni/Android.mk new file mode 100644 index 000000000..1a4d3efc0 --- /dev/null +++ b/examples/osgAndroidExampleGLES1/jni/Android.mk @@ -0,0 +1,67 @@ +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := osgNativeLib +### Main Install dir +OSG_ANDROID_DIR := < type your install directory > +LIBDIR := $(OSG_ANDROID_DIR)/obj/local/armeabi + +ifeq ($(TARGET_ARCH_ABI),armeabi-v7a) + LOCAL_ARM_NEON := true + LIBDIR := $(OSG_ANDROID_DIR)/obj/local/armeabi-v7a +endif + +### Add all source file names to be included in lib separated by a whitespace + +LOCAL_C_INCLUDES:= $(OSG_ANDROID_DIR)/include +LOCAL_CFLAGS := -Werror -fno-short-enums +LOCAL_CPPFLAGS := -DOSG_LIBRARY_STATIC + +LOCAL_LDLIBS := -llog -lGLESv1_CM -ldl -lz +LOCAL_SRC_FILES := osgNativeLib.cpp OsgMainApp.cpp OsgAndroidNotifyHandler.cpp +LOCAL_LDFLAGS := -L $(LIBDIR) \ +-losgdb_dds \ +-losgdb_openflight \ +-losgdb_tga \ +-losgdb_rgb \ +-losgdb_osgterrain \ +-losgdb_osg \ +-losgdb_ive \ +-losgdb_deprecated_osgviewer \ +-losgdb_deprecated_osgvolume \ +-losgdb_deprecated_osgtext \ +-losgdb_deprecated_osgterrain \ +-losgdb_deprecated_osgsim \ +-losgdb_deprecated_osgshadow \ +-losgdb_deprecated_osgparticle \ +-losgdb_deprecated_osgfx \ +-losgdb_deprecated_osganimation \ +-losgdb_deprecated_osg \ +-losgdb_serializers_osgvolume \ +-losgdb_serializers_osgtext \ +-losgdb_serializers_osgterrain \ +-losgdb_serializers_osgsim \ +-losgdb_serializers_osgshadow \ +-losgdb_serializers_osgparticle \ +-losgdb_serializers_osgmanipulator \ +-losgdb_serializers_osgfx \ +-losgdb_serializers_osganimation \ +-losgdb_serializers_osg \ +-losgViewer \ +-losgVolume \ +-losgTerrain \ +-losgText \ +-losgShadow \ +-losgSim \ +-losgParticle \ +-losgManipulator \ +-losgGA \ +-losgFX \ +-losgDB \ +-losgAnimation \ +-losgUtil \ +-losg \ +-lOpenThreads + +include $(BUILD_SHARED_LIBRARY) diff --git a/examples/osgAndroidExampleGLES1/jni/Application.mk b/examples/osgAndroidExampleGLES1/jni/Application.mk new file mode 100644 index 000000000..20040dc94 --- /dev/null +++ b/examples/osgAndroidExampleGLES1/jni/Application.mk @@ -0,0 +1,11 @@ +#ANDROID APPLICATION MAKEFILE +APP_BUILD_SCRIPT := $(call my-dir)/Android.mk +#APP_PROJECT_PATH := $(call my-dir) + +APP_OPTIM := release + +APP_PLATFORM := android-7 +APP_STL := gnustl_static +APP_CPPFLAGS := -fexceptions -frtti +APP_ABI := armeabi armeabi-v7a +APP_MODULES := osgNativeLib \ No newline at end of file diff --git a/examples/osgAndroidExampleGLES1/jni/OsgAndroidNotifyHandler.cpp b/examples/osgAndroidExampleGLES1/jni/OsgAndroidNotifyHandler.cpp new file mode 100644 index 000000000..2e4f38c15 --- /dev/null +++ b/examples/osgAndroidExampleGLES1/jni/OsgAndroidNotifyHandler.cpp @@ -0,0 +1,38 @@ +/* + * OsgAndroidNotifyHandler.cpp + * + * Created on: 31/05/2011 + * Author: Jorge Izquierdo Ciges + */ + +#include "OsgAndroidNotifyHandler.hpp" +#include + +void OsgAndroidNotifyHandler::setTag(std::string tag){ + _tag = tag; +} +void OsgAndroidNotifyHandler::notify(osg::NotifySeverity severity, const char *message){ + + switch ( severity ) { + case osg::DEBUG_FP: + __android_log_write(ANDROID_LOG_VERBOSE,_tag.c_str(),message); + break; + case osg::DEBUG_INFO: + __android_log_write(ANDROID_LOG_DEBUG,_tag.c_str(),message); + break; + case osg::NOTICE: + case osg::INFO: + __android_log_write(ANDROID_LOG_INFO,_tag.c_str(),message); + break; + case osg::WARN: + __android_log_write(ANDROID_LOG_WARN,_tag.c_str(),message); + break; + case osg::FATAL: + case osg::ALWAYS: + __android_log_write(ANDROID_LOG_ERROR,_tag.c_str(),message); + break; + default: + __android_log_write(ANDROID_LOG_DEBUG,_tag.c_str(),message); + break; + } +} diff --git a/examples/osgAndroidExampleGLES1/jni/OsgAndroidNotifyHandler.hpp b/examples/osgAndroidExampleGLES1/jni/OsgAndroidNotifyHandler.hpp new file mode 100644 index 000000000..114a369aa --- /dev/null +++ b/examples/osgAndroidExampleGLES1/jni/OsgAndroidNotifyHandler.hpp @@ -0,0 +1,26 @@ +/* + * OsgAndroidNotifyHandler.hpp + * + * Created on: 31/05/2011 + * Author: Jorge Izquierdo Ciges + */ + +#ifndef OSGANDROIDNOTIFYHANDLER_HPP_ +#define OSGANDROIDNOTIFYHANDLER_HPP_ + +#include + +#include + +#include + +class OSG_EXPORT OsgAndroidNotifyHandler : public osg::NotifyHandler +{ +private: + std::string _tag; +public: + void setTag(std::string tag); + void notify(osg::NotifySeverity severity, const char *message); +}; + +#endif /* OSGANDROIDNOTIFYHANDLER_HPP_ */ diff --git a/examples/osgAndroidExampleGLES1/jni/OsgMainApp.cpp b/examples/osgAndroidExampleGLES1/jni/OsgMainApp.cpp new file mode 100644 index 000000000..c1d930c55 --- /dev/null +++ b/examples/osgAndroidExampleGLES1/jni/OsgMainApp.cpp @@ -0,0 +1,205 @@ +#include "OsgMainApp.hpp" + + +OsgMainApp::OsgMainApp(){ + + _lodScale = 1.0f; + _prevFrame = 0; + + _initialized = false; + _clean_scene = false; + +} +OsgMainApp::~OsgMainApp(){ + +} +void OsgMainApp::loadModels(){ + if(_vModelsToLoad.size()==0) return; + + osg::notify(osg::ALWAYS)<<"There are "<<_vModelsToLoad.size()<<" models to load"< loadedModel = osgDB::readNodeFile(newModel.filename); + if (loadedModel == 0) { + osg::notify(osg::ALWAYS)<<"Model not loaded"<setName(newModel.name); + _root->addChild(loadedModel); + } + } + + _viewer->setSceneData(NULL); + _viewer->setSceneData(_root.get()); + _manipulator->getNode(); + _viewer->home(); + + _viewer->getDatabasePager()->clear(); + _viewer->getDatabasePager()->registerPagedLODs(_root.get()); + _viewer->getDatabasePager()->setUpThreads(3, 1); + _viewer->getDatabasePager()->setTargetMaximumNumberOfPageLOD(2); + _viewer->getDatabasePager()->setUnrefImageDataAfterApplyPolicy(true, true); + + _vModelsToLoad.clear(); + +} +void OsgMainApp::deleteModels(){ + if(_vModelsToDelete.size()==0) return; + + osg::notify(osg::ALWAYS)<<"There are "<<_vModelsToDelete.size()<<" models to delete"<getNumChildren(); j>0; j--){ + osg::ref_ptr children = _root->getChild(j-1); + if(children->getName() == modelToDelete.name){ + _root->removeChild(children); + } + } + + } + + _vModelsToDelete.clear(); + osg::notify(osg::ALWAYS)<<"finished"<setTag("Osg Viewer"); + osg::setNotifyHandler(_notifyHandler); + + osg::notify(osg::ALWAYS)<<"Testing"<setUpViewerAsEmbeddedInWindow(x, y, width, height); + + _root = new osg::Group(); + + _viewer->realize(); + + _state = _root->getOrCreateStateSet(); + _state->setMode(GL_LIGHTING, osg::StateAttribute::ON); + _state->setMode(GL_DEPTH_TEST, osg::StateAttribute::ON); + _state->setMode(GL_CULL_FACE, osg::StateAttribute::ON); + + _viewer->setSceneData(_root.get()); + + _viewer->addEventHandler(new osgViewer::StatsHandler); + _viewer->addEventHandler(new osgGA::StateSetManipulator(_viewer->getCamera()->getOrCreateStateSet())); + _viewer->addEventHandler(new osgViewer::ThreadingHandler); + _viewer->addEventHandler(new osgViewer::LODScaleHandler); + + _manipulator = new osgGA::KeySwitchMatrixManipulator; + + _manipulator->addMatrixManipulator( '1', "Trackball", new osgGA::TrackballManipulator() ); + _manipulator->addMatrixManipulator( '2', "Flight", new osgGA::FlightManipulator() ); + _manipulator->addMatrixManipulator( '3', "Drive", new osgGA::DriveManipulator() ); + _manipulator->addMatrixManipulator( '4', "Terrain", new osgGA::TerrainManipulator() ); + _manipulator->addMatrixManipulator( '5', "Orbit", new osgGA::OrbitManipulator() ); + _manipulator->addMatrixManipulator( '6', "FirstPerson", new osgGA::FirstPersonManipulator() ); + _manipulator->addMatrixManipulator( '7', "Spherical", new osgGA::SphericalManipulator() ); + + _viewer->setCameraManipulator( _manipulator.get() ); + + _viewer->getViewerStats()->collectStats("scene", true); + + _initialized = true; + +} +//Draw +void OsgMainApp::draw(){ + //Every load o remove has to be done before any drawing + loadModels(); + deleteModels(); + + _viewer->frame(); +} +//Events +void OsgMainApp::mouseButtonPressEvent(float x,float y,int button){ + _viewer->getEventQueue()->mouseButtonPress(x, y, button); +} +void OsgMainApp::mouseButtonReleaseEvent(float x,float y,int button){ + _viewer->getEventQueue()->mouseButtonRelease(x, y, button); +} +void OsgMainApp::mouseMoveEvent(float x,float y){ + _viewer->getEventQueue()->mouseMotion(x, y); +} +void OsgMainApp::keyboardDown(int key){ + _viewer->getEventQueue()->keyPress(key); +} +void OsgMainApp::keyboardUp(int key){ + _viewer->getEventQueue()->keyRelease(key); +} +//Loading and unloading +void OsgMainApp::loadObject(std::string filePath){ + Model newModel; + newModel.filename = filePath; + newModel.name = filePath; + + int num = 0; + for(unsigned int i=0;i<_vModels.size();i++){ + if(_vModels[i].name==newModel.name) + return; + } + + _vModelsToLoad.push_back(newModel); + +} +void OsgMainApp::loadObject(std::string name,std::string filePath){ + + Model newModel; + newModel.filename = filePath; + newModel.name = name; + + for(unsigned int i=0;i<_vModels.size();i++){ + if(_vModels[i].name==newModel.name){ + osg::notify(osg::ALWAYS)<<"Name already used"<getCamera()->setClearColor(color); +} +osg::Vec4f OsgMainApp::getClearColor(){ + osg::notify(osg::ALWAYS)<<"Getting Clear Color"<getCamera()->getClearColor(); +} diff --git a/examples/osgAndroidExampleGLES1/jni/OsgMainApp.hpp b/examples/osgAndroidExampleGLES1/jni/OsgMainApp.hpp new file mode 100644 index 000000000..95f18b286 --- /dev/null +++ b/examples/osgAndroidExampleGLES1/jni/OsgMainApp.hpp @@ -0,0 +1,138 @@ +/* + * OsgMainApp.hpp + * + * Created on: 29/05/2011 + * Author: Jorge Izquierdo Ciges + */ + +#ifndef OSGMAINAPP_HPP_ +#define OSGMAINAPP_HPP_ + +//Android log +#include +#include +#include +#include + +//Standard libraries +#include + +//osg +#include +#include +#include +#include +#include +#include +#include +//osgText +#include +//osgDB +#include +#include +#include +#include +//osg_viewer +#include +#include +#include +//osgGA +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +//Self headers +#include "OsgAndroidNotifyHandler.hpp" + +//Static plugins Macro +USE_OSGPLUGIN(ive) +USE_OSGPLUGIN(osg) +USE_OSGPLUGIN(osg2) +USE_OSGPLUGIN(terrain) +USE_OSGPLUGIN(rgb) +USE_OSGPLUGIN(OpenFlight) +USE_OSGPLUGIN(dds) +//Static DOTOSG +USE_DOTOSGWRAPPER_LIBRARY(osg) +USE_DOTOSGWRAPPER_LIBRARY(osgFX) +USE_DOTOSGWRAPPER_LIBRARY(osgParticle) +USE_DOTOSGWRAPPER_LIBRARY(osgTerrain) +USE_DOTOSGWRAPPER_LIBRARY(osgText) +USE_DOTOSGWRAPPER_LIBRARY(osgViewer) +USE_DOTOSGWRAPPER_LIBRARY(osgVolume) +//Static serializer +USE_SERIALIZER_WRAPPER_LIBRARY(osg) +USE_SERIALIZER_WRAPPER_LIBRARY(osgAnimation) +USE_SERIALIZER_WRAPPER_LIBRARY(osgFX) +USE_SERIALIZER_WRAPPER_LIBRARY(osgManipulator) +USE_SERIALIZER_WRAPPER_LIBRARY(osgParticle) +USE_SERIALIZER_WRAPPER_LIBRARY(osgTerrain) +USE_SERIALIZER_WRAPPER_LIBRARY(osgText) +USE_SERIALIZER_WRAPPER_LIBRARY(osgVolume) + +#define LOG_TAG "osgNativeLib" +#define LOGI(...) __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__) +#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__) + +struct Model{ + std::string filename; + std::string name; +}; + +class OsgMainApp{ +private: + osg::ref_ptr _viewer; + osg::ref_ptr _root; + osg::ref_ptr _state; + osg::ref_ptr _manipulator; + + float _lodScale; + unsigned int _prevFrame; + + bool _initialized; + bool _clean_scene; + + OsgAndroidNotifyHandler *_notifyHandler; + + std::vector _vModels; + std::vector _vModelsToLoad; + std::vector _vModelsToDelete; + + void loadModels(); + void deleteModels(); + +public: + OsgMainApp(); + ~OsgMainApp(); + + //Initialization function + void initOsgWindow(int x,int y,int width,int height); + //Draw + void draw(); + //Events + void mouseButtonPressEvent(float x,float y,int button); + void mouseButtonReleaseEvent(float x,float y,int button); + void mouseMoveEvent(float x,float y); + void keyboardDown(int key); + void keyboardUp(int key); + //Loading and unloading + void loadObject(std::string filePath); + void loadObject(std::string name,std::string filePath); + void unLoadObject(int number); + void clearScene(); + //Other functions + int getNumberObjects(); + std::string getObjectName(int nunmber); + + void setClearColor(osg::Vec4f color); + osg::Vec4f getClearColor(); +}; + + +#endif /* OSGMAINAPP_HPP_ */ diff --git a/examples/osgAndroidExampleGLES1/jni/osgNativeLib.cpp b/examples/osgAndroidExampleGLES1/jni/osgNativeLib.cpp new file mode 100644 index 000000000..4c8efc3f2 --- /dev/null +++ b/examples/osgAndroidExampleGLES1/jni/osgNativeLib.cpp @@ -0,0 +1,113 @@ +#include +#include +#include + +#include + +#include "OsgMainApp.hpp" + +OsgMainApp mainApp; + +extern "C" { + JNIEXPORT void JNICALL Java_osg_AndroidExample_osgNativeLib_init(JNIEnv * env, jobject obj, jint width, jint height); + JNIEXPORT void JNICALL Java_osg_AndroidExample_osgNativeLib_step(JNIEnv * env, jobject obj); + JNIEXPORT void JNICALL Java_osg_AndroidExample_osgNativeLib_clearContents(JNIEnv * env, jobject obj); + JNIEXPORT void JNICALL Java_osg_AndroidExample_osgNativeLib_mouseButtonPressEvent(JNIEnv * env, jobject obj, jfloat x, jfloat y, jint button); + JNIEXPORT void JNICALL Java_osg_AndroidExample_osgNativeLib_mouseButtonReleaseEvent(JNIEnv * env, jobject obj, jfloat x, jfloat y, jint button); + JNIEXPORT void JNICALL Java_osg_AndroidExample_osgNativeLib_mouseMoveEvent(JNIEnv * env, jobject obj, jfloat x, jfloat y); + JNIEXPORT void JNICALL Java_osg_AndroidExample_osgNativeLib_keyboardDown(JNIEnv * env, jobject obj, jint key); + JNIEXPORT void JNICALL Java_osg_AndroidExample_osgNativeLib_keyboardUp(JNIEnv * env, jobject obj, jint key); + JNIEXPORT jintArray JNICALL Java_osg_AndroidExample_osgNativeLib_getClearColor(JNIEnv * env, jobject obj); + JNIEXPORT void JNICALL Java_osg_AndroidExample_osgNativeLib_setClearColor(JNIEnv * env, jobject obj, jint red, jint green, jint blue); + JNIEXPORT void JNICALL Java_osg_AndroidExample_osgNativeLib_loadObject(JNIEnv * env, jobject obj, jstring address); + JNIEXPORT void JNICALL Java_osg_AndroidExample_osgNativeLib_unLoadObject(JNIEnv * env, jobject obj, jint number); + JNIEXPORT jobjectArray JNICALL Java_osg_AndroidExample_osgNativeLib_getObjectNames(JNIEnv * env, jobject obj); +}; + +JNIEXPORT void JNICALL Java_osg_AndroidExample_osgNativeLib_init(JNIEnv * env, jobject obj, jint width, jint height){ + mainApp.initOsgWindow(0,0,width,height); +} +JNIEXPORT void JNICALL Java_osg_AndroidExample_osgNativeLib_step(JNIEnv * env, jobject obj){ + mainApp.draw(); +} +JNIEXPORT void JNICALL Java_osg_AndroidExample_osgNativeLib_clearContents(JNIEnv * env, jobject obj){ + mainApp.clearScene(); +} +JNIEXPORT void JNICALL Java_osg_AndroidExample_osgNativeLib_mouseButtonPressEvent(JNIEnv * env, jobject obj, jfloat x, jfloat y, jint button){ + mainApp.mouseButtonPressEvent(x,y,button); +} +JNIEXPORT void JNICALL Java_osg_AndroidExample_osgNativeLib_mouseButtonReleaseEvent(JNIEnv * env, jobject obj, jfloat x, jfloat y, jint button){ + mainApp.mouseButtonReleaseEvent(x,y,button); +} +JNIEXPORT void JNICALL Java_osg_AndroidExample_osgNativeLib_mouseMoveEvent(JNIEnv * env, jobject obj, jfloat x, jfloat y){ + mainApp.mouseMoveEvent(x,y); +} +JNIEXPORT void JNICALL Java_osg_AndroidExample_osgNativeLib_keyboardDown(JNIEnv * env, jobject obj, jint key){ + mainApp.keyboardDown(key); +} +JNIEXPORT void JNICALL Java_osg_AndroidExample_osgNativeLib_keyboardUp(JNIEnv * env, jobject obj, jint key){ + mainApp.keyboardUp(key); +} +JNIEXPORT jintArray JNICALL Java_osg_AndroidExample_osgNativeLib_getClearColor(JNIEnv * env, jobject obj){ + + jintArray color; + color = env->NewIntArray(3); + if (color == NULL) { + return NULL; + } + osg::Vec4 vTemp1 = mainApp.getClearColor(); + + jint vTemp2[3]; + + vTemp2[0] = (int) (vTemp1.r() * 255); + vTemp2[1] = (int) (vTemp1.g() * 255); + vTemp2[2] = (int) (vTemp1.b() * 255); + + std::cout<SetIntArrayRegion(color, 0, 3, vTemp2); + + return color; +} +JNIEXPORT void JNICALL Java_osg_AndroidExample_osgNativeLib_setClearColor(JNIEnv * env, jobject obj, jint red, jint green, jint blue){ + osg::Vec4 tVec((float) red / 255.0f, (float) green / 255.0f, (float) blue / 255.0f, 0.0f); + mainApp.setClearColor(tVec); +} +JNIEXPORT void JNICALL Java_osg_AndroidExample_osgNativeLib_loadObject(JNIEnv * env, jobject obj, jstring address){ + //Import Strings from JNI + const char *nativeAddress = env->GetStringUTFChars(address, false); + + mainApp.loadObject(std::string(nativeAddress)); + + //Release Strings to JNI + env->ReleaseStringUTFChars(address, nativeAddress); +} +JNIEXPORT void JNICALL Java_osg_AndroidExample_osgNativeLib_loadObject(JNIEnv * env, jobject obj, jstring address, jstring name){ + //Import Strings from JNI + const char *nativeAddress = env->GetStringUTFChars(address, false); + const char *nativeName = env->GetStringUTFChars(name, false); + + mainApp.loadObject(std::string(nativeName),std::string(nativeAddress)); + + //Release Strings to JNI + env->ReleaseStringUTFChars(address, nativeAddress); + env->ReleaseStringUTFChars(address, nativeName); +} +JNIEXPORT void JNICALL Java_osg_AndroidExample_osgNativeLib_unLoadObject(JNIEnv * env, jobject obj, jint number){ + + mainApp.unLoadObject(number); + +} +JNIEXPORT jobjectArray JNICALL Java_osg_AndroidExample_osgNativeLib_getObjectNames(JNIEnv * env, jobject obj){ + + jobjectArray fileNames; + unsigned int numModels = mainApp.getNumberObjects(); + fileNames = (jobjectArray)env->NewObjectArray(numModels,env->FindClass("java/lang/String"),env->NewStringUTF("")); + + for(unsigned int i=0;i < numModels;i++){ + std::string name = mainApp.getObjectName(i); + env->SetObjectArrayElement(fileNames,i,env->NewStringUTF(name.c_str())); + } + + return fileNames; +} diff --git a/examples/osgAndroidExampleGLES1/proguard.cfg b/examples/osgAndroidExampleGLES1/proguard.cfg new file mode 100644 index 000000000..12dd0392c --- /dev/null +++ b/examples/osgAndroidExampleGLES1/proguard.cfg @@ -0,0 +1,36 @@ +-optimizationpasses 5 +-dontusemixedcaseclassnames +-dontskipnonpubliclibraryclasses +-dontpreverify +-verbose +-optimizations !code/simplification/arithmetic,!field/*,!class/merging/* + +-keep public class * extends android.app.Activity +-keep public class * extends android.app.Application +-keep public class * extends android.app.Service +-keep public class * extends android.content.BroadcastReceiver +-keep public class * extends android.content.ContentProvider +-keep public class * extends android.app.backup.BackupAgentHelper +-keep public class * extends android.preference.Preference +-keep public class com.android.vending.licensing.ILicensingService + +-keepclasseswithmembernames class * { + native ; +} + +-keepclasseswithmembernames class * { + public (android.content.Context, android.util.AttributeSet); +} + +-keepclasseswithmembernames class * { + public (android.content.Context, android.util.AttributeSet, int); +} + +-keepclassmembers enum * { + public static **[] values(); + public static ** valueOf(java.lang.String); +} + +-keep class * implements android.os.Parcelable { + public static final android.os.Parcelable$Creator *; +} diff --git a/examples/osgAndroidExampleGLES1/res/drawable-hdpi/osg.png b/examples/osgAndroidExampleGLES1/res/drawable-hdpi/osg.png new file mode 100644 index 000000000..e9377f500 Binary files /dev/null and b/examples/osgAndroidExampleGLES1/res/drawable-hdpi/osg.png differ diff --git a/examples/osgAndroidExampleGLES1/res/drawable-hdpi/web_browser.png b/examples/osgAndroidExampleGLES1/res/drawable-hdpi/web_browser.png new file mode 100644 index 000000000..ed13e46bd Binary files /dev/null and b/examples/osgAndroidExampleGLES1/res/drawable-hdpi/web_browser.png differ diff --git a/examples/osgAndroidExampleGLES1/res/drawable-ldpi/osg.png b/examples/osgAndroidExampleGLES1/res/drawable-ldpi/osg.png new file mode 100644 index 000000000..0b8cce36b Binary files /dev/null and b/examples/osgAndroidExampleGLES1/res/drawable-ldpi/osg.png differ diff --git a/examples/osgAndroidExampleGLES1/res/drawable-mdpi/osg.png b/examples/osgAndroidExampleGLES1/res/drawable-mdpi/osg.png new file mode 100644 index 000000000..f8275b46b Binary files /dev/null and b/examples/osgAndroidExampleGLES1/res/drawable-mdpi/osg.png differ diff --git a/examples/osgAndroidExampleGLES1/res/layout/dialog_text_entry.xml b/examples/osgAndroidExampleGLES1/res/layout/dialog_text_entry.xml new file mode 100644 index 000000000..767021164 --- /dev/null +++ b/examples/osgAndroidExampleGLES1/res/layout/dialog_text_entry.xml @@ -0,0 +1,29 @@ + + + + + + + diff --git a/examples/osgAndroidExampleGLES1/res/layout/main.xml b/examples/osgAndroidExampleGLES1/res/layout/main.xml new file mode 100644 index 000000000..3a5f117d3 --- /dev/null +++ b/examples/osgAndroidExampleGLES1/res/layout/main.xml @@ -0,0 +1,12 @@ + + + + diff --git a/examples/osgAndroidExampleGLES1/res/layout/ui_layout_gles.xml b/examples/osgAndroidExampleGLES1/res/layout/ui_layout_gles.xml new file mode 100644 index 000000000..1d10283f5 --- /dev/null +++ b/examples/osgAndroidExampleGLES1/res/layout/ui_layout_gles.xml @@ -0,0 +1,45 @@ + + + + + + + + +