开发者

iOS/OpenGL: How to handle a 12288x1024 pixel scene

开发者 https://www.devze.com 2023-03-24 09:08 出处:网络
I\'m implementing a landscape mode iPad finger painting app based on Apple\'s GLPaint example. My drawing canvas is 12x wider than the screen size: 12288 x 768 pixels.

I'm implementing a landscape mode iPad finger painting app based on Apple's GLPaint example. My drawing canvas is 12x wider than the screen size: 12288 x 768 pixels.

Currently I have placed 12 PaintingView (see above example) instances side by side on a UIScrollView and h开发者_开发知识库ave modified the example to handle drawing across these instances:

    // add PaintingView instance to scrollView (self)
    // and to the drawingViews array
    for (int drawingIndex = 0; drawingIndex < 12; drawingIndex++) {
        PaintingView *drawingView = [[PaintingView alloc] 
            initWithFrame:CGRectMake(drawingIndex*1024, 0, 1024, 768)];
        [self addSubview:drawingView];
        [drawingViews addObject:drawingView];
        [drawingView release];
    }

While it works fine, I have the feeling that this is not the proper way of dealing with my requirements. Being a novice with OpenGL I have tried various approaches, but failed to create a scene large enough and a viewport that scrolls in sync with the UIScrollView.

Any hints/comments are much appreciated.

0

精彩评论

暂无评论...
验证码 换一张
取 消