axmol/cocos2dx/platform/android/CCXApplication_android.cpp

64 lines
1.3 KiB
C++
Raw Normal View History

2010-11-03 11:01:17 +08:00
#include "CCXApplication_android.h"
#include "CCXUIImage_android.h"
#include "CCXEGLView_android.h"
#include "CCDirector.h"
// #include "CCXGLExtFunc.h"
#include <GLES/glext.h>
#include <android/log.h>
namespace cocos2d {
static CCXApplication *s_pApplication;
CCXApplication::CCXApplication()
{
s_pApplication = this;
}
CCXApplication::~CCXApplication()
{
}
ccDeviceOrientation CCXApplication::setDeviceOrientation(ccDeviceOrientation eOritation)
{
return eOritation;
}
CGRect CCXApplication::statusBarFrame()
{
CGRect rc;
return rc;
}
2010-11-19 14:57:58 +08:00
void CCXApplication::Run()
{
applicationDidFinishLaunching();
}
2010-11-03 11:01:17 +08:00
//////////////////////////////////////////////////////////////////////////
/// Implement static class member
//////////////////////////////////////////////////////////////////////////
2010-11-19 14:57:58 +08:00
CCXApplication * CCXApplication::sharedApplication()
2010-11-03 11:01:17 +08:00
{
return s_pApplication;
}
}
extern "C"
{
JavaVM *gJavaVM = NULL;
jint JNI_OnLoad(JavaVM *vm, void *reserved)
{
gJavaVM = vm;
return JNI_VERSION_1_4;
}
2010-11-04 17:33:31 +08:00
void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeRender(JNIEnv* env)
2010-11-03 11:01:17 +08:00
{
2010-11-19 14:57:58 +08:00
cocos2d::CCDirector::sharedDirector()->preMainLoop();
2010-11-03 11:01:17 +08:00
}
}