openGL ES retina support
Posted
by
Bryan
on Stack Overflow
See other posts from Stack Overflow
or by Bryan
Published on 2010-12-21T22:38:52Z
Indexed on
2010/12/21
22:54 UTC
Read the original article
Hit count: 281
I'm trying to get the avTouch sample code app to run on the retina display. Has anyone done this?
In the CALevelMeter class, I've tried the following:
- (id)initWithCoder:(NSCoder *)coder {
if (self = [super initWithCoder:coder]) {
CGFloat f = self.contentScaleFactor;
if ([self respondsToSelector:@selector(contentScaleFactor)])
{
self.contentScaleFactor = [[UIScreen mainScreen] scale];
}
f = self.contentScaleFactor;
_showsPeaks = YES;
_channelNumbers = [[NSArray alloc] initWithObjects:[NSNumber numberWithInt:0], nil];
_vertical = NO;
_useGL = YES;
_meterTable = new MeterTable(kMinDBvalue);
[self layoutSubLevelMeters];
[self registerForBackgroundNotifications];
}
return self;
}
and it sets the contentScaleFactor to "2". Great, that was expected. But then in the layoutSubviews, CALevelMeter frame is still 1/2 of what it should be.
Any ideas?
© Stack Overflow or respective owner