Projects > cpp > Issues > Bug #848

We are migrating issue tracker of Cocos2d-x Project to Github, please create new issue there. Thanks.

Create Issue on Github

If use HVGA resource on WVGA device, Accelerometer values are wrong!

Bug #848 [Closed]
dumganhar 2011-11-08 18:28 . Updated over 4 years ago
void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit(JNIEnv*  env, jobject thiz, jint w, jint h)
{
    if (!cocos2d::CCDirector::sharedDirector()->getOpenGLView())
    {
    cocos2d::CCEGLView *view = &cocos2d::CCEGLView::sharedOpenGLView();
        view->setFrameWidthAndHeight(w, h);
        // if you want to run in WVGA with HVGA resource, set it
        _view->create(480, 320);_
        cocos2d::CCDirector::sharedDirector()->setOpenGLView(view);

        AppDelegate *pAppDelegate = new AppDelegate();
        cocos2d::CCApplication::sharedApplication().run();
    }
    else
    {
        cocos2d::CCTextureCache::reloadAllTextures();
        cocos2d::CCDirector::sharedDirector()->setGLDefaultValues();
    }
}

In the function CCAccelerometer::update, the values of x, y, z are wrong!

dumganhar 2011-11-08 18:30
  • Category set to 2
dumganhar 2011-11-08 19:47
  • Target version set to cocos2d-1.0.1-x-0.10.0
walzer@cocos2d-x.org 2011-11-27 06:44
  • Assignee set to dumganhar

Have you fixed this bug?

dumganhar 2011-11-27 21:54
  • Status changed from New to Resolved
zhangxm 2011-11-29 18:20
  • Status changed from Resolved to Closed
walzer@cocos2d-x.org 2012-05-25 08:02
  • Project changed from cocos2d-x to cpp
  • Category deleted (2)
  • Target version deleted (cocos2d-1.0.1-x-0.10.0)

Atom PDF

Status:Closed
Start date:2011-11-08
Priority:Normal
Due date:
Assignee:dumganhar
% Done:

0%

Category:-
Target version:-

Sign up for our newsletter to keep up with the latest developments, releases and updates for Cocos2d-x.