简体   繁体   English

MoSync 3.3.1,横向屏幕方向导致崩溃

[英]MoSync 3.3.1, landscape screen orientation causing crashing

Im creating an app using OpenGL ES 2.0 on Mosync 3.3.1 and ideally I would like the screen to rotate to whatever orientation the screen is tilted. 我在Mosync 3.3.1上使用OpenGL ES 2.0创建了一个应用程序,理想情况下,我希望屏幕旋转到屏幕倾斜的任何方向。 However using maScreenSetSupportedOrientations() and setting it to dynamic or landscape caused to the app to crash when it tries to rotate to landscape. 但是,使用maScreenSetSupportedOrientations()并将其设置为动态或横向会导致应用在尝试旋转为横向时崩溃。 Is this a bug that needs fixing or am I doing something wrong? 这是需要修复的错误,还是我做错了什么? Im sending my code to a nexus 7 tablet. 我将我的代码发送到nexus 7平板电脑。

Im initiating the call in the init function of my code: 我在代码的init函数中启动调用:

maScreenSetSupportedOrientations(MA_SCREEN_ORIENTATION_DYNAMIC);
maScreenSetOrientation(MA_SCREEN_ORIENTATION_LANDSCAPE);

my whole code is available here: http://codetidy.com/6378/ 我的整个代码都可以在这里找到: http : //codetidy.com/6378/

It works for me 这个对我有用

extern "C" int MAMain() { // Declare MAMain function as "C"
maScreenSetSupportedOrientations(MA_SCREEN_ORIENTATION_LANDSCAPE);
Moblet::run(new MyGLMoblet());
return 0;

instead of 代替

void init() { // Screen Size

    mWidth = EXTENT_X(maGetScrSize());
    mHeight = EXTENT_Y(maGetScrSize());

    maScreenSetSupportedOrientations(MA_SCREEN_ORIENTATION_PORTRAIT|MA_SCREEN_ORIENTATION_LANDSCAPE);
    maScreenSetOrientation(MA_SCREEN_ORIENTATION_LANDSCAPE);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM