axmol/cocos/2d/platform/android/CCDevice.cpp

35 lines
527 B
C++
Raw Normal View History

#include "platform/CCDevice.h"
#include "jni/DPIJni.h"
#include "nativeactivity.h"
NS_CC_BEGIN
int Device::getDPI()
{
static int dpi = -1;
if (dpi == -1)
{
dpi = (int)getDPIJNI();
}
return dpi;
}
void Device::setAccelerometerEnabled(bool isEnabled)
{
if (isEnabled)
{
2013-11-29 17:17:15 +08:00
enableAccelerometer_native();
}
else
{
2013-11-29 17:17:15 +08:00
disableAccelerometer_native();
}
}
void Device::setAccelerometerInterval(float interval)
{
2013-11-29 17:17:15 +08:00
setAccelerometerInterval_native(interval);
}
NS_CC_END