I am calling a native C++ function from Java using JNI. This is working fine. The problem I am having is then accessing a CCLayer from there.
`void Java_com_mycompany_testproject_TestProject_testFunc(JNIEnv *env, jobject thiz)
__android_log_print(ANDROID_LOG_DEBUG, “JNI-C++”, “testFunc”);
TestProject* testProject = (TestProject* ) (CCDirector::sharedDirector()->getRunningScene()); testProject-> ** PROBLEM HERE ** }`
No available functions are coming up to access. As if *testProject was never casted to anything. By default at the top of main.cpp there is the line:
How do I call functions from main.cpp to TestProject.h or something similar like HelloWorldScene.h