Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

眼镜模式 #18

Closed
HuiiChong opened this issue Jun 21, 2016 · 2 comments
Closed

眼镜模式 #18

HuiiChong opened this issue Jun 21, 2016 · 2 comments

Comments

@HuiiChong
Copy link

在只支持竖屏的app中 怎么在眼镜模式中 使用横屏分割界面?

@ashqal
Copy link
Owner

ashqal commented Jun 21, 2016

没试过,提供个思路,MD360Renderer.m中处理了双屏的绘制,把宽度对半分,然后glViewport绘制左边和右边。。你可能需要把高度对半分,然后绘制上和下

- (void) rendererOnDrawFrame:(EAGLContext*)context width:(int)width height:(int)height{

    ....
    float scale = [GLUtil getScrrenScale];
    int widthPx = width * scale;
    int heightPx = height * scale;

    int size = [self.mDisplayStrategyManager getVisibleSize];
    int itemWidthPx = widthPx * 1.0 / size;
    for (int i = 0; i < size; i++ ) {
        if (i >= [self.mDirectors count]) {
            return;
        }

        MD360Director* direcotr = [self.mDirectors objectAtIndex:i];
        glViewport(itemWidthPx * i, 0, itemWidthPx, heightPx);

        // Update Projection
        [direcotr updateProjection:itemWidthPx height:heightPx];

        ....
    }
}

@HuiiChong
Copy link
Author

ok,I will make a try. tks

@ashqal ashqal closed this as completed Jun 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants