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.
精彩评论