Last active
January 29, 2016 03:06
-
-
Save ricardoquesada/cd4dae81733c089685c5 to your computer and use it in GitHub Desktop.
cocos2d-x with android GL trace support
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "AppDelegate.h" | |
#include "cocos2d.h" | |
#include "platform/android/jni/JniHelper.h" | |
#include <jni.h> | |
#include <android/log.h> | |
#include <dlfcn.h> | |
#define LOG_TAG "main" | |
#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__) | |
using namespace cocos2d; | |
void cocos_android_app_init (JNIEnv* env) { | |
LOGD("cocos_android_app_init"); | |
AppDelegate *pAppDelegate = new AppDelegate(); | |
} | |
#define PACKAGE_NAME "org.cocos2dx.mygame" // Fill this in with the actual package name | |
#define GAPII_SO_PATH "/data/data/" PACKAGE_NAME "/lib/libgapii.so" | |
struct GapiiLoader { | |
GapiiLoader() { | |
if (!dlopen(GAPII_SO_PATH, RTLD_LOCAL | RTLD_NOW)) { | |
__android_log_print(ANDROID_LOG_ERROR, "GAPII", "Failed loading " GAPII_SO_PATH); | |
} | |
} | |
}; | |
GapiiLoader __attribute__((used)) gGapiiLoader; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment