Skip to content

Instantly share code, notes, and snippets.

@ricardoquesada
Last active January 29, 2016 03:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ricardoquesada/cd4dae81733c089685c5 to your computer and use it in GitHub Desktop.
Save ricardoquesada/cd4dae81733c089685c5 to your computer and use it in GitHub Desktop.
cocos2d-x with android GL trace support
#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